From cc6fdb47a91b6c9233976ead9fb714b1e70d131a Mon Sep 17 00:00:00 2001 From: Carlos Fernandez Date: Tue, 23 Jun 2026 03:36:45 -0400 Subject: [PATCH] Simplify ActiveEffect sheet tags --- module/documents/activeEffect.mjs | 9 ++++----- templates/sheets/global/partials/item-tags.hbs | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/module/documents/activeEffect.mjs b/module/documents/activeEffect.mjs index 0e7f5d1e..1bd64e87 100644 --- a/module/documents/activeEffect.mjs +++ b/module/documents/activeEffect.mjs @@ -223,12 +223,11 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect { * Generates a list of localized tags based on this item's type-specific properties. * @returns {string[]} An array of localized tag strings. */ - _getTags() { + _getTags(rootDocument) { const tags = [ - `${game.i18n.localize(this.parent.system.metadata.label)}: ${this.parent.name}`, - game.i18n.localize( - this.isTemporary ? 'DAGGERHEART.EFFECTS.Duration.temporary' : 'DAGGERHEART.EFFECTS.Duration.passive' - ) + rootDocument && rootDocument === this.parent + ? _loc(`DOCUMENT.${rootDocument.documentName}`) + : `${_loc(this.parent.system.metadata.label)}: ${this.parent.name}` ]; for (const statusId of this.statuses) { diff --git a/templates/sheets/global/partials/item-tags.hbs b/templates/sheets/global/partials/item-tags.hbs index 2edc1eac..e05a1095 100644 --- a/templates/sheets/global/partials/item-tags.hbs +++ b/templates/sheets/global/partials/item-tags.hbs @@ -1,5 +1,5 @@
- {{#each _getTags as |tag|}} + {{#each (_getTags @root.document) as |tag|}}
{{tag}}