mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-08 06:56:12 +01:00
Items now copy over their features to Character
This commit is contained in:
parent
261867a4cc
commit
3d735e6a09
13 changed files with 167 additions and 103 deletions
|
|
@ -307,13 +307,9 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) {
|
|||
getItem(element) {
|
||||
const listElement = (element.target ?? element).closest('[data-item-id]');
|
||||
const itemId = listElement.dataset.itemId;
|
||||
if (listElement.dataset.type === 'effect') {
|
||||
return this.document.effects.get(itemId);
|
||||
} else if (['armor', 'weapon', 'feature', 'consumable', 'miscellaneous'].includes(listElement.dataset.type)) {
|
||||
return this.document.items.get(itemId);
|
||||
} else {
|
||||
return this.document.system[listElement.dataset.type].system.actions.find(x => x.id === itemId);
|
||||
}
|
||||
return listElement.dataset.type === 'effect'
|
||||
? this.document.effects.get(itemId)
|
||||
: this.document.items.get(itemId);
|
||||
}
|
||||
|
||||
static triggerContextMenu(event, button) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue