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:
@ -369,7 +369,7 @@ export class RdDActor extends RdDBaseActor {
|
||||
|
||||
async _openRollDialog({ name, label, template, rollData, callbackAction }) {
|
||||
const dialog = await RdDRoll.create(this, rollData,
|
||||
{ html: template },
|
||||
{ html: template, close: html => { this.tmrApp?.restoreTMRAfterAction() } },
|
||||
{
|
||||
name: name,
|
||||
label: label,
|
||||
@ -380,6 +380,7 @@ export class RdDActor extends RdDBaseActor {
|
||||
]
|
||||
});
|
||||
dialog.render(true);
|
||||
return dialog
|
||||
}
|
||||
|
||||
|
||||
@ -846,7 +847,7 @@ export class RdDActor extends RdDBaseActor {
|
||||
system: { sortid: sort._id, draconic: (draconic?.name ?? sort.system.draconic), ptreve: ptreve, coord: coord, heurecible: 'Vaisseau' }
|
||||
}],
|
||||
{ renderSheet: false });
|
||||
this.currentTMR.updateTokens();
|
||||
this.tmrApp.updateTokens();
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -2138,12 +2139,12 @@ export class RdDActor extends RdDBaseActor {
|
||||
ui.notifications.info(`Aucun sort disponible en ${TMRUtility.getTMR(coord).label} !`);
|
||||
return;
|
||||
}
|
||||
if (this.currentTMR) this.currentTMR.minimize(); // Hide
|
||||
|
||||
|
||||
const draconicList = this.computeDraconicAndSortIndex(sorts);
|
||||
const reve = duplicate(this.system.carac.reve);
|
||||
|
||||
await this._openRollDialog({
|
||||
const dialog = await this._openRollDialog({
|
||||
name: 'lancer-un-sort',
|
||||
label: 'Lancer un sort',
|
||||
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-sort.html',
|
||||
@ -2161,6 +2162,7 @@ export class RdDActor extends RdDBaseActor {
|
||||
},
|
||||
callbackAction: r => this._rollUnSortResult(r)
|
||||
});
|
||||
this.tmrApp?.setTMRPendingAction(dialog);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -2252,9 +2254,9 @@ export class RdDActor extends RdDBaseActor {
|
||||
await this.update({ "system.reve.reve.value": reveActuel });
|
||||
|
||||
if (rollData.isSortReserve) {
|
||||
this.currentTMR.maximize(); // Re-display TMR
|
||||
this.tmrApp.maximize(); // Re-display TMR
|
||||
} else {
|
||||
this.currentTMR.close(); // Close TMR !
|
||||
this.tmrApp.close(); // Close TMR !
|
||||
}
|
||||
// Final chat message
|
||||
await RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-sort.html');
|
||||
@ -2723,8 +2725,6 @@ export class RdDActor extends RdDBaseActor {
|
||||
ui.notifications.info(`Aucun signe draconiques en ${coord} !`);
|
||||
return;
|
||||
}
|
||||
if (this.currentTMR) this.currentTMR.minimize(); // Hide
|
||||
|
||||
let draconicList = this.getDraconicList()
|
||||
.map(draconic => {
|
||||
let draconicLecture = duplicate(draconic);
|
||||
@ -2747,7 +2747,7 @@ export class RdDActor extends RdDBaseActor {
|
||||
const dialog = await RdDRoll.create(this, rollData,
|
||||
{
|
||||
html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-signedraconique.html',
|
||||
close: html => { this.currentTMR.maximize() } // Re-display TMR
|
||||
close: html => { this.tmrApp?.restoreTMRAfterAction() }
|
||||
},
|
||||
{
|
||||
name: 'lire-signe-draconique',
|
||||
@ -2759,6 +2759,7 @@ export class RdDActor extends RdDBaseActor {
|
||||
}
|
||||
);
|
||||
dialog.render(true);
|
||||
this.tmrApp?.setTMRPendingAction(dialog);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -2777,7 +2778,7 @@ export class RdDActor extends RdDBaseActor {
|
||||
}
|
||||
await this.deleteEmbeddedDocuments("Item", [rollData.signe._id]);
|
||||
await RdDResolutionTable.displayRollData(rollData, this.name, 'chat-resultat-lecture-signedraconique.html');
|
||||
this.currentTMR.close();
|
||||
this.tmrApp.close();
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -3012,8 +3013,8 @@ export class RdDActor extends RdDBaseActor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
refreshTMRView() {
|
||||
if (this.currentTMR) {
|
||||
this.currentTMR.externalRefresh();
|
||||
if (this.tmrApp) {
|
||||
this.tmrApp.externalRefresh();
|
||||
}
|
||||
}
|
||||
|
||||
@ -3021,6 +3022,7 @@ export class RdDActor extends RdDBaseActor {
|
||||
async displayTMR(mode = "normal") {
|
||||
if (this.tmrApp) {
|
||||
ui.notifications.warn("Vous êtes déja dans les TMR....");
|
||||
this.tmrApp.forceTMRDisplay();
|
||||
return
|
||||
}
|
||||
if (mode != 'visu' && this.getEffect(STATUSES.StatusDemiReve)) {
|
||||
@ -3066,8 +3068,8 @@ export class RdDActor extends RdDBaseActor {
|
||||
hasPlayerOwner: this.hasPlayerOwner
|
||||
}
|
||||
|
||||
this.currentTMR = await RdDTMRDialog.create(this, tmrFormData);
|
||||
this.currentTMR.render(true);
|
||||
this.tmrApp = await RdDTMRDialog.create(this, tmrFormData);
|
||||
this.tmrApp.render(true);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
Reference in New Issue
Block a user