Fix Attribute rolling. Updated some depreciated values based on warnings.

This commit is contained in:
IrkTheImp 2025-05-22 21:41:40 -05:00
parent aa4021d1a2
commit cb34048ac6
5 changed files with 15 additions and 14 deletions

View file

@ -1,7 +1,7 @@
export default class DhpChatMesssage extends ChatMessage {
async renderHTML() {
if(this.type === 'dualityRoll' || this.type === 'adversaryRoll' || this.type === 'abilityUse'){
this.content = await renderTemplate(this.content, this.system);
this.content = await foundry.applications.handlebars.renderTemplate(this.content, this.system);
}
return super.renderHTML();

View file

@ -320,11 +320,11 @@ export default class PCSheet extends DaggerheartSheet(ActorSheetV2) {
this.render();
}
static async rollAttribute(_, event){
const { roll, hope, fear, advantage, disadvantage, modifiers } = await this.document.dualityRoll({ title: 'Attribute Bonus', value: event.currentTarget.dataset.value }, event.shiftKey);
static async rollAttribute(event, target) {
const { roll, hope, fear, advantage, disadvantage, modifiers } = await this.document.dualityRoll({ title: 'Attribute Bonus', value: event.target.dataset.value }, event.shiftKey);
const cls = getDocumentClass("ChatMessage");
const msg = new cls({
const msgData = {
type: 'dualityRoll',
system: {
roll: roll._formula,
@ -337,9 +337,9 @@ export default class PCSheet extends DaggerheartSheet(ActorSheetV2) {
user: game.user.id,
content: "systems/daggerheart/templates/chat/duality-roll.hbs",
rolls: [roll]
});
};
await cls.create(msg.toObject());
await cls.create(msgData);
}
static async toggleMarks(_, button){