forked from public/foundryvtt-reve-de-dragon
Fix TMR minimize/maximize
Au lieu de minimiser les TMRs, les actions dans les TMRs sont bloquées tant qu'une action liée au TMRs est en cours.
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
export class RdDTMRRencontreDialog extends Dialog {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
constructor(tmrApp, rencontre, tmr) {
|
||||
constructor(actor, rencontre, tmr) {
|
||||
const dialogConf = {
|
||||
title: "Rencontre en TMR!",
|
||||
content: "Vous rencontrez un " + rencontre.name + " de force " + rencontre.system.force + "<br>",
|
||||
@ -28,23 +28,30 @@ export class RdDTMRRencontreDialog extends Dialog {
|
||||
|
||||
this.toClose = false;
|
||||
this.tmr = tmr;
|
||||
this.tmrApp = tmrApp;
|
||||
this.actor = actor;
|
||||
this.rencontre = rencontre;
|
||||
this.tmrApp.minimize();
|
||||
}
|
||||
|
||||
async onButtonAction(action) {
|
||||
this.toClose = true;
|
||||
this.tmrApp.onActionRencontre(action, this.tmr, this.rencontre)
|
||||
this.actor.tmrApp?.onActionRencontre(action, this.tmr, this.rencontre)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
close() {
|
||||
if (this.toClose) {
|
||||
this.tmrApp.maximize();
|
||||
return super.close();
|
||||
async close() {
|
||||
if (this.actor.tmrApp){
|
||||
if (this.toClose) {
|
||||
this.actor.tmrApp?.restoreTMRAfterAction();
|
||||
return await super.close();
|
||||
}
|
||||
else {
|
||||
ui.notifications.info("Vous devez résoudre la rencontre.");
|
||||
this.actor.tmrApp.forceTMRContinueAction();
|
||||
}
|
||||
}
|
||||
else {
|
||||
return await super.close();
|
||||
}
|
||||
ui.notifications.info("Vous devez résoudre la rencontre.");
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user