Versteck schwellenwert bei PW

This commit is contained in:
Byroks 2024-03-28 17:25:19 +01:00
parent 4ce31a97df
commit e6479feaa6
2 changed files with 11 additions and 7 deletions

View File

@ -100,7 +100,7 @@ export class M5Roll {
} }
async toMessage() { 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"]) { if (checkOptions["cancelled"]) {
return; return;
} else { } else {
@ -108,6 +108,7 @@ export class M5Roll {
} }
if (!this._evaluated) await this.evaluate(); 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 rMode = checkOptions["rollMode"] || (game as Game).settings.get("core", "rollMode");
const chatData = { const chatData = {
@ -116,7 +117,7 @@ export class M5Roll {
speaker: ChatMessage.getSpeaker({ actor: this.actor }), speaker: ChatMessage.getSpeaker({ actor: this.actor }),
sound: CONFIG.sounds.dice, sound: CONFIG.sounds.dice,
roll: Roll.fromTerms([this.pool]), 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); let foo = ChatMessage.applyRollMode(chatData, rMode);
@ -329,8 +330,9 @@ export class M5Roll {
rollModes = CONFIG.Dice.rollModes, rollModes = CONFIG.Dice.rollModes,
rollMode = "", rollMode = "",
template = "systems/midgard5/templates/chat/task-check-dialog.hbs", 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) => { return new Promise((resolve) => {
const data = { const data = {
title: (game as Game).i18n.localize("midgard5.chat.roll"), title: (game as Game).i18n.localize("midgard5.chat.roll"),

View File

@ -3,10 +3,12 @@
<label>{{localize "midgard5.chat.options.modifier"}}</label> <label>{{localize "midgard5.chat.options.modifier"}}</label>
<input type="number" name="modifier" value="{{modifier}}" /> <input type="number" name="modifier" value="{{modifier}}" />
</div> </div>
<div class="form-group"> {{#unless isPW}}
<label>{{localize "midgard5.chat.options.difficulty"}}</label> <div class="form-group">
<input type="number" name="difficulty" value="{{difficulty}}" /> <label>{{localize "midgard5.chat.options.difficulty"}}</label>
</div> <input type="number" name="difficulty" value="{{difficulty}}" />
</div>
{{/unless}}
<div class="form-group"> <div class="form-group">
<label>{{localize "midgard5.chat.options.rollMode"}}</label> <label>{{localize "midgard5.chat.options.rollMode"}}</label>
<select name="rollMode"> <select name="rollMode">