update all chat messages to render templates

This commit is contained in:
IrkTheImp 2025-05-29 21:51:54 -05:00
parent cc6c9a11bc
commit 6a1848760b
7 changed files with 130 additions and 112 deletions

View file

@ -246,22 +246,26 @@ export default class DhpActor extends Actor {
}
const cls = getDocumentClass('ChatMessage');
const systemData = {
title: game.i18n.format('DAGGERHEART.Chat.DamageRoll.Title', { damage: title }),
roll: rollString,
damage: {
total: rollResult.total,
type: damage.type
},
dice: dice,
modifiers: modifiers,
targets: targets
};
const msg = new cls({
type: 'damageRoll',
user: game.user.id,
sound: CONFIG.sounds.dice,
system: {
title: game.i18n.format('DAGGERHEART.Chat.DamageRoll.Title', { damage: title }),
roll: rollString,
damage: {
total: rollResult.total,
type: damage.type
},
dice: dice,
modifiers: modifiers,
targets: targets
},
content: 'systems/daggerheart/templates/chat/damage-roll.hbs',
system: systemData,
content: await foundry.applications.handlebars.renderTemplate(
'systems/daggerheart/templates/chat/damage-roll.hbs',
systemData
),
rolls: [roll]
});