mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-24 11:29: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": {
|
"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": {
|
||||||
|
|
|
||||||
|
|
@ -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.
|
* Generates a list of localized tags based on this item's type-specific properties.
|
||||||
* @returns {string[]} An array of localized tag strings.
|
* @returns {string[]} An array of localized tag strings.
|
||||||
*/
|
*/
|
||||||
_getTags(rootDocument) {
|
_getTags() {
|
||||||
const tags = [
|
const tags = [];
|
||||||
rootDocument && rootDocument === this.parent
|
const originActor = DhActiveEffect.#resolveParentDocument(fromUuidSync(this.origin), Actor);
|
||||||
? _loc(`DOCUMENT.${rootDocument.documentName}`)
|
if (originActor && originActor !== this.actor) {
|
||||||
: `${_loc(this.parent.system.metadata.label)}: ${this.parent.name}`
|
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);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<div class="item-tags">
|
<div class="item-tags">
|
||||||
{{#each (_getTags @root.document) as |tag|}}
|
{{#each _getTags as |tag|}}
|
||||||
<div class="tag">
|
<div class="tag">
|
||||||
{{tag}}
|
{{tag}}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue