forked from public/foundryvtt-reve-de-dragon
Fix: les TMRs sont en arrière plan
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user