diff --git a/module/rdd-roll-resolution-table.js b/module/rdd-roll-resolution-table.js index 2d148010..ad2eface 100644 --- a/module/rdd-roll-resolution-table.js +++ b/module/rdd-roll-resolution-table.js @@ -49,8 +49,9 @@ export class RdDRollResolutionTable extends Dialog { title: titleTableDeResolution, content: html, buttons: { - 'lancer': { label: 'Lancer les dés', callback: html => this.onAction(html) } - } + 'lancer-fermer': { label: 'Lancer les dés et fermer', callback: html => this.onLancerFermer() } + }, + default: 'lancer' }; super(conf, { classes: ["rdddialog"], width: 800, height: 800, 'z-index': 99999 }); @@ -58,7 +59,14 @@ export class RdDRollResolutionTable extends Dialog { } /* -------------------------------------------- */ - async onAction(html) { + async onLancer() { + await RdDResolutionTable.rollData(this.rollData); + console.log("RdDRollResolutionTable -=>", this.rollData, this.rollData.rolled); + await RdDResolutionTable.displayRollData(this.rollData); + } + + /* -------------------------------------------- */ + async onLancerFermer() { await RdDResolutionTable.rollData(this.rollData); console.log("RdDRollResolutionTable -=>", this.rollData, this.rollData.rolled); await RdDResolutionTable.displayRollData(this.rollData); @@ -79,7 +87,9 @@ export class RdDRollResolutionTable extends Dialog { dialog.updateRollResult(); } $(function () { onLoad();}); - + html.find('#lancer').click((event) => { + this.onLancer(); + }); // Update ! html.find('#diffLibre').change((event) => { this.rollData.diffLibre = Misc.toInt(event.currentTarget.value); diff --git a/styles/simple.css b/styles/simple.css index 6242269c..adf19db3 100644 --- a/styles/simple.css +++ b/styles/simple.css @@ -507,6 +507,11 @@ section.sheet-body:after { text-align: left; width: 2rem; } +.select-diff { + display: inline-block; + text-align: left; + width: 50px; +} #vie-plus, #vie-moins, #endurance-plus, #endurance-moins, #fatigue-plus, #fatigue-moins, #ptreve-actuel-plus, #ptreve-actuel-moins, .monnaie-plus, .monnaie-moins { display: inline-block; diff --git a/templates/dialog-roll-resolution.html b/templates/dialog-roll-resolution.html index cd6a5a3f..a7df5ca6 100644 --- a/templates/dialog-roll-resolution.html +++ b/templates/dialog-roll-resolution.html @@ -1,18 +1,15 @@