From 039cb8ab71e38211d8cb3ff1faef3f05c251359c Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Thu, 14 Jan 2021 00:50:12 +0100 Subject: [PATCH] Fix Tentacules/Tentacules(Tentacules) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pour les créatures, les jets de compétences n'affichent plus que la compétence --- module/rdd-roll.js | 22 ++++++++++++++-------- templates/dialog-competence.html | 1 - 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/module/rdd-roll.js b/module/rdd-roll.js index de2f3b05..9f45752d 100644 --- a/module/rdd-roll.js +++ b/module/rdd-roll.js @@ -278,15 +278,21 @@ export class RdDRoll extends Dialog { /* -------------------------------------------- */ _getTitle(rollData) { - if (rollData.competence) { - // If a weapon is there, add it in the title - let armeTitle = (rollData.arme) ? " (" + rollData.arme.name + ") " : ""; - let niveau = Misc.toSignedString(rollData.competence.data.niveau); - return rollData.selectedCarac.label + "/" + rollData.competence.name + armeTitle + " " + niveau + const carac = rollData.selectedCarac.label; + if (!rollData.competence) { + return carac; } - if (rollData.draconicList) { - return rollData.competence.name + " - " + rollData.selectedSort.name; + const compName = rollData.competence.name; + if (rollData.draconicList && rollData.selectedSort) { + return compName + " - " + rollData.selectedSort.name; } - return rollData.selectedCarac.label; + // If a weapon is there, add it in the title + const niveau = Misc.toSignedString(rollData.competence.data.niveau); + if (compName == carac) { + // cas des créatures + return carac + " " + niveau + } + const armeTitle = (rollData.arme) ? " (" + rollData.arme.name + ") " : ""; + return carac + "/" + compName + armeTitle + " " + niveau } } diff --git a/templates/dialog-competence.html b/templates/dialog-competence.html index 1d8b4025..72817bb0 100644 --- a/templates/dialog-competence.html +++ b/templates/dialog-competence.html @@ -1,4 +1,3 @@ -{{log "handlebar dialog-competence" this}}