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

@ -2010,7 +2010,8 @@
"Attachments": { "Attachments": {
"attachHint": "Drop items here to attach them", "attachHint": "Drop items here to attach them",
"transferHint": "If checked, this effect will be applied to any actor that owns this Effect's parent Item. The effect is always applied if this Item is attached to another one." "transferHint": "If checked, this effect will be applied to any actor that owns this Effect's parent Item. The effect is always applied if this Item is attached to another one."
} },
"OriginTag": "Origin: {name}"
}, },
"GENERAL": { "GENERAL": {
"Ability": { "Ability": {

View file

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