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

@ -2149,7 +2149,6 @@ export class RdDActor extends RdDBaseActor {
return;
}
const draconicList = this.computeDraconicAndSortIndex(sorts);
const reve = duplicate(this.system.carac.reve);
@ -2169,7 +2168,10 @@ export class RdDActor extends RdDBaseActor {
diffLibre: RdDItemSort.getDifficulte(sorts[0], -7), // Per default at startup
coutreve: Array(30).fill().map((item, index) => 1 + index),
},
callbackAction: r => this._rollUnSortResult(r)
callbackAction: async r => {
await this._rollUnSortResult(r);
if (!r.isSortReserve) this.tmrApp?.close();
}
});
this.tmrApp?.setTMRPendingAction(dialog);
}
@ -2262,17 +2264,11 @@ export class RdDActor extends RdDBaseActor {
reveActuel = Math.max(reveActuel - rollData.depenseReve, 0);
await this.update({ "system.reve.reve.value": reveActuel });
if (rollData.isSortReserve) {
this.tmrApp.maximize(); // Re-display TMR
} else {
this.tmrApp.close(); // Close TMR !
}
// Final chat message
await RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-sort.html');
if (reveActuel == 0) { // 0 points de reve
ChatMessage.create({ content: this.name + " est réduit à 0 Points de Rêve, et tombe endormi !" });
closeTMR = true;
}
}