diff --git a/CHANGELOG.md b/CHANGELOG.md index e531d9e..8628ff3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ __! Be certain to carefully back up any critical user data before installing thi - QoL : RnK button is now black in chat if no actions are left in roll (new messages only). - QoL : Added symbols legend in RnK dialog as reminder. - QoL : Added "(x Max)" display in RnK picker for max number of dice to keep (thanks to Bragma). +- QoL : When DiceSoNice is enabled, the display of the RnK dialog is delayed by 2s before show-up. - Others minor optimizations (ex: 20q saving multiple item at once). ## 1.2.1 - Praised be Firefox diff --git a/system/scripts/dice/dice-picker-dialog.js b/system/scripts/dice/dice-picker-dialog.js index 35b9c12..b3d7d4a 100644 --- a/system/scripts/dice/dice-picker-dialog.js +++ b/system/scripts/dice/dice-picker-dialog.js @@ -391,6 +391,10 @@ export class DicePickerDialog extends FormApplication { // If initiative roll, check if player already have if (this.object.isInitiativeRoll) { + if (!game.combat) { + ui.notifications.warn(game.i18n.localize("COMBAT.NoneActive")); + return this.close(); + } const combatant = game.combat.combatants.find((c) => c.actor.id === this._actor.id && c.initiative > 0); if (combatant) { ui.notifications.error(game.i18n.localize("l5r5e.conflict.initiative.already_set")); @@ -476,7 +480,10 @@ export class DicePickerDialog extends FormApplication { } if (message) { - new game.l5r5e.RollnKeepDialog(message.id).render(true); + // if DsN active, delay the popup for 2s + new Promise((r) => setTimeout(r, !game.dice3d ? 0 : 2000)).then(() => { + new game.l5r5e.RollnKeepDialog(message.id).render(true); + }); } return this.close(); diff --git a/system/scripts/helpers.js b/system/scripts/helpers.js index 7be6515..afcd9a8 100644 --- a/system/scripts/helpers.js +++ b/system/scripts/helpers.js @@ -201,6 +201,7 @@ export class HelpersL5r5e { return property; }) ); + document.data.update({ "data.properties": document.data.data.properties }); } }