forked from public/foundryvtt-reve-de-dragon
		
	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:
		| @@ -148,13 +148,15 @@ export class RdDCalendrier extends Application { | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   /* -------------------------------------------- */ |   /* -------------------------------------------- */ | ||||||
|   async ajouterNombreAstral(index, showdice = true) { |   async ajouterNombreAstral(index, showDice = true) { | ||||||
|     const nombreAstral = await RdDDice.rollTotal("1dh", { showDice: showdice, rollMode: "selfroll" }); |     const nombreAstral = await RdDDice.rollTotal("1dh", { showDice: showDice, hideDice: !showDice, rollMode: "selfroll" }); | ||||||
|     const dateFuture = this.getDateFromIndex(index); |     const dateFuture = this.getDateFromIndex(index); | ||||||
|     ChatMessage.create({ |     if (showDice) { | ||||||
|       whisper: ChatMessage.getWhisperRecipients("GM"), |         ChatMessage.create({ | ||||||
|       content: `Le chiffre astrologique du ${dateFuture} sera le ${nombreAstral}` |         whisper: ChatMessage.getWhisperRecipients("GM"), | ||||||
|     }); |         content: `Le chiffre astrologique du ${dateFuture} sera le ${nombreAstral}` | ||||||
|  |       }); | ||||||
|  |     } | ||||||
|     return { |     return { | ||||||
|       nombreAstral: nombreAstral, |       nombreAstral: nombreAstral, | ||||||
|       valeursFausses: [], |       valeursFausses: [], | ||||||
|   | |||||||
| @@ -134,12 +134,14 @@ export class RdDDice { | |||||||
|   static async roll(formula, options = { showDice: false, rollMode: undefined }) { |   static async roll(formula, options = { showDice: false, rollMode: undefined }) { | ||||||
|     const roll = new Roll(formula); |     const roll = new Roll(formula); | ||||||
|     await roll.evaluate({ async: true }); |     await roll.evaluate({ async: true }); | ||||||
|     roll.showDice = options.showDice; |     if (!options.hideDice) { | ||||||
|     await RdDDice.show(roll, options.rollMode ?? game.settings.get("core", "rollMode")); |       roll.showDice = options.showDice; | ||||||
|  |       await RdDDice.show(roll, options.rollMode ?? game.settings.get("core", "rollMode")); | ||||||
|  |     } | ||||||
|     return roll; |     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); |     const roll = await RdDDice.roll(formula, options); | ||||||
|     return roll.total; |     return roll.total; | ||||||
|   } |   } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user