From 5e7fcf3c9bfc3fd113e9b851452c956621fe2fb8 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Wed, 23 Nov 2022 22:41:49 +0100 Subject: [PATCH] =?UTF-8?q?fit-content=20pour=20toutes=20les=20fen=C3=AAtr?= =?UTF-8?q?es=20roll?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit C'est le comportement par défaut, donc enlever les surcharges Corrections pour les fenêtres de combat --- module/actor.js | 61 ++++++++++++---------------- module/rdd-combat.js | 85 +++++++++++++++++++--------------------- module/rdd-tmr-dialog.js | 1 - 3 files changed, 67 insertions(+), 80 deletions(-) diff --git a/module/actor.js b/module/actor.js index fe0b46a5..65017792 100644 --- a/module/actor.js +++ b/module/actor.js @@ -779,10 +779,7 @@ export class RdDActor extends Actor { rollData.competence.system.defaut_carac = 'reve-actuel'; const dialog = await RdDRoll.create(this, rollData, - { - html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-reve-de-dragon.html', - options: { height: 'fit-content' } - }, + { html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-reve-de-dragon.html' }, { name: 'maitrise', label: 'Maîtriser le Rêve de Dragon', @@ -2360,7 +2357,6 @@ export class RdDActor extends Actor { const dialog = await RdDRoll.create(this, rollData, { html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-sort.html', - options: { height: 'fit-content' }, close: html => { this.currentTMR.maximize() } // Re-display TMR }, { @@ -2565,15 +2561,17 @@ export class RdDActor extends Actor { RdDItemCompetenceCreature.setRollDataCreature(rollData) } console.log("rollCompetence !!!", rollData); - const dialog = await RdDRoll.create(this, rollData, { html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html' }, { - name: 'jet-competence', - label: 'Jet ' + Grammar.apostrophe('de', rollData.competence.name), - callbacks: [ - this.createCallbackExperience(), - this.createCallbackAppelAuMoral(), - { action: r => this.$onRollCompetence(r) } - ] - }); + const dialog = await RdDRoll.create(this, rollData, + { html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html' }, + { + name: 'jet-competence', + label: 'Jet ' + Grammar.apostrophe('de', rollData.competence.name), + callbacks: [ + this.createCallbackExperience(), + this.createCallbackAppelAuMoral(), + { action: r => this.$onRollCompetence(r) } + ] + }); dialog.render(true); } @@ -2625,15 +2623,17 @@ export class RdDActor extends Actor { console.log("rollTache !!!", rollData); - const dialog = await RdDRoll.create(this, rollData, { html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html' }, { - name: 'jet-competence', - label: 'Jet de Tâche ' + tacheData.name, - callbacks: [ - this.createCallbackExperience(), - this.createCallbackAppelAuMoral(), - { action: r => this._tacheResult(r) } - ] - }); + const dialog = await RdDRoll.create(this, rollData, + { html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html' }, + { + name: 'jet-competence', + label: 'Jet de Tâche ' + tacheData.name, + callbacks: [ + this.createCallbackExperience(), + this.createCallbackAppelAuMoral(), + { action: r => this._tacheResult(r) } + ] + }); dialog.render(true); } @@ -2680,10 +2680,7 @@ export class RdDActor extends Actor { console.log("rollArt !!!", artData); const dialog = await RdDRoll.create(this, artData, - { - html: `systems/foundryvtt-reve-de-dragon/templates/dialog-roll-${oeuvre.type}.html`, - options: { height: 'fit-content', } - }, + { html: `systems/foundryvtt-reve-de-dragon/templates/dialog-roll-${oeuvre.type}.html` }, { name: `jet-${artData.art}`, label: `${artData.verbe} ${oeuvre.name}`, @@ -2820,10 +2817,7 @@ export class RdDActor extends Actor { }; const dialog = await RdDRoll.create(this, meditationData, - { - html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-meditation.html', - options: { height: 'fit-content', } - }, + { html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-meditation.html' }, { name: 'jet-meditation', label: "Jet de méditation", @@ -2899,7 +2893,6 @@ export class RdDActor extends Actor { const dialog = await RdDRoll.create(this, rollData, { html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-signedraconique.html', - options: { height: 'fit-content' }, close: html => { this.currentTMR.maximize() } // Re-display TMR }, { @@ -3783,9 +3776,7 @@ export class RdDActor extends Actor { rollData.competence.system.defaut_carac = caracTache; const dialog = await RdDRoll.create(this, rollData, - { - html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-alchimie.html', - }, + { html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-alchimie.html' }, { name: 'tache-alchimique', label: 'Tache Alchimique', diff --git a/module/rdd-combat.js b/module/rdd-combat.js index 587581af..de7c14fb 100644 --- a/module/rdd-combat.js +++ b/module/rdd-combat.js @@ -791,23 +791,21 @@ export class RdDCombat { await this.proposerAjustementTirLancer(rollData) const dialog = await RdDRoll.create(this.attacker, rollData, + { html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html' }, { - html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html', - options: { height: 540 } - }, { - name: 'jet-attaque', - label: 'Attaque: ' + (arme?.name ?? competence.name), - callbacks: [ - this.attacker.createCallbackExperience(), - this.attacker.createCallbackAppelAuMoral(), - { action: r => this.removeChatMessageActionsPasseArme(r.passeArme) }, - { condition: r => arme && !RdDCombat.isParticuliere(r), action: r => this.attacker.incDecItemUse(arme._id) }, - { condition: r => (RdDCombat.isReussite(r) && !RdDCombat.isParticuliere(r)), action: r => this._onAttaqueNormale(r) }, - { condition: RdDCombat.isParticuliere, action: r => this._onAttaqueParticuliere(r) }, - { condition: RdDCombat.isEchec, action: r => this._onAttaqueEchec(r) }, - { condition: RdDCombat.isEchecTotal, action: r => this._onAttaqueEchecTotal(r) }, - ] - }); + name: 'jet-attaque', + label: 'Attaque: ' + (arme?.name ?? competence.name), + callbacks: [ + this.attacker.createCallbackExperience(), + this.attacker.createCallbackAppelAuMoral(), + { action: r => this.removeChatMessageActionsPasseArme(r.passeArme) }, + { condition: r => arme && !RdDCombat.isParticuliere(r), action: r => this.attacker.incDecItemUse(arme._id) }, + { condition: r => (RdDCombat.isReussite(r) && !RdDCombat.isParticuliere(r)), action: r => this._onAttaqueNormale(r) }, + { condition: RdDCombat.isParticuliere, action: r => this._onAttaqueParticuliere(r) }, + { condition: RdDCombat.isEchec, action: r => this._onAttaqueEchec(r) }, + { condition: RdDCombat.isEchecTotal, action: r => this._onAttaqueEchecTotal(r) }, + ] + }); dialog.render(true); } @@ -1050,22 +1048,20 @@ export class RdDCombat { let rollData = this._prepareParade(attackerRoll, arme, competence); const dialog = await RdDRoll.create(this.defender, rollData, + { html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html' }, { - html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html', - options: { height: 540 } - }, { - name: 'jet-parade', - label: 'Parade: ' + (arme ? arme.name : rollData.competence.name), - callbacks: [ - this.defender.createCallbackExperience(), - this.defender.createCallbackAppelAuMoral(), - { action: r => this.removeChatMessageActionsPasseArme(r.passeArme) }, - { condition: r => !RdDCombat.isParticuliere(r), action: r => this.defender.incDecItemUse(armeParadeId) }, - { condition: RdDCombat.isReussite, action: r => this._onParadeNormale(r) }, - { condition: RdDCombat.isParticuliere, action: r => this._onParadeParticuliere(r) }, - { condition: RdDCombat.isEchec, action: r => this._onParadeEchec(r) }, - ] - }); + name: 'jet-parade', + label: 'Parade: ' + (arme ? arme.name : rollData.competence.name), + callbacks: [ + this.defender.createCallbackExperience(), + this.defender.createCallbackAppelAuMoral(), + { action: r => this.removeChatMessageActionsPasseArme(r.passeArme) }, + { condition: r => !RdDCombat.isParticuliere(r), action: r => this.defender.incDecItemUse(armeParadeId) }, + { condition: RdDCombat.isReussite, action: r => this._onParadeNormale(r) }, + { condition: RdDCombat.isParticuliere, action: r => this._onParadeParticuliere(r) }, + { condition: RdDCombat.isEchec, action: r => this._onParadeEchec(r) }, + ] + }); dialog.render(true); } @@ -1133,19 +1129,20 @@ export class RdDCombat { let rollData = this._prepareEsquive(attackerRoll, esquive); const dialog = await RdDRoll.create(this.defender, rollData, - { html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html' }, { - name: 'jet-esquive', - label: 'Esquiver', - callbacks: [ - this.defender.createCallbackExperience(), - this.defender.createCallbackAppelAuMoral(), - { condition: r => !RdDCombat.isParticuliere(r), action: r => this.defender.incDecItemUse(esquive._id) }, - { action: r => this.removeChatMessageActionsPasseArme(r.passeArme) }, - { condition: RdDCombat.isReussite, action: r => this._onEsquiveNormale(r) }, - { condition: RdDCombat.isParticuliere, action: r => this._onEsquiveParticuliere(r) }, - { condition: RdDCombat.isEchec, action: r => this._onEsquiveEchec(r) }, - ] - }); + { html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html' }, + { + name: 'jet-esquive', + label: 'Esquiver', + callbacks: [ + this.defender.createCallbackExperience(), + this.defender.createCallbackAppelAuMoral(), + { condition: r => !RdDCombat.isParticuliere(r), action: r => this.defender.incDecItemUse(esquive._id) }, + { action: r => this.removeChatMessageActionsPasseArme(r.passeArme) }, + { condition: RdDCombat.isReussite, action: r => this._onEsquiveNormale(r) }, + { condition: RdDCombat.isParticuliere, action: r => this._onEsquiveParticuliere(r) }, + { condition: RdDCombat.isEchec, action: r => this._onEsquiveEchec(r) }, + ] + }); dialog.render(true); } diff --git a/module/rdd-tmr-dialog.js b/module/rdd-tmr-dialog.js index 598128fa..6d3acf29 100644 --- a/module/rdd-tmr-dialog.js +++ b/module/rdd-tmr-dialog.js @@ -775,7 +775,6 @@ export class RdDTMRDialog extends Dialog { const dialog = await RdDRoll.create(this.actor, rollData, { html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-maitrise-tmr.html', - options: { height: 'fit-content' }, close: html => { this.maximize(); } // Re-display TMR }, {