fix _getTags type error and add a alias label for non base messages

This commit is contained in:
moliloo 2025-08-01 02:06:14 -03:00
parent b53ad2d3ca
commit 57f19c41cd
5 changed files with 19 additions and 10 deletions

View file

@ -102,9 +102,9 @@ export default class DHItem extends foundry.documents.Item {
* Generate an array of localized tag. * Generate an array of localized tag.
* @returns {string[]} An array of localized tag strings. * @returns {string[]} An array of localized tag strings.
*/ */
getTags() { _getTags() {
const tags = []; const tags = [];
if (this.system.getTags) tags.push(...this.system.getTags()); if (this.system._getTags) tags.push(...this.system._getTags());
return tags; return tags;
} }
@ -143,14 +143,18 @@ export default class DHItem extends foundry.documents.Item {
: game.i18n.localize('DAGGERHEART.UI.Chat.foundationCard.subclassFeatureTitle'), : game.i18n.localize('DAGGERHEART.UI.Chat.foundationCard.subclassFeatureTitle'),
origin: origin, origin: origin,
img: this.img, img: this.img,
item: { name: this.name, img: this.img, tags: this.tags ? this.tags : ['Spell', 'Arcana', 'Lv 10'] }, item: {
name: this.name,
img: this.img,
tags: this._getTags()
},
description: this.system.description, description: this.system.description,
actions: this.system.actions actions: this.system.actions
}; };
const msg = { const msg = {
type: 'abilityUse', type: 'abilityUse',
user: game.user.id, user: game.user.id,
actor: this.actor, actor: game.actors.get(cls.getSpeaker().actor),
author: this.author, author: this.author,
speaker: cls.getSpeaker(), speaker: cls.getSpeaker(),
system: systemData, system: systemData,

View file

@ -262,6 +262,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 5px; gap: 5px;
margin-bottom: 10px;
.inventory-item { .inventory-item {
padding: 0 10px; padding: 0 10px;

View file

@ -351,6 +351,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 5px; gap: 5px;
margin-bottom: 10px;
.inventory-item { .inventory-item {
padding: 0 10px; padding: 0 10px;

View file

@ -64,6 +64,7 @@
.tags { .tags {
display: flex; display: flex;
gap: 10px; gap: 10px;
flex-wrap: wrap;
.tag { .tag {
display: flex; display: flex;

View file

@ -7,6 +7,8 @@
<h4>{{ifThen message.title message.title alias}}</h4> <h4>{{ifThen message.title message.title alias}}</h4>
{{#if actor.name}} {{#if actor.name}}
<div>{{actor.name}} {{#if author.isGM}}(GM){{/if}}</div> <div>{{actor.name}} {{#if author.isGM}}(GM){{/if}}</div>
{{else unless (eq message.type 'base')}}
<div>{{alias}}</div>
{{/if}} {{/if}}
</div> </div>
</div> </div>