/* -------------------------------------------- */
export class RdDTMRRencontreDialog extends Dialog {
/* -------------------------------------------- */
constructor(html, tmrApp, rencontre) {
const dialogConf = {
title: "Rencontre en TMR!",
content: "Vous recontrez un " + rencontre.name + " de force " + rencontre.force + "
",
buttons: {
derober: { icon: '', label: "Se dérober", callback: () => { this.toClose = true; this.tmrApp.derober() } },
refouler: { icon: '', label: "Refouler", callback: () => { this.toClose = true; this.tmrApp.refouler() } },
maitiser: { icon: '', label: "Maîtriser", callback: () => { this.toClose = true; this.tmrApp.maitriser() } }
},
default: "derober"
}
if (rencontre.ignorer) {
dialogConf.buttons.ignorer = { icon: '', label: "Ignorer", callback: () => { this.toClose = true; this.tmrApp.ignorerRencontre() }};
}
const dialogOptions = {
classes: ["tmrrencdialog"],
width: 320, height: 240,
'z-index': 20
}
super(dialogConf, dialogOptions);
this.toClose = false;
this.rencontreData = duplicate(rencontre);
this.tmrApp = tmrApp;
this.tmrApp.minimize();
}
/* -------------------------------------------- */
close() {
if ( this.toClose ) {
this.tmrApp.maximize();
return super.close();
}
ui.notifications.info("Vous devez résoudre la rencontre.");
}
}