Lancer les dés sans fermer
Dans la table de résolution, ajout de la possibilité de lancer les dés sans fermer la fenêtre
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user