From c481661a32e6d1399b7e024b4e918ab33872135b Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Mon, 18 Jan 2021 11:24:16 +0100 Subject: [PATCH 1/2] =?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}} + +
From c21390bbeac0526cf25bc32123f38c2b8a059d02 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Mon, 18 Jan 2021 11:24:39 +0100 Subject: [PATCH 2/2] =?UTF-8?q?Init=20des=20cr=C3=A9atures?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/rdd-utility.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/rdd-utility.js b/module/rdd-utility.js index 65a6b8a7..31d1f8be 100644 --- a/module/rdd-utility.js +++ b/module/rdd-utility.js @@ -663,11 +663,12 @@ export class RdDUtility { } else if (arme.name == "Draconic") { initOffset = 7; } else { - initOffset = 2; // Melée = 3.XX + initOffset = 3; // Melée = 3.XX let competence = RdDItemCompetence.findCompetence(combatant.actor.data.items, arme.data.competence); compNiveau = competence.data.niveau; if (actor.data.type == 'creature' || actor.data.type == 'entite') { + initOffset = 3; // Melée = 3.XX caracForInit = competence.data.carac_value; } else { caracForInit = actor.data.data.carac[competence.data.defaut_carac].value;