From d8d27430eda9eef0182a1d8dea6894352e2c7f55 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Wed, 19 May 2021 00:55:00 +0200 Subject: [PATCH] Utiliser icones Fontawesome MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plutôt que les images custom --- module/rdd-roll.js | 21 ++++++++++++------- styles/simple.css | 10 +-------- templates/actor-blessure-partial.html | 5 +---- templates/actor-sheet.html | 30 +++++++++++++-------------- templates/partial-roll-moral.html | 4 +++- 5 files changed, 33 insertions(+), 37 deletions(-) diff --git a/module/rdd-roll.js b/module/rdd-roll.js index 1151eb5f..05d92015 100644 --- a/module/rdd-roll.js +++ b/module/rdd-roll.js @@ -234,19 +234,24 @@ export class RdDRoll extends Dialog { this.rollData[attribute] = event.currentTarget.checked; this.updateRollResult(); }); - html.find('.imgAppelAuMoral').click((event) => { /* l'appel au moral, qui donne un bonus de +1 */ + html.find('.appel-moral').click((event) => { /* l'appel au moral, qui donne un bonus de +1 */ this.rollData.useMoral = !this.rollData.useMoral; + const appelMoral = html.find('.icon-appel-moral')[0]; + const tooltip = html.find('.tooltipAppelAuMoralText')[0]; + appelMoral.classList.remove('fa-grin-beam'); + appelMoral.classList.remove('fa-sad-tear'); + appelMoral.classList.remove('fa-meh'); if (this.rollData.useMoral) { if (this.rollData.moral > 0) { - html.find('.imgAppelAuMoral')[0].src = "/systems/foundryvtt-reve-de-dragon/icons/moral-heureux.svg"; - html.find('.tooltipAppelAuMoralText')[0].innerHTML = "Appel au moral"; + appelMoral.classList.add('fa-grin-beam'); + tooltip.innerHTML = "Appel au moral"; } else { - html.find('.imgAppelAuMoral')[0].src = "/systems/foundryvtt-reve-de-dragon/icons/moral-malheureux.svg"; - html.find('.tooltipAppelAuMoralText')[0].innerHTML = "Appel à l'énergie du désespoir"; + appelMoral.classList.add('fa-sad-tear'); + tooltip.innerHTML = "Appel à l'énergie du désespoir"; } } else { - html.find('.imgAppelAuMoral')[0].src = "/systems/foundryvtt-reve-de-dragon/icons/moral-neutre.svg"; - html.find('.tooltipAppelAuMoralText')[0].innerHTML = "Sans appel au moral"; + appelMoral.classList.add('fa-meh'); + tooltip.innerHTML = "Sans appel au moral"; } this.updateRollResult(); }); @@ -306,7 +311,7 @@ export class RdDRoll extends Dialog { HtmlUtility._showControlWhen($(".diffMoral"), rollData.ajustements.moralTotal.used); HtmlUtility._showControlWhen($(".divAppelAuMoral"), rollData.use.appelAuMoral); - HtmlUtility._showControlWhen($("#etat-general"), !RdDCarac.isIgnoreEtatGeneral(rollData.selectedCarac, rollData.competence)); + HtmlUtility._showControlWhen($("#etat-general"), !RdDCarac.isIgnoreEtatGeneral(rollData)); HtmlUtility._showControlWhen($("#ajust-astrologique"), RdDResolutionTable.isAjustementAstrologique(rollData)); // Mise à jour valeurs diff --git a/styles/simple.css b/styles/simple.css index ace91dcf..ce6b5a85 100644 --- a/styles/simple.css +++ b/styles/simple.css @@ -393,7 +393,7 @@ table {border: 1px solid #7a7971;} border-bottom: 1px solid #BBB; } -.blessure-inactive{ +.fas-inactive{ color:rgba(150, 150, 150, 0.4) } .blessure-active-legere{ @@ -900,14 +900,6 @@ ul, li { display: none !important; } -.imgAppelAuMoral { - height: 20px; - width: 20px; - border:none; - outline: none; - background-size: cover; -} - /* Tooltip container */ .tooltipAppelAuMoral { position: relative; diff --git a/templates/actor-blessure-partial.html b/templates/actor-blessure-partial.html index fd9afe68..8788169f 100644 --- a/templates/actor-blessure-partial.html +++ b/templates/actor-blessure-partial.html @@ -2,11 +2,8 @@ {{#if bless.active}} - {{!-- --}} - {{!-- --}} {{else}} - {{!-- --}} - + {{/if}} diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index 35825de3..7381a734 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -113,9 +113,9 @@
- blocker/débloquer{{#if options.editCaracComp}}Verrouiller{{else}}Déverrouiller{{/if}} + + {{#if options.editCaracComp}}Verrouiller{{else}}Déverrouiller{{/if}} +