From aee8753f6366d7cccbac2d7215b50e6da50fec35 Mon Sep 17 00:00:00 2001 From: Joaquin Pereyra Date: Wed, 16 Jul 2025 13:41:22 -0300 Subject: [PATCH] FEAT: add resources to inventory-item template --- .../applications/sheets/actors/character.mjs | 99 +------ .../sheets/api/application-mixin.mjs | 17 +- module/applications/sheets/api/base-item.mjs | 1 - module/helpers/handlebarsHelper.mjs | 4 +- templates/sheets/actors/adversary/effects.hbs | 2 + .../sheets/actors/adversary/features.hbs | 1 + templates/sheets/actors/adversary/sidebar.hbs | 1 + templates/sheets/actors/character/effects.hbs | 2 + .../sheets/actors/character/features.hbs | 1 + .../sheets/actors/character/inventory.hbs | 2 + templates/sheets/actors/character/sidebar.hbs | 2 + templates/sheets/actors/companion/effects.hbs | 3 +- .../sheets/actors/environment/features.hbs | 1 + .../environment/potentialAdversaries.hbs | 1 + .../global/partials/domain-card-item.hbs | 30 +- .../partials/inventory-fieldset-items-V2.hbs | 4 + .../global/partials/inventory-item-V2.hbs | 272 ++++++++++-------- templates/sheets/global/tabs/tab-effects.hbs | 2 + templates/sheets/global/tabs/tab-features.hbs | 1 + 19 files changed, 224 insertions(+), 222 deletions(-) diff --git a/module/applications/sheets/actors/character.mjs b/module/applications/sheets/actors/character.mjs index 5de6a5fb..199e6de0 100644 --- a/module/applications/sheets/actors/character.mjs +++ b/module/applications/sheets/actors/character.mjs @@ -23,11 +23,8 @@ export default class CharacterSheet extends DHBaseActorSheet { makeDeathMove: CharacterSheet.#makeDeathMove, levelManagement: CharacterSheet.#levelManagement, toggleEquipItem: CharacterSheet.#toggleEquipItem, - useItem: this.useItem, //TODO Fix this - useAction: this.useAction, - toggleResourceDice: this.toggleResourceDice, - handleResourceDice: this.handleResourceDice, - toChat: this.toChat + toggleResourceDice: CharacterSheet.#toggleResourceDice, + handleResourceDice: CharacterSheet.#handleResourceDice, }, window: { resizable: true @@ -505,22 +502,21 @@ export default class CharacterSheet extends DHBaseActorSheet { /* -------------------------------------------- */ /* Application Listener Actions */ /* -------------------------------------------- */ + async updateItemResource(event) { - const item = this.getItem(event.currentTarget); + const item = getDocFromElement(event.currentTarget); if (!item) return; const max = item.system.resource.max ? itemAbleRollParse(item.system.resource.max, this.document, item) : null; const value = max ? Math.min(Number(event.currentTarget.value), max) : event.currentTarget.value; await item.update({ 'system.resource.value': value }); - this.render(); } async updateItemQuantity(event) { - const item = this.getItem(event.currentTarget); + const item = getDocFromElement(event.currentTarget); if (!item) return; await item.update({ 'system.quantity': event.currentTarget.value }); - this.render(); } /* -------------------------------------------- */ @@ -641,53 +637,18 @@ export default class CharacterSheet extends DHBaseActorSheet { await doc?.update({ 'system.inVault': !doc.system.inVault }); } - /** - * Use a item - * @type {ApplicationClickAction} - */ - static async useItem(event, button) { - const item = this.getItem(button); - if (!item) return; - - // Should dandle its actions. Or maybe they'll be separate buttons as per an Issue on the board - if (item.type === 'feature') { - item.use(event); - } else if (item instanceof ActiveEffect) { - item.toChat(this); - } else { - const wasUsed = await item.use(event); - if (wasUsed && item.type === 'weapon') { - Hooks.callAll(CONFIG.DH.HOOKS.characterAttack, {}); - } - } - } - - /** - * Use an action - * @type {ApplicationClickAction} - */ - static async useAction(event, button) { - const item = this.getItem(button); - if (!item) return; - - const action = item.system.actions.find(x => x.id === button.dataset.actionId); - if (!action) return; - - action.use(event); - } - /** * Toggle the used state of a resource dice. * @type {ApplicationClickAction} */ - static async toggleResourceDice(event) { - const target = event.target.closest('.item-resource'); - const item = this.getItem(event); - if (!item) return; + static async #toggleResourceDice(event, target) { + const item = getDocFromElement(target); + + const { dice } = event.target.closest('.item-resource').dataset; + const diceState = item.system.resource.diceStates[dice]; - const diceState = item.system.resource.diceStates[target.dataset.dice]; await item.update({ - [`system.resource.diceStates.${target.dataset.dice}.used`]: diceState?.used ? !diceState.used : true + [`system.resource.diceStates.${dice}.used`]: !diceState.used }); } @@ -695,8 +656,8 @@ export default class CharacterSheet extends DHBaseActorSheet { * Handle the roll values of resource dice. * @type {ApplicationClickAction} */ - static async handleResourceDice(event) { - const item = this.getItem(event); + static async #handleResourceDice(_, target) { + const item = getDocFromElement(target); if (!item) return; const rollValues = await game.system.api.applications.dialogs.ResourceDiceDialog.create(item, this.document); @@ -708,41 +669,11 @@ export default class CharacterSheet extends DHBaseActorSheet { return acc; }, {}) }); - this.render(); - } - - /** - * Send item to Chat - * @type {ApplicationClickAction} - */ - static async toChat(event, button) { - if (button?.dataset?.type === 'experience') { - const experience = this.document.system.experiences[button.dataset.uuid]; - const cls = getDocumentClass('ChatMessage'); - const systemData = { - name: game.i18n.localize('DAGGERHEART.GENERAL.Experience.single'), - description: `${experience.name} ${experience.value.signedString()}` - }; - const msg = new cls({ - type: 'abilityUse', - user: game.user.id, - system: systemData, - content: await foundry.applications.handlebars.renderTemplate( - 'systems/daggerheart/templates/ui/chat/ability-use.hbs', - systemData - ) - }); - - cls.create(msg.toObject()); - } else { - const item = this.getItem(event); - if (!item) return; - item.toChat(this.document.id); - } + //this.render(); } async _onDragStart(event) { - const item = this.getItem(event); + const item = getDocFromElement(event.target); const dragData = { type: item.documentName, diff --git a/module/applications/sheets/api/application-mixin.mjs b/module/applications/sheets/api/application-mixin.mjs index e27ae7a6..3c177241 100644 --- a/module/applications/sheets/api/application-mixin.mjs +++ b/module/applications/sheets/api/application-mixin.mjs @@ -82,6 +82,7 @@ export default function DHApplicationMixin(Base) { deleteDoc: DHSheetV2.#deleteDoc, toChat: DHSheetV2.#toChat, useItem: DHSheetV2.#useItem, + useAction: DHSheetV2.#useAction, toggleEffect: DHSheetV2.#toggleEffect, }, contextMenus: [{ @@ -485,17 +486,29 @@ export default function DHApplicationMixin(Base) { */ static async #useItem(event, target) { let doc = getDocFromElement(target); - // TODO: REDO this if (!doc) { const { actionId } = target.closest('[data-action-id]').dataset; const { actions, attack } = this.document.system; - doc = attack.id === actionId ? attack : actions?.find(a => a.id === actionId); + doc = attack?.id === actionId ? attack : actions?.find(a => a.id === actionId); } await doc.use(event); } + /** + * Use a item + * @type {ApplicationClickAction} + */ + static async #useAction(event, target) { + const doc = getDocFromElement(target); + const { actionId } = target.closest('[data-action-id]').dataset; + const { actions, attack } = doc.system; + const action = attack?.id === actionId ? attack : actions?.find(a => a.id === actionId); + await action.use(event); + } + + /** * Toggle a ActiveEffect * @type {ApplicationClickAction} diff --git a/module/applications/sheets/api/base-item.mjs b/module/applications/sheets/api/base-item.mjs index b8ef102f..3d677ef8 100644 --- a/module/applications/sheets/api/base-item.mjs +++ b/module/applications/sheets/api/base-item.mjs @@ -26,7 +26,6 @@ export default class DHBaseItemSheet extends DHApplicationMixin(ItemSheetV2) { removeFeature: DHBaseItemSheet.#removeFeature, addResource: DHBaseItemSheet.#addResource, removeResource: DHBaseItemSheet.#removeResource - addFeature: DHBaseItemSheet.#addFeature }, dragDrop: [ { dragSelector: null, dropSelector: '.tab.features .drop-section' }, diff --git a/module/helpers/handlebarsHelper.mjs b/module/helpers/handlebarsHelper.mjs index 407f065e..4193bc37 100644 --- a/module/helpers/handlebarsHelper.mjs +++ b/module/helpers/handlebarsHelper.mjs @@ -8,10 +8,10 @@ export default class RegisterHandlebarsHelpers { times: this.times, damageFormula: this.damageFormula, damageSymbols: this.damageSymbols, - rollParsed: this.rollParsed + rollParsed: this.rollParsed, + hasProperty: foundry.utils.hasProperty, }); } - static add(a, b) { const aNum = Number.parseInt(a); const bNum = Number.parseInt(b); diff --git a/templates/sheets/actors/adversary/effects.hbs b/templates/sheets/actors/adversary/effects.hbs index ad14895d..325610e6 100644 --- a/templates/sheets/actors/adversary/effects.hbs +++ b/templates/sheets/actors/adversary/effects.hbs @@ -6,6 +6,7 @@ isGlassy=true collection=effects.actives canCreate=true + hideResources=true }} {{> 'daggerheart.inventory-items' @@ -14,5 +15,6 @@ isGlassy=true collection=effects.inactives canCreate=true + hideResources=true }} \ No newline at end of file diff --git a/templates/sheets/actors/adversary/features.hbs b/templates/sheets/actors/adversary/features.hbs index 1a379802..e5a304ef 100644 --- a/templates/sheets/actors/adversary/features.hbs +++ b/templates/sheets/actors/adversary/features.hbs @@ -7,6 +7,7 @@ collection=document.system.features hideControls=true canCreate=true + showActions=true }} \ No newline at end of file diff --git a/templates/sheets/actors/adversary/sidebar.hbs b/templates/sheets/actors/adversary/sidebar.hbs index 818e1cdd..ef13efd4 100644 --- a/templates/sheets/actors/adversary/sidebar.hbs +++ b/templates/sheets/actors/adversary/sidebar.hbs @@ -84,6 +84,7 @@ hideTags=true hideDescription=true hideTooltip=true + hideResources=true }} diff --git a/templates/sheets/actors/character/effects.hbs b/templates/sheets/actors/character/effects.hbs index bf2d1d76..4c4fca27 100644 --- a/templates/sheets/actors/character/effects.hbs +++ b/templates/sheets/actors/character/effects.hbs @@ -7,6 +7,7 @@ isGlassy=true collection=effects.actives canCreate=true + hideResources=true }} {{> 'daggerheart.inventory-items' @@ -15,5 +16,6 @@ isGlassy=true collection=effects.inactives canCreate=true + hideResources=true }} \ No newline at end of file diff --git a/templates/sheets/actors/character/features.hbs b/templates/sheets/actors/character/features.hbs index befa4ae8..bc709d83 100644 --- a/templates/sheets/actors/character/features.hbs +++ b/templates/sheets/actors/character/features.hbs @@ -9,6 +9,7 @@ type='feature' collection=category.values canCreate=true + showActions=true }} {{/if}} diff --git a/templates/sheets/actors/character/inventory.hbs b/templates/sheets/actors/character/inventory.hbs index 3238edae..9610d8e2 100644 --- a/templates/sheets/actors/character/inventory.hbs +++ b/templates/sheets/actors/character/inventory.hbs @@ -19,6 +19,7 @@ collection=document.itemTypes.weapon isGlassy=true canCreate=true + hideResources=true }} {{> 'daggerheart.inventory-items' title='TYPES.Item.armor' @@ -26,6 +27,7 @@ collection=document.itemTypes.armor isGlassy=true canCreate=true + hideResources=true }} {{> 'daggerheart.inventory-items' title='TYPES.Item.consumable' diff --git a/templates/sheets/actors/character/sidebar.hbs b/templates/sheets/actors/character/sidebar.hbs index 04df553b..f5109d72 100644 --- a/templates/sheets/actors/character/sidebar.hbs +++ b/templates/sheets/actors/character/sidebar.hbs @@ -88,6 +88,7 @@ type=item.type hideTags=true hideDescription=true + hideResources=true }} {{/if}} {{/each}} @@ -106,6 +107,7 @@ type='domainCard' hideTags=true hideDescription=true + hideResources=true }} {{/each}} diff --git a/templates/sheets/actors/companion/effects.hbs b/templates/sheets/actors/companion/effects.hbs index 007d2041..325610e6 100644 --- a/templates/sheets/actors/companion/effects.hbs +++ b/templates/sheets/actors/companion/effects.hbs @@ -6,7 +6,7 @@ isGlassy=true collection=effects.actives canCreate=true - + hideResources=true }} {{> 'daggerheart.inventory-items' @@ -15,5 +15,6 @@ isGlassy=true collection=effects.inactives canCreate=true + hideResources=true }} \ No newline at end of file diff --git a/templates/sheets/actors/environment/features.hbs b/templates/sheets/actors/environment/features.hbs index c81fddc1..d7f10d56 100644 --- a/templates/sheets/actors/environment/features.hbs +++ b/templates/sheets/actors/environment/features.hbs @@ -10,6 +10,7 @@ collection=document.system.features hideControls=true canCreate=true + showActions=true }} \ No newline at end of file diff --git a/templates/sheets/actors/environment/potentialAdversaries.hbs b/templates/sheets/actors/environment/potentialAdversaries.hbs index 9783972a..cc246312 100644 --- a/templates/sheets/actors/environment/potentialAdversaries.hbs +++ b/templates/sheets/actors/environment/potentialAdversaries.hbs @@ -13,6 +13,7 @@ categoryAdversary=categoryId hideControls=true collection=category.adversaries + hideResources=true }} {{/each}} diff --git a/templates/sheets/global/partials/domain-card-item.hbs b/templates/sheets/global/partials/domain-card-item.hbs index 5932e3b4..beeb41b8 100644 --- a/templates/sheets/global/partials/domain-card-item.hbs +++ b/templates/sheets/global/partials/domain-card-item.hbs @@ -1,17 +1,23 @@ -
  • +
  • -
    - - - - - - - - - +
    {{item.name}}
    diff --git a/templates/sheets/global/partials/inventory-fieldset-items-V2.hbs b/templates/sheets/global/partials/inventory-fieldset-items-V2.hbs index d26573b4..aa58aad8 100644 --- a/templates/sheets/global/partials/inventory-fieldset-items-V2.hbs +++ b/templates/sheets/global/partials/inventory-fieldset-items-V2.hbs @@ -18,6 +18,8 @@ Parameters: - hideTooltip {boolean} : If true, disables the tooltip on the item image. - hideControls {boolean} : If true, hides the controls inside inventory-item partials. - hideDescription {boolean} : If true, hides the item's description. +- hideResources {boolean} : If true, hides the item's resources. +- showActions {boolean} : If true show feature's actions. --}}
    @@ -58,6 +60,8 @@ Parameters: hideTooltip=../hideTooltip showLabels=../showLabels isAction=../isAction + hideResources=../hideResources + showActions=../showActions }} {{/each}} diff --git a/templates/sheets/global/partials/inventory-item-V2.hbs b/templates/sheets/global/partials/inventory-item-V2.hbs index a47d0b8a..a1737a7a 100644 --- a/templates/sheets/global/partials/inventory-item-V2.hbs +++ b/templates/sheets/global/partials/inventory-item-V2.hbs @@ -10,138 +10,159 @@ Parameters: - hideTooltip {boolean} : If true, disables the tooltip on the item image. - hideControls {boolean} : If true, hides the controls inside inventory-item partials. - hideDescription {boolean} : If true, hides the item's description. +- hideResources {boolean} : If true, hides the item's resources. +- showActions {boolean} : If true show feature's actions. --}} -
  • +
  • {{!-- Image --}} + data-action='{{ifThen (hasProperty item "use") "useItem" (ifThen (hasProperty item "toChat") "toChat" "editDoc") }}' + {{#unless hideTooltip}}data-tooltip="#item#{{item.uuid}}" {{/unless}} /> - {{!-- Name & Tags --}} -
    - {{!-- Item Name --}} -
    {{item.name}}
    +
    + {{!-- Name & Tags --}} +
    - {{!-- Weapon Block Start --}} - {{#if (eq type 'weapon')}} - {{#if (not hideTags)}} -
    -
    - {{localize (concat 'DAGGERHEART.CONFIG.Traits.' item.system.attack.roll.trait '.name')}} -
    -
    - {{localize (concat 'DAGGERHEART.CONFIG.Range.' item.system.attack.range '.name')}} -
    -
    - {{item.system.attack.damage.parts.0.value.dice}}{{#if item.system.attack.damage.parts.0.value.bonus}} + - {{item.system.attack.damage.parts.0.value.bonus}}{{/if}} - ({{localize (concat 'DAGGERHEART.CONFIG.DamageType.' item.system.attack.damage.parts.0.type '.abbreviation')}}) -
    -
    - {{localize (concat 'DAGGERHEART.CONFIG.Burden.' item.system.burden)}} -
    -
    - {{else if (not hideLabels)}} -
    -
    - {{localize (concat 'DAGGERHEART.CONFIG.Range.' item.system.attack.range '.short')}} - - - {{item.system.attack.damage.parts.0.value.dice}} - {{#if item.system.attack.damage.parts.0.value.bonus}} + - {{item.system.attack.damage.parts.0.value.bonus}} - {{/if}} - {{#with (lookup @root.config.GENERAL.damageTypes item.system.attack.damage.parts.0.type)}} - {{#each icon}}{{/each}} - {{/with}} -
    -
    - {{/if}} - {{/if}} - {{!-- Weapon Block End --}} + {{!-- Item Name --}} +
    {{item.name}}
    - {{!-- Armor Block Start --}} - {{#if (eq type 'armor')}} - {{#if (not hideTags)}} -
    -
    {{localize "DAGGERHEART.ITEMS.Armor.baseScore"}}: {{item.system.baseScore}}
    -
    - {{localize "DAGGERHEART.ITEMS.Armor.baseThresholds.base"}}: - {{item.system.baseThresholds.major}} / {{item.system.baseThresholds.severe}} -
    -
    - {{else if (not hideLabels)}} -
    -
    - {{localize "DAGGERHEART.ITEMS.Armor.baseScore"}}: {{item.system.baseScore}} -
    -
    - {{/if}} - {{/if}} - {{!-- Armor Block End --}} + {{!-- Weapon Block Start --}} + {{#if (eq type 'weapon')}} + {{#if (not hideTags)}} +
    +
    + {{localize (concat 'DAGGERHEART.CONFIG.Traits.' item.system.attack.roll.trait '.name')}} +
    +
    + {{localize (concat 'DAGGERHEART.CONFIG.Range.' item.system.attack.range '.name')}} +
    +
    + {{item.system.attack.damage.parts.0.value.dice}} + {{#if item.system.attack.damage.parts.0.value.bonus}} + + {{item.system.attack.damage.parts.0.value.bonus}}{{/if}} + ( + {{#each item.system.attack.damage.parts.0.type as |type|}} - {{!-- Domain Card Block Start --}} - {{#if (eq type 'domainCard')}} - {{#if (not hideTags)}} -
    -
    {{localize (concat 'DAGGERHEART.CONFIG.DomainCardTypes.' item.system.type)}}
    -
    {{localize (concat 'DAGGERHEART.GENERAL.Domain.' item.system.domain '.label')}}
    -
    - {{localize "DAGGERHEART.ITEMS.DomainCard.recallCost"}}: - {{item.system.recallCost}} -
    -
    - {{else if (not hideLabels)}} -
    -
    - {{localize (concat 'DAGGERHEART.CONFIG.DomainCardTypes.' item.system.type)}} - - {{localize (concat 'DAGGERHEART.GENERAL.Domain.' item.system.domain '.label')}} - - {{item.system.recallCost}} - -
    -
    - {{/if}} - {{/if}} - {{!-- Domain Card Block End --}} + {{localize (concat 'DAGGERHEART.CONFIG.DamageType.' type '.abbreviation')}} + {{#unless @last}}|{{/unless}} + {{/each}} + ) - {{!-- Effect Block Start --}} - {{#if (eq type 'effect')}} - {{#if (not hideTags)}} -
    -
    - {{localize item.parent.system.metadata.label}}: {{item.parent.name}} +
    +
    + {{localize (concat 'DAGGERHEART.CONFIG.Burden.' item.system.burden)}} +
    -
    - {{#if item.duration.duration}} - {{localize 'DAGGERHEART.EFFECTS.Duration.temporary'}} - {{else}} - {{localize 'DAGGERHEART.EFFECTS.Duration.passive'}} - {{/if}} + {{else if (not hideLabels)}} +
    +
    + {{localize (concat 'DAGGERHEART.CONFIG.Traits.' item.system.attack.roll.trait '.short')}} + {{localize (concat 'DAGGERHEART.CONFIG.Range.' item.system.attack.range '.short')}} + - + {{item.system.attack.damage.parts.0.value.dice}} + {{#if item.system.attack.damage.parts.0.value.bonus}} + + {{item.system.attack.damage.parts.0.value.bonus}} + {{/if}} + {{#with (lookup @root.config.GENERAL.damageTypes item.system.attack.damage.parts.0.type)}} + {{#each icon}}{{/each}} + {{/with}} +
    - {{#each item.statuses as |status|}} -
    {{localize (concat 'DAGGERHEART.CONFIG.Condition.' status '.name')}}
    - {{/each}} -
    - {{else if (not hideLabels)}} - {{!-- Empty --}} - {{/if}} - {{/if}} - {{!-- Effect Block End --}} + {{/if}} + {{/if}} + {{!-- Weapon Block End --}} - {{!-- Action Block Start --}} - {{#if (eq type 'action')}} - {{#if (not hideTags)}} -
    -
    {{localize (concat 'DAGGERHEART.ACTIONS.TYPES.' item.type '.name')}}
    -
    {{localize (concat 'DAGGERHEART.CONFIG.ActionType.' item.actionType)}}
    + {{!-- Armor Block Start --}} + {{#if (eq type 'armor')}} + {{#if (not hideTags)}} +
    +
    {{localize "DAGGERHEART.ITEMS.Armor.baseScore"}}: {{item.system.baseScore}}
    +
    + {{localize "DAGGERHEART.ITEMS.Armor.baseThresholds.base"}}: + {{item.system.baseThresholds.major}} / {{item.system.baseThresholds.severe}} +
    +
    + {{else if (not hideLabels)}} +
    +
    + {{localize "DAGGERHEART.ITEMS.Armor.baseScore"}}: {{item.system.baseScore}} +
    +
    + {{/if}} + {{/if}} + {{!-- Armor Block End --}} + + {{!-- Domain Card Block Start --}} + {{#if (eq type 'domainCard')}} + {{#if (not hideTags)}} +
    +
    {{localize (concat 'DAGGERHEART.CONFIG.DomainCardTypes.' item.system.type)}}
    +
    {{localize (concat 'DAGGERHEART.GENERAL.Domain.' item.system.domain '.label')}}
    +
    + {{localize "DAGGERHEART.ITEMS.DomainCard.recallCost"}}: + {{item.system.recallCost}} +
    +
    + {{else if (not hideLabels)}} +
    +
    + {{localize (concat 'DAGGERHEART.CONFIG.DomainCardTypes.' item.system.type)}} - + {{localize (concat 'DAGGERHEART.GENERAL.Domain.' item.system.domain '.label')}} - + {{item.system.recallCost}} + +
    +
    + {{/if}} + {{/if}} + {{!-- Domain Card Block End --}} + + {{!-- Effect Block Start --}} + {{#if (eq type 'effect')}} + {{#if (not hideTags)}} +
    +
    + {{localize item.parent.system.metadata.label}}: {{item.parent.name}} +
    +
    + {{#if item.duration.duration}} + {{localize 'DAGGERHEART.EFFECTS.Duration.temporary'}} + {{else}} + {{localize 'DAGGERHEART.EFFECTS.Duration.passive'}} + {{/if}} +
    + {{#each item.statuses as |status|}} +
    {{localize (concat 'DAGGERHEART.CONFIG.Condition.' status '.name')}}
    + {{/each}} +
    + {{else if (not hideLabels)}} + {{!-- Empty --}} + {{/if}} + {{/if}} + {{!-- Effect Block End --}} + + {{!-- Action Block Start --}} + {{#if (eq type 'action')}} + {{#if (not hideTags)}} +
    +
    {{localize (concat 'DAGGERHEART.ACTIONS.TYPES.' item.type '.name')}}
    +
    {{localize (concat 'DAGGERHEART.CONFIG.ActionType.' item.actionType)}}
    +
    + {{else if (not hideLabels)}} + {{!-- Empty --}} + {{/if}} + {{/if}} + {{!-- Action Block End --}}
    - {{else if (not hideLabels)}} - {{!-- Empty --}} + {{#if (and (not hideResources) (eq item.system.resource.type 'simple'))}} + {{> "systems/daggerheart/templates/sheets/global/partials/item-resource.hbs"}} {{/if}} + {{#if (and (not hideResources) item.system.quantity)}} +
    + +
    {{/if}} - {{!-- Action Block End --}}
    {{!-- Controls --}} @@ -178,12 +199,11 @@ Parameters: {{/if}} - {{!-- I had to use the {{not}} helper because otherwise the function is called when rendering --}} - {{#unless (not item.toChat)}} + {{#if (hasProperty item "toChat")}} - {{/unless}} + {{/if}} @@ -199,4 +219,16 @@ Parameters: {{{item.system.description}}}
    {{/unless}} + {{#if (and (not hideResources) (eq item.system.resource.type 'diceValue'))}} + {{> "systems/daggerheart/templates/sheets/global/partials/item-resource.hbs"}} + {{/if}} + {{#if (and showActions (eq item.type 'feature'))}} +
    + {{#each item.system.actions as | action |}} + + {{/each}} +
    + {{/if}}
  • \ No newline at end of file diff --git a/templates/sheets/global/tabs/tab-effects.hbs b/templates/sheets/global/tabs/tab-effects.hbs index e0715b30..c89c6ff4 100644 --- a/templates/sheets/global/tabs/tab-effects.hbs +++ b/templates/sheets/global/tabs/tab-effects.hbs @@ -7,6 +7,7 @@ isGlassy=true collection=effects.actives canCreate=true + hideResources=true }} {{> 'daggerheart.inventory-items' @@ -15,5 +16,6 @@ isGlassy=true collection=effects.inactives canCreate=true + hideResources=true }} \ No newline at end of file diff --git a/templates/sheets/global/tabs/tab-features.hbs b/templates/sheets/global/tabs/tab-features.hbs index cb3e106e..b70b33d3 100644 --- a/templates/sheets/global/tabs/tab-features.hbs +++ b/templates/sheets/global/tabs/tab-features.hbs @@ -6,5 +6,6 @@ isGlassy=true collection=document.system.features canCreate=(or document.parent isGM) + showActions=false }} \ No newline at end of file