From 32c14a8533d696480f027ce35b12794baf200412 Mon Sep 17 00:00:00 2001 From: sladecraven Date: Mon, 7 Jun 2021 23:18:33 +0200 Subject: [PATCH] Correction sur creation oeuvre --- module/actor-sheet.js | 2 +- module/rdd-utility.js | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/module/actor-sheet.js b/module/actor-sheet.js index fd9fb336..ed649231 100644 --- a/module/actor-sheet.js +++ b/module/actor-sheet.js @@ -220,7 +220,7 @@ export class RdDActorSheet extends ActorSheet { RdDUtility.selectObjetType( this ); }); html.find('.creer-une-oeuvre').click(async event => { - this.selectTypeOeuvre(); + RdDUtility.selectTypeOeuvre(this); }); html.find('#nettoyer-conteneurs').click(async event => { this.actor.nettoyerConteneurs(); diff --git a/module/rdd-utility.js b/module/rdd-utility.js index f41c37ad..4daa2008 100644 --- a/module/rdd-utility.js +++ b/module/rdd-utility.js @@ -285,7 +285,29 @@ export class RdDUtility { }); d.render(true); } - + + /* -------------------------------------------- */ + static async selectTypeOeuvre( actorSheet) { + let typeObjets = RdDItem.getTypesOeuvres(); + let options = `Selectionnez le type d'oeuvre'; + let d = new Dialog({ + title: "Créer un équipement", + content: options, + buttons: { + one: { + icon: '', + label: "Créer l'objet", + callback: () => this.creerObjet(actorSheet) + } + } + }); + d.render(true); + } + /* -------------------------------------------- */ static buildListOptions(min, max) { let options = ""