mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Issue 80 Chatmessage fix (#81)
* fix chatmessage to render the template in constructor. Update namespaces. * update all chat messages to render templates
This commit is contained in:
parent
c94051744a
commit
7c792f409f
14 changed files with 230 additions and 171 deletions
|
|
@ -330,15 +330,19 @@ export default class AdversarySheet extends DaggerheartSheet(ActorSheetV2) {
|
|||
);
|
||||
|
||||
const cls = getDocumentClass('ChatMessage');
|
||||
const systemData = {
|
||||
roll: roll._formula,
|
||||
total: roll._total,
|
||||
modifiers: modifiers,
|
||||
diceResults: diceResults
|
||||
};
|
||||
const msg = new cls({
|
||||
type: 'adversaryRoll',
|
||||
system: {
|
||||
roll: roll._formula,
|
||||
total: roll._total,
|
||||
modifiers: modifiers,
|
||||
diceResults: diceResults
|
||||
},
|
||||
content: 'systems/daggerheart/templates/chat/adversary-roll.hbs',
|
||||
system: systemData,
|
||||
content: await foundry.applications.handlebars.renderTemplate(
|
||||
'systems/daggerheart/templates/chat/adversary-roll.hbs',
|
||||
systemData
|
||||
),
|
||||
rolls: [roll]
|
||||
});
|
||||
|
||||
|
|
@ -362,21 +366,25 @@ export default class AdversarySheet extends DaggerheartSheet(ActorSheetV2) {
|
|||
}));
|
||||
|
||||
const cls = getDocumentClass('ChatMessage');
|
||||
const systemData = {
|
||||
title: button.dataset.name,
|
||||
origin: this.document.id,
|
||||
roll: roll._formula,
|
||||
advantageState,
|
||||
total: roll._total,
|
||||
modifiers: modifiers,
|
||||
dice: dice,
|
||||
targets: targets,
|
||||
damage: { value: button.dataset.damage, type: button.dataset.damageType }
|
||||
};
|
||||
const msg = new cls({
|
||||
type: 'adversaryRoll',
|
||||
sound: CONFIG.sounds.dice,
|
||||
system: {
|
||||
title: button.dataset.name,
|
||||
origin: this.document.id,
|
||||
roll: roll._formula,
|
||||
advantageState,
|
||||
total: roll._total,
|
||||
modifiers: modifiers,
|
||||
dice: dice,
|
||||
targets: targets,
|
||||
damage: { value: button.dataset.damage, type: button.dataset.damageType }
|
||||
},
|
||||
content: 'systems/daggerheart/templates/chat/adversary-attack-roll.hbs',
|
||||
system: systemData,
|
||||
content: await foundry.applications.handlebars.renderTemplate(
|
||||
'systems/daggerheart/templates/chat/adversary-attack-roll.hbs',
|
||||
systemData
|
||||
),
|
||||
rolls: [roll]
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue