mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-21 18:09:54 +02:00
Simplify ActiveEffect sheet tags (#2037)
Some checks are pending
Project CI / build (24.x) (push) Waiting to run
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:
parent
f5fa59b3bd
commit
958eaa310c
2 changed files with 9 additions and 7 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": {
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue