From ded92ddf2d4e1ed1008a4780d2d3efc4cdd8042e Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sat, 14 Dec 2024 00:38:39 +0100 Subject: [PATCH] =?UTF-8?q?D=C3=A9placement=20update=20competences?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Placé sur les feuilles d'acteurs qui ont des compétences --- module/actor/base-actor-reve-sheet.js | 13 +++++++++++++ module/actor/base-actor-sheet.js | 15 --------------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/module/actor/base-actor-reve-sheet.js b/module/actor/base-actor-reve-sheet.js index c4ebac2b..996f8f08 100644 --- a/module/actor/base-actor-reve-sheet.js +++ b/module/actor/base-actor-reve-sheet.js @@ -48,6 +48,19 @@ export class RdDBaseActorReveSheet extends RdDBaseActorSheet { }], { renderSheet: true }) ) + if (this.options.vueDetaillee) { + // On carac change + this.html.find('.carac-value').change(async event => { + let caracName = event.currentTarget.name.replace(".value", "").replace("system.carac.", ""); + this.actor.updateCarac(caracName, parseInt(event.target.value)); + }); + // On competence change + this.html.find('.competence-value').change(async event => { + let compName = event.currentTarget.attributes.compname.value; + //console.log("Competence changed :", compName); + this.actor.updateCompetence(compName, parseInt(event.target.value)); + }); + } } } diff --git a/module/actor/base-actor-sheet.js b/module/actor/base-actor-sheet.js index c83106b7..5d88b2f4 100644 --- a/module/actor/base-actor-sheet.js +++ b/module/actor/base-actor-sheet.js @@ -177,21 +177,6 @@ export class RdDBaseActorSheet extends ActorSheet { this.options.vueDetaillee = !this.options.vueDetaillee; this.render(true); }); - - if (this.options.vueDetaillee) { - // On carac change - this.html.find('.carac-value').change(async event => { - let caracName = event.currentTarget.name.replace(".value", "").replace("system.carac.", ""); - this.actor.updateCarac(caracName, parseInt(event.target.value)); - }); - // On competence change - this.html.find('.competence-value').change(async event => { - let compName = event.currentTarget.attributes.compname.value; - //console.log("Competence changed :", compName); - this.actor.updateCompetence(compName, parseInt(event.target.value)); - }); - } - } _rechercherKeyup(event) {