From d739a7993ae5eef8a982f6a9efc45c3410080628 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Fri, 10 Mar 2023 22:26:38 +0100 Subject: [PATCH] rollCaracCompetence avec dialog --- module/actor.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/module/actor.js b/module/actor.js index bcbc7388..4295e8b5 100644 --- a/module/actor.js +++ b/module/actor.js @@ -2413,6 +2413,24 @@ export class RdDActor extends RdDBaseActor { if (tache) { await this.createEmbeddedDocuments('Item', [tache], { renderSheet: false }); } + + async rollCaracCompetence(caracName, compName, diff, options = { title: "" }) { + const competence = this.getCompetence(compName); + await this._openRollDialog({ + name: 'jet-competence', + label: 'Jet ' + Grammar.apostrophe('de', competence.name), + template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html', + rollData: { + alias: this.name, + carac: this.system.carac, + selectedCarac: this.getCaracByName(caracName), + selectedCaracName: caracName, + diffLibre: diff, + competence: competence, + show: { title: options?.title ?? '' } + }, + callbackAction: r => this.$onRollCompetence(r) + }); } /* -------------------------------------------- */