Utiliser icones Fontawesome

Plutôt que les images custom
This commit is contained in:
Vincent Vandemeulebrouck
2021-05-19 00:55:00 +02:00
parent e0962506ed
commit d8d27430ed
5 changed files with 33 additions and 37 deletions

View File

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