From c481661a32e6d1399b7e024b4e918ab33872135b Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Mon, 18 Jan 2021 11:24:16 +0100 Subject: [PATCH] =?UTF-8?q?Lancer=20les=20d=C3=A9s=20sans=20fermer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dans la table de résolution, ajout de la possibilité de lancer les dés sans fermer la fenêtre --- module/rdd-roll-resolution-table.js | 18 ++++++++++++++---- styles/simple.css | 5 +++++ templates/dialog-roll-resolution.html | 15 +++++++-------- 3 files changed, 26 insertions(+), 12 deletions(-) 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 @@
-
- - {{#select carac}} {{#each carac as |caracitem key|}} {{/each}} {{/select}} - -
-
- {{#select diffLibre}} {{#each difficultesLibres as |key|}} @@ -20,13 +17,15 @@ {{/select}} - {{#select diffConditions}} {{#each ajustementsConditions as |key|}} {{/each}} {{/select}} + +