Gestion de la mise en reserve

This commit is contained in:
2020-07-26 17:26:17 +02:00
parent 0fecc3a202
commit dc57b46db5
3 changed files with 34 additions and 34 deletions

View File

@ -7,20 +7,22 @@ export class RdDRollDialog extends Dialog {
/* -------------------------------------------- */
constructor(mode, html, rollData, actor) {
let myButtons = { rollButton: {
label: "Lancer",
callback: html => this.performRollSort(html, false)
} };
if (mode == "sort") {
myButtons['reserveButton'] = { label: "Mettre en reserve",
callback: html => this.performRollSort(html, true)
}
}
// Common conf
let dialogConf = {
content: html,
buttons:
{
rollButton:
{
label: "Lancer",
callback: html => this.performRoll(html)
}
},
default: "rollButton"
}
buttons: myButtons,
default: "rollButton"
}
let dialogOptions = { classes: [ "rdddialog"] }
// Select proper roll dialog template and stuff
@ -39,7 +41,7 @@ export class RdDRollDialog extends Dialog {
} else if (mode == "sort") {
dialogConf.title = "Lancer un sort",
dialogOptions.width = 600;
dialogOptions.height = 360;
dialogOptions.height = 380;
}
super(dialogConf, dialogOptions);
@ -49,12 +51,12 @@ export class RdDRollDialog extends Dialog {
}
/* -------------------------------------------- */
performRoll (html) {
performRollSort (html, isReserve=false) {
this.rollData.isSortReserve = isReserve;
this.actor.performRoll( this.rollData );
}
/* -------------------------------------------- */
activateListeners(html) {
super.activateListeners(html);