From aab767bc3b1292c6ac2b6b00453b0da97b440eff Mon Sep 17 00:00:00 2001 From: WBHarry Date: Sun, 22 Feb 2026 15:27:25 +0100 Subject: [PATCH] Fixed --- .../sheets/api/application-mixin.mjs | 18 ++++++------- .../partials/inventory-fieldset-items-V2.hbs | 1 + .../global/partials/inventory-item-V2.hbs | 8 ++++-- templates/sheets/global/tabs/tab-effects.hbs | 25 ++++++++++--------- 4 files changed, 29 insertions(+), 23 deletions(-) diff --git a/module/applications/sheets/api/application-mixin.mjs b/module/applications/sheets/api/application-mixin.mjs index 49f7dcf0..4ff63492 100644 --- a/module/applications/sheets/api/application-mixin.mjs +++ b/module/applications/sheets/api/application-mixin.mjs @@ -431,18 +431,18 @@ export default function DHApplicationMixin(Base) { { name: 'disableEffect', icon: 'fa-solid fa-lightbulb', - condition: target => { - const doc = getDocFromElementSync(target); - return doc && !doc.disabled && doc.type !== 'beastform'; + condition: element => { + const target = element.closest('[data-item-uuid]'); + return !target.dataset.disabled && target.dataset.subType !== 'beastform'; }, callback: async target => (await getDocFromElement(target)).update({ disabled: true }) }, { name: 'enableEffect', icon: 'fa-regular fa-lightbulb', - condition: target => { - const doc = getDocFromElementSync(target); - return doc && doc.disabled && doc.type !== 'beastform'; + condition: element => { + const target = element.closest('[data-item-uuid]'); + return target.dataset.disabled && target.dataset.subType !== 'beastform'; }, callback: async target => (await getDocFromElement(target)).update({ disabled: false }) } @@ -536,9 +536,9 @@ export default function DHApplicationMixin(Base) { options.push({ name: 'CONTROLS.CommonDelete', icon: 'fa-solid fa-trash', - condition: target => { - const doc = getDocFromElementSync(target); - return doc && doc.type !== 'beastform'; + condition: element => { + const target = element.closest('[data-item-uuid]'); + return target.dataset.subType !== 'beastform'; }, callback: async (target, event) => { const doc = await getDocFromElement(target); diff --git a/templates/sheets/global/partials/inventory-fieldset-items-V2.hbs b/templates/sheets/global/partials/inventory-fieldset-items-V2.hbs index d2534a5a..0a3275d0 100644 --- a/templates/sheets/global/partials/inventory-fieldset-items-V2.hbs +++ b/templates/sheets/global/partials/inventory-fieldset-items-V2.hbs @@ -56,6 +56,7 @@ Parameters: {{> 'daggerheart.inventory-item' item=item type=../type + disabledEffect=../disabledEffect actorType=../actorType hideControls=../hideControls hideContextMenu=../hideContextMenu diff --git a/templates/sheets/global/partials/inventory-item-V2.hbs b/templates/sheets/global/partials/inventory-item-V2.hbs index 76e13a5c..d00e2ca8 100644 --- a/templates/sheets/global/partials/inventory-item-V2.hbs +++ b/templates/sheets/global/partials/inventory-item-V2.hbs @@ -17,8 +17,12 @@ Parameters: - showActions {boolean} : If true show feature's actions. --}} -
  • +
  • {{!-- Image --}}
    {{> 'daggerheart.inventory-items' - title='DAGGERHEART.GENERAL.activeEffects' - type='effect' - isGlassy=true - collection=effects.actives - canCreate=true - hideResources=true + title='DAGGERHEART.GENERAL.activeEffects' + type='effect' + isGlassy=true + collection=effects.actives + canCreate=true + hideResources=true }} {{> 'daggerheart.inventory-items' - title='DAGGERHEART.GENERAL.inactiveEffects' - type='effect' - isGlassy=true - collection=effects.inactives - canCreate=true - hideResources=true + title='DAGGERHEART.GENERAL.inactiveEffects' + type='effect' + disabledEffect=true + isGlassy=true + collection=effects.inactives + canCreate=true + hideResources=true }} \ No newline at end of file