#82 - Affichage TMR sur close

This commit is contained in:
sladecraven 2020-12-28 10:17:40 +01:00
parent 30d8881cb6
commit f7471efcd3
2 changed files with 7 additions and 4 deletions

View File

@ -1225,7 +1225,9 @@ export class RdDActor extends Actor {
if ( this.currentTMR) this.currentTMR.minimize(); // Hide
const dialog = await RdDRoll.create(this, rollData,
{html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-sort.html'},
{ html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-sort.html',
close: html => { this.currentTMR.maximize() } // Re-display TMR
},
{
name: 'lancer-un-sort',
label: 'Lancer un sort',

View File

@ -24,7 +24,7 @@ export class RdDRoll extends Dialog {
if (dialogConfig.options) {
mergeObject(options, dialogConfig.options, { overwrite: true })
}
return new RdDRoll(actor, rollData, html, options, actions);
return new RdDRoll(actor, rollData, html, options, actions, dialogConfig.close );
}
/* -------------------------------------------- */
@ -67,12 +67,13 @@ export class RdDRoll extends Dialog {
}
/* -------------------------------------------- */
constructor(actor, rollData, html, options, actions) {
constructor(actor, rollData, html, options, actions, close = undefined) {
let conf = {
title: actions[0].label,
content: html,
buttons: {},
default: actions[0].name
default: actions[0].name,
close: close
};
for (let action of actions) {
conf.buttons[action.name] = { label: action.label, callback: html => this.onAction(action, html) };