mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-17 23:49:02 +01:00
fix _getTags type error and add a alias label for non base messages
This commit is contained in:
parent
b53ad2d3ca
commit
57f19c41cd
5 changed files with 19 additions and 10 deletions
|
|
@ -74,8 +74,8 @@ export default class DHItem extends foundry.documents.Item {
|
||||||
isInventoryItem === true
|
isInventoryItem === true
|
||||||
? 'Inventory Items' //TODO localize
|
? 'Inventory Items' //TODO localize
|
||||||
: isInventoryItem === false
|
: isInventoryItem === false
|
||||||
? 'Character Items' //TODO localize
|
? 'Character Items' //TODO localize
|
||||||
: 'Other'; //TODO localize
|
: 'Other'; //TODO localize
|
||||||
|
|
||||||
return { value: type, label, group };
|
return { value: type, label, group };
|
||||||
}
|
}
|
||||||
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -137,20 +137,24 @@ export default class DHItem extends foundry.documents.Item {
|
||||||
this.type === 'ancestry'
|
this.type === 'ancestry'
|
||||||
? game.i18n.localize('DAGGERHEART.UI.Chat.foundationCard.ancestryTitle')
|
? game.i18n.localize('DAGGERHEART.UI.Chat.foundationCard.ancestryTitle')
|
||||||
: this.type === 'community'
|
: this.type === 'community'
|
||||||
? game.i18n.localize('DAGGERHEART.UI.Chat.foundationCard.communityTitle')
|
? game.i18n.localize('DAGGERHEART.UI.Chat.foundationCard.communityTitle')
|
||||||
: this.type === 'feature'
|
: this.type === 'feature'
|
||||||
? game.i18n.localize('TYPES.Item.feature')
|
? game.i18n.localize('TYPES.Item.feature')
|
||||||
: 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,
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,7 @@
|
||||||
.tags {
|
.tags {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
.tag {
|
.tag {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue