mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-13 20:21:06 +01:00
update all chat messages to render templates
This commit is contained in:
parent
cc6c9a11bc
commit
6a1848760b
7 changed files with 130 additions and 112 deletions
|
|
@ -2,23 +2,6 @@ import DhpDualityRoll from '../data/dualityRoll.mjs';
|
|||
import { DualityRollColor } from '../data/settings/Appearance.mjs';
|
||||
|
||||
export default class DhpChatMessage extends ChatMessage {
|
||||
constructor(data, options) {
|
||||
super(data, options);
|
||||
|
||||
if (
|
||||
data.type === 'dualityRoll' ||
|
||||
data.type === 'adversaryRoll' ||
|
||||
data.type === 'damageRoll' ||
|
||||
data.type === 'abilityUse'
|
||||
) {
|
||||
this.#templateInjection(data);
|
||||
}
|
||||
}
|
||||
|
||||
async #templateInjection(data) {
|
||||
return await foundry.applications.handlebars.renderTemplate(data.content, data.system);
|
||||
}
|
||||
|
||||
async renderHTML() {
|
||||
/* We can change to fully implementing the renderHTML function if needed, instead of augmenting it. */
|
||||
const html = await super.renderHTML();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue