Roll Chat message new design template

This commit is contained in:
Dapoolp 2025-07-30 21:40:42 +02:00
parent f14cb3936a
commit a3ef43aad6
21 changed files with 733 additions and 276 deletions

View file

@ -47,7 +47,7 @@ export default class DhpDeathMove extends HandlebarsApplicationMixin(Application
static async takeMove() {
const cls = getDocumentClass('ChatMessage');
const msg = new cls({
const msg = {
user: game.user.id,
content: await foundry.applications.handlebars.renderTemplate(
'systems/daggerheart/templates/ui/chat/deathMove.hbs',
@ -55,20 +55,23 @@ export default class DhpDeathMove extends HandlebarsApplicationMixin(Application
player: this.actor.name,
actor: { name: this.actor.name, img: this.actor.img },
author: game.users.get(game.user.id),
speaker: cls.getSpeaker(),
title: game.i18n.localize(this.selectedMove.name),
img: this.selectedMove.img,
description: game.i18n.localize(this.selectedMove.description)
}
),
title: game.i18n.localize(
'DAGGERHEART.UI.Chat.deathMove.title'
),
speaker: cls.getSpeaker(),
flags: {
daggerheart: {
cssClass: 'dh-chat-message dh-style'
}
}
});
};
cls.create(msg.toObject());
cls.create(msg);
this.close();
}

View file

@ -133,7 +133,7 @@ export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV
});
const cls = getDocumentClass('ChatMessage');
const msg = new cls({
const msg = {
user: game.user.id,
system: {
moves: moves,
@ -158,9 +158,9 @@ export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV
cssClass: 'dh-chat-message dh-style'
}
}
});
};
cls.create(msg.toObject());
cls.create(msg);
// Reset selection and update number of taken moves
for (const [catName, category] of Object.entries(this.moveData)) {

View file

@ -74,7 +74,7 @@ export default class ResourceDiceDialog extends HandlebarsApplicationMixin(Appli
this.resetUsed = true;
const cls = getDocumentClass('ChatMessage');
const msg = new cls({
const msg = {
user: game.user.id,
content: await foundry.applications.handlebars.renderTemplate(
'systems/daggerheart/templates/ui/chat/resource-roll.hbs',
@ -83,9 +83,9 @@ export default class ResourceDiceDialog extends HandlebarsApplicationMixin(Appli
name: this.item.name
}
)
});
};
cls.create(msg.toObject());
cls.create(msg);
this.close();
}