-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ♻️ Move botão da Forja para aba de items * ♻️ Refactor Weapon and create generic Item type * ✨ Create shield * ✨ Create Misc Items * ✨ Gerador de poções * 🚨 Fix typecheck error
- Loading branch information
1 parent
fc7aebb
commit b5f2103
Showing
14 changed files
with
151 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,7 @@ | ||
import { showForgeDialog } from '../dialog/forge-dialog'; | ||
import { localize, isClientGM } from './utils/game'; | ||
// @ts-expect-error - Forge type definitions are not available | ||
import { renderForgeButton } from './utils/render-forge-button'; | ||
|
||
export const registerHooks = () => { | ||
Hooks.on('getSceneControlButtons', onGetSceneControlButtons); | ||
}; | ||
|
||
const onGetSceneControlButtons = (buttons: SceneControl[]) => { | ||
const covilTools = { | ||
activeTool: 'select', | ||
icon: 'cvd-main-icon', | ||
layer: 'covil', | ||
name: 'covil', | ||
title: localize('covil-velho-dragao.title'), | ||
visible: isClientGM(), | ||
tools: [ | ||
{ | ||
name: 'forge', | ||
icon: 'ra ra-anvil', | ||
title: localize('covil-velho-dragao.forge'), | ||
button: true, | ||
onClick: () => { | ||
showForgeDialog(); | ||
}, | ||
}, | ||
], | ||
}; | ||
|
||
buttons.push(covilTools); | ||
// Hooks.on('getSceneControlButtons', onGetSceneControlButtons); | ||
Hooks.on('renderItemDirectory', renderForgeButton); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { showForgeDialog } from '../../dialog/forge-dialog'; | ||
import { localize, isClientGM } from './game'; | ||
|
||
/** | ||
* @param {Application} app | ||
* @param {jQuery} html | ||
*/ | ||
|
||
export const renderForgeButton = (app, html) => { | ||
if (isClientGM()) { | ||
const section = document.createElement('header'); | ||
section.classList.add('character-generator'); | ||
section.classList.add('directory-header'); | ||
|
||
const dirHeader = html[0].querySelector('.directory-header'); | ||
dirHeader.parentNode.insertBefore(section, dirHeader); | ||
section.insertAdjacentHTML( | ||
'afterbegin', | ||
` | ||
<div class="header-actions action-buttons flexrow"> | ||
<button class="forge-item-button"><i class="ra ra-anvil"></i>${localize('covil-velho-dragao.forge')}</button> | ||
</div> | ||
`, | ||
); | ||
section.querySelector('.forge-item-button').addEventListener('click', () => { | ||
console.log('forjando'); | ||
showForgeDialog(); | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { OldDragon2Item } from './item'; | ||
import { OldDragon2Shield } from './shield'; | ||
import { OldDragon2Weapon } from './weapon'; | ||
|
||
export { OldDragon2Item, OldDragon2Weapon, OldDragon2Shield }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export type OldDragon2Item = { | ||
name: string; | ||
type: string; | ||
_id?: string; | ||
img?: string; | ||
system?: { | ||
odo_id?: string; | ||
description?: string; | ||
quantity?: number; | ||
cost?: string; | ||
weight_in_load?: number; | ||
weight_in_grams?: number; | ||
magic_item?: boolean; | ||
type?: string; | ||
}; | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
effects?: any[]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { OldDragon2Item } from './item'; | ||
|
||
export interface OldDragon2Shield extends Omit<OldDragon2Item, 'type'> { | ||
type: 'shield'; | ||
system?: OldDragon2Item['system'] & { | ||
bonus_ca: number; | ||
type: 'shield'; | ||
}; | ||
} |
Oops, something went wrong.