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/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; 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}} + +