style remaing chat messages

This commit is contained in:
moliloo 2025-07-28 23:44:48 -03:00
parent e4820dd6bd
commit 76cfcb29ea
9 changed files with 103 additions and 59 deletions

View file

@ -7,9 +7,13 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
});
const actor = game.actors.get(this.speaker.actor);
const actorData = actor ?? { img: 'icons/svg/mystery-man.svg', name: '' };
const actorData = actor ?? {
img: this.author.avatar ? this.author.avatar : 'icons/svg/mystery-man.svg',
name: ''
};
/* We can change to fully implementing the renderHTML function if needed, instead of augmenting it. */
const html = await super.renderHTML({ actor: actorData });
const html = await super.renderHTML({ actor: actorData, author: this.author });
console.log(this.author);
this.applyPermission(html);
if (this.type === 'dualityRoll') {

View file

@ -128,7 +128,11 @@ export default class DHItem extends foundry.documents.Item {
const msg = new cls({
type: 'abilityUse',
user: game.user.id,
actor: this.actor,
author: this.author,
speaker: cls.getSpeaker(),
system: systemData,
title: game.i18n.localize('DAGGERHEART.ACTIONS.Config.displayInChat'),
content: await foundry.applications.handlebars.renderTemplate(
'systems/daggerheart/templates/ui/chat/ability-use.hbs',
systemData