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 @@