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 05:55:25 -04:00
parent cc6fdb47a9
commit 8f621778d2
3 changed files with 11 additions and 8 deletions

View file

@ -2010,7 +2010,8 @@
"Attachments": {
"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."
}
},
"OriginTag": "Origin: {name}"
},
"GENERAL": {
"Ability": {

View file

@ -223,12 +223,14 @@ 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(rootDocument) {
const tags = [
rootDocument && rootDocument === this.parent
? _loc(`DOCUMENT.${rootDocument.documentName}`)
: `${_loc(this.parent.system.metadata.label)}: ${this.parent.name}`
];
_getTags() {
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);

View file

@ -1,5 +1,5 @@
<div class="item-tags">
{{#each (_getTags @root.document) as |tag|}}
{{#each _getTags as |tag|}}
<div class="tag">
{{tag}}
</div>