Simplify ActiveEffect sheet tags (#2037)
Some checks are pending
Project CI / build (24.x) (push) Waiting to run

* Simplify ActiveEffect sheet tags

* Show origin actor and exclude tag if it is a top level actor tag without origin
This commit is contained in:
Carlos Fernandez 2026-06-23 06:22:03 -04:00 committed by GitHub
parent f5fa59b3bd
commit 958eaa310c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 7 deletions

View file

@ -224,12 +224,13 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect {
* @returns {string[]} An array of localized tag strings.
*/
_getTags() {
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'
)
];
const tags = [];
const originActor = DhActiveEffect.#resolveParentDocument(fromUuidSync(this.origin), Actor);
if (originActor && originActor !== this.actor) {
tags.push(_loc('DAGGERHEART.EFFECTS.OriginTag', { name: originActor.name }));
} else if (!(this.parent instanceof Actor)) {
tags.push(`${_loc(this.parent.system.metadata.label)}: ${this.parent.name}`);
}
for (const statusId of this.statuses) {
const status = CONFIG.statusEffects.find(s => s.id === statusId);