mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-22 02:19:54 +02:00
Show origin actor and exclude tag if it is a top level actor tag without origin
This commit is contained in:
parent
cc6fdb47a9
commit
8f621778d2
3 changed files with 11 additions and 8 deletions
|
|
@ -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": {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<div class="item-tags">
|
||||
{{#each (_getTags @root.document) as |tag|}}
|
||||
{{#each _getTags as |tag|}}
|
||||
<div class="tag">
|
||||
{{tag}}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue