From e6479feaa6c9411caf43284a8d4c7428aade3347 Mon Sep 17 00:00:00 2001 From: Byroks Date: Thu, 28 Mar 2024 17:25:19 +0100 Subject: [PATCH] Versteck schwellenwert bei PW --- source/module/rolls/M5Roll.ts | 8 +++++--- templates/chat/task-check-dialog.hbs | 10 ++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/source/module/rolls/M5Roll.ts b/source/module/rolls/M5Roll.ts index 3935929..f018d66 100644 --- a/source/module/rolls/M5Roll.ts +++ b/source/module/rolls/M5Roll.ts @@ -100,7 +100,7 @@ export class M5Roll { } async toMessage() { - let checkOptions = await this.popUp(); + let checkOptions = await this.popUp({ isPW: this.data.rolls[0].label === (game as Game).i18n.localize("midgard5.pw") }); if (checkOptions["cancelled"]) { return; } else { @@ -108,6 +108,7 @@ export class M5Roll { } if (!this._evaluated) await this.evaluate(); + const faces = this.pool.dice.map((x) => x.faces); const rMode = checkOptions["rollMode"] || (game as Game).settings.get("core", "rollMode"); const chatData = { @@ -116,7 +117,7 @@ export class M5Roll { speaker: ChatMessage.getSpeaker({ actor: this.actor }), sound: CONFIG.sounds.dice, roll: Roll.fromTerms([this.pool]), - flags: { data: this.data, rerolled: false, faces: this.pool.dice.map((x) => x.faces) }, + flags: { data: this.data, rerolled: false, faces: faces }, }; let foo = ChatMessage.applyRollMode(chatData, rMode); @@ -329,8 +330,9 @@ export class M5Roll { rollModes = CONFIG.Dice.rollModes, rollMode = "", template = "systems/midgard5/templates/chat/task-check-dialog.hbs", + isPW = false, } = {}) { - const html = await renderTemplate(template, { useFortune, difficulty, modifier, rollModes, rollMode }); + const html = await renderTemplate(template, { useFortune, difficulty, modifier, rollModes, rollMode, isPW }); return new Promise((resolve) => { const data = { title: (game as Game).i18n.localize("midgard5.chat.roll"), diff --git a/templates/chat/task-check-dialog.hbs b/templates/chat/task-check-dialog.hbs index fe969f5..6604497 100644 --- a/templates/chat/task-check-dialog.hbs +++ b/templates/chat/task-check-dialog.hbs @@ -3,10 +3,12 @@ -
- - -
+ {{#unless isPW}} +
+ + +
+ {{/unless}}