|
|
@ -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"),
|
||||
|
|
|
|||
|
|
@ -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">
|
||||
|
|
|
|||
Loading…
Reference in New Issue