Fixes nombreux sur tmr
- rencontre sur case humide ne causait pas de maîtrise - détermination de la liste des tmrs par type à l'init (classify) - tirages aléatoire par type de tmr dans les commandes - amélioration de messages (nom de case) - fix expérience case humide - correction gestion des débordement - montées très laborieuses multiples - renommages et extraits méthodes - distinction de pos (x, y) vs coord (A1)
This commit is contained in:
@ -1,22 +1,22 @@
|
||||
/* -------------------------------------------- */
|
||||
export class RdDTMRRencontreDialog extends Dialog {
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
constructor(html, tmrApp, rencontre) {
|
||||
constructor(html, tmrApp, rencontre, postRencontre) {
|
||||
const dialogConf = {
|
||||
title: "Rencontre en TMR!",
|
||||
content: "Vous recontrez un " + rencontre.name + " de force " + rencontre.force + "<br>",
|
||||
buttons: {
|
||||
derober: { icon: '<i class="fas fa-check"></i>', label: "Se dérober", callback: () => { this.toClose = true; this.tmrApp.derober() } },
|
||||
refouler: { icon: '<i class="fas fa-check"></i>', label: "Refouler", callback: () => { this.toClose = true; this.tmrApp.refouler() } },
|
||||
maitiser: { icon: '<i class="fas fa-check"></i>', label: "Maîtriser", callback: () => { this.toClose = true; this.tmrApp.maitriser() } }
|
||||
derober: { icon: '<i class="fas fa-check"></i>', label: "Se dérober", callback: () => { this.onButtonFuir(() => tmrApp.derober()); } },
|
||||
refouler: { icon: '<i class="fas fa-check"></i>', label: "Refouler", callback: () => this.onButtonAction(() => tmrApp.refouler()) },
|
||||
maitiser: { icon: '<i class="fas fa-check"></i>', label: "Maîtriser", callback: () => this.onButtonAction(() => tmrApp.maitriser()) }
|
||||
},
|
||||
default: "derober"
|
||||
}
|
||||
};
|
||||
if (rencontre.ignorer) {
|
||||
dialogConf.buttons.ignorer = { icon: '<i class="fas fa-check"></i>', label: "Ignorer", callback: () => { this.toClose = true; this.tmrApp.ignorerRencontre() }};
|
||||
}
|
||||
|
||||
dialogConf.buttons.ignorer = { icon: '<i class="fas fa-check"></i>', label: "Ignorer", callback: () => this.onButtonAction(() => tmrApp.ignorerRencontre()) }
|
||||
};
|
||||
|
||||
const dialogOptions = {
|
||||
classes: ["tmrrencdialog"],
|
||||
width: 320, height: 240,
|
||||
@ -26,13 +26,25 @@ export class RdDTMRRencontreDialog extends Dialog {
|
||||
|
||||
this.toClose = false;
|
||||
this.rencontreData = duplicate(rencontre);
|
||||
this.postRencontre = postRencontre;
|
||||
this.tmrApp = tmrApp;
|
||||
this.tmrApp.minimize();
|
||||
}
|
||||
|
||||
async onButtonAction(action) {
|
||||
this.toClose = true;
|
||||
await action();
|
||||
this.postRencontre();
|
||||
}
|
||||
|
||||
onButtonFuir(action) {
|
||||
this.toClose = true;
|
||||
await action();
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
close() {
|
||||
if ( this.toClose ) {
|
||||
if (this.toClose) {
|
||||
this.tmrApp.maximize();
|
||||
return super.close();
|
||||
}
|
||||
|
Reference in New Issue
Block a user