Fix: re-tirage de dés sur reload

- ajout d'une option pour explicitement masquer les dés
- si showDice=false dans rdd-calendar, masquer les dés
- sauvegarde de la nouvelle liste plutôt que l'ancienne
This commit is contained in:
Vincent Vandemeulebrouck
2021-06-25 14:40:25 +02:00
parent c094128582
commit b06018d252
2 changed files with 13 additions and 9 deletions

View File

@ -134,12 +134,14 @@ export class RdDDice {
static async roll(formula, options = { showDice: false, rollMode: undefined }) {
const roll = new Roll(formula);
await roll.evaluate({ async: true });
roll.showDice = options.showDice;
await RdDDice.show(roll, options.rollMode ?? game.settings.get("core", "rollMode"));
if (!options.hideDice) {
roll.showDice = options.showDice;
await RdDDice.show(roll, options.rollMode ?? game.settings.get("core", "rollMode"));
}
return roll;
}
static async rollTotal(formula, options = { showDice: false }) {
static async rollTotal(formula, options = { showDice: false, hideDice: false }) {
const roll = await RdDDice.roll(formula, options);
return roll.total;
}