Merged
Byroks merged 8 commits from Situationsbedingte-Boni/Mali-#41 into develop 2024-03-29 14:28:50 +01:00
2 changed files with 11 additions and 7 deletions
Showing only changes of commit e6479feaa6 - Show all commits

View File

@ -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"),

View File

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