Fix: les TMRs sont en arrière plan

This commit is contained in:
2023-10-24 00:30:00 +02:00
parent 0ed90f6177
commit c950f568fd
4 changed files with 20 additions and 18 deletions

View File

@ -39,7 +39,8 @@ export class RdDTMRDialog extends Dialog {
content: html,
buttons: {
closeButton: {
label: "Fermer", callback: html => this.close() }
label: "Fermer", callback: html => this.close()
}
},
default: "closeButton"
}
@ -93,6 +94,9 @@ export class RdDTMRDialog extends Dialog {
setTMRPendingAction(dialog) {
this.subdialog = dialog
if (dialog instanceof Application) {
dialog.bringToTop();
}
}
isDemiReveCache() {
@ -579,9 +583,12 @@ export class RdDTMRDialog extends Dialog {
_presentCite(tmr) {
const presentCite = this.casesSpeciales.find(c => EffetsDraconiques.presentCites.isCase(c, tmr.coord));
if (presentCite) {
this.minimize();
const caseData = presentCite;
EffetsDraconiques.presentCites.choisirUnPresent(caseData, (present => this._utiliserPresentCite(presentCite, present, tmr)));
const dialog = EffetsDraconiques.presentCites.choisirUnPresent(caseData, present => {
this._utiliserPresentCite(presentCite, present, tmr)
this.restoreTMRAfterAction();
});
this.setTMRPendingAction(dialog);
}
return presentCite;
}
@ -607,8 +614,6 @@ export class RdDTMRDialog extends Dialog {
presentCite: presentCite
};
await this._tentativeMaitrise(rencontreData);
this.maximize();
this.postRencontre(tmr);
}
@ -815,22 +820,22 @@ export class RdDTMRDialog extends Dialog {
/* -------------------------------------------- */
async _maitriserTMR(rollData, callbackMaitrise) {
this.minimize(); // Hide
rollData.isTMRCache = rollData.actor.isTMRCache();
const dialog = await RdDRoll.create(this.actor, rollData,
{
html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-maitrise-tmr.html',
close: html => { this.restoreTMRAfterAction(); }
},
{
name: rollData.maitrise.verbe, label: rollData.maitrise.action,
callbacks: [
this.actor.createCallbackExperience(),
{ action: r => { this.restoreTMRAfterAction() } },
{ action: callbackMaitrise }
]
}
);
dialog.render(true);
this.setTMRPendingAction(dialog);
}
/* -------------------------------------------- */