diff --git a/module/actor-sheet.js b/module/actor-sheet.js index 803ad71c..6c43d5c1 100644 --- a/module/actor-sheet.js +++ b/module/actor-sheet.js @@ -111,7 +111,7 @@ export class RdDActorSheet extends RdDBaseActorSheet { activateListeners(html) { super.activateListeners(html); - HtmlUtility._showControlWhen(this.html.find(".appliquerFatigue"), ReglesOptionelles.isUsing("appliquer-fatigue")); + HtmlUtility.showControlWhen(this.html.find(".appliquerFatigue"), ReglesOptionelles.isUsing("appliquer-fatigue")); // Everything below here is only needed if the sheet is editable if (!this.options.editable) return; diff --git a/module/dialog-create-signedraconique.js b/module/dialog-create-signedraconique.js index fa012e9d..7f5820be 100644 --- a/module/dialog-create-signedraconique.js +++ b/module/dialog-create-signedraconique.js @@ -98,7 +98,7 @@ export class DialogCreateSigneDraconique extends Dialog { async setEphemere(ephemere) { this.dialogData.signe.system.ephemere = ephemere; - HtmlUtility._showControlWhen(this.html.find(".signe-system-duree"), ephemere); + HtmlUtility.showControlWhen(this.html.find(".signe-system-duree"), ephemere); } async onSelectActor(event) { diff --git a/module/dialog-item-vente.js b/module/dialog-item-vente.js index ac17a001..5b6a62ce 100644 --- a/module/dialog-item-vente.js +++ b/module/dialog-item-vente.js @@ -86,6 +86,6 @@ export class DialogItemVente extends Dialog { setQuantiteIllimite(checked) { this.venteData.quantiteIllimite = checked; this.html.find(".label-quantiteIllimite").text(this.venteData.quantiteIllimite ? "Illimités" : "disponibles"); - HtmlUtility._showControlWhen(this.html.find(".quantiteNbLots"), !this.venteData.quantiteIllimite) + HtmlUtility.showControlWhen(this.html.find(".quantiteNbLots"), !this.venteData.quantiteIllimite) } } \ No newline at end of file diff --git a/module/html-utility.js b/module/html-utility.js index c4754cc5..fd76ac75 100644 --- a/module/html-utility.js +++ b/module/html-utility.js @@ -1,5 +1,5 @@ export class HtmlUtility{ - static _showControlWhen(jQuerySelector, condition) { + static showControlWhen(jQuerySelector, condition) { if (condition) { jQuerySelector.show(); } diff --git a/module/item-sheet.js b/module/item-sheet.js index c5f96b64..eb4048a3 100644 --- a/module/item-sheet.js +++ b/module/item-sheet.js @@ -156,8 +156,8 @@ export class RdDItemSheet extends ItemSheet { super.activateListeners(html); this.html = html; - HtmlUtility._showControlWhen(this.html.find(".item-cout"), ReglesOptionelles.isUsing('afficher-prix-joueurs') || game.user.isGM || !this.item.isOwned); - HtmlUtility._showControlWhen(this.html.find(".item-magique"), this.item.isMagique()); + HtmlUtility.showControlWhen(this.html.find(".item-cout"), ReglesOptionelles.isUsing('afficher-prix-joueurs') || game.user.isGM || !this.item.isOwned); + HtmlUtility.showControlWhen(this.html.find(".item-magique"), this.item.isMagique()); // Everything below here is only needed if the sheet is editable if (!this.options.editable) return; diff --git a/module/rdd-roll.js b/module/rdd-roll.js index 57c5ff70..22a8368f 100644 --- a/module/rdd-roll.js +++ b/module/rdd-roll.js @@ -276,11 +276,11 @@ export class RdDRoll extends Dialog { const diffVariable = RdDItemSort.isDifficulteVariable(sort); const coutVariable = RdDItemSort.isCoutVariable(sort); - HtmlUtility._showControlWhen(this.html.find(".div-sort-non-rituel"), !sort.system.isrituel); - HtmlUtility._showControlWhen(this.html.find(".div-sort-difficulte-var"), diffVariable); - HtmlUtility._showControlWhen(this.html.find(".div-sort-difficulte-fixe"), !diffVariable); - HtmlUtility._showControlWhen(this.html.find(".div-sort-ptreve-var"), coutVariable); - HtmlUtility._showControlWhen(this.html.find(".div-sort-ptreve-fixe"), !coutVariable); + HtmlUtility.showControlWhen(this.html.find(".div-sort-non-rituel"), !sort.system.isrituel); + HtmlUtility.showControlWhen(this.html.find(".div-sort-difficulte-var"), diffVariable); + HtmlUtility.showControlWhen(this.html.find(".div-sort-difficulte-fixe"), !diffVariable); + HtmlUtility.showControlWhen(this.html.find(".div-sort-ptreve-var"), coutVariable); + HtmlUtility.showControlWhen(this.html.find(".div-sort-ptreve-fixe"), !coutVariable); } async setSelectedSigneDraconique(signe) { @@ -311,11 +311,11 @@ export class RdDRoll extends Dialog { const resolutionTable = await RdDResolutionTable.buildHTMLTable(RdDResolutionTable.subTable(rollData.caracValue, rollData.finalLevel)) const adjustements = await this.buildAjustements(rollData); - HtmlUtility._showControlWhen(this.html.find(".use-encTotal"), rollData.ajustements.encTotal.visible && RdDCarac.isAgiliteOuDerivee(rollData.selectedCarac)); - HtmlUtility._showControlWhen(this.html.find(".use-surenc"), rollData.ajustements.surenc.visible && RdDCarac.isActionPhysique(rollData.selectedCarac)); - HtmlUtility._showControlWhen(this.html.find(".utilisation-moral"), rollData.use.appelAuMoral); - HtmlUtility._showControlWhen(this.html.find(".diffMoral"), rollData.ajustements.moralTotal.used); - HtmlUtility._showControlWhen(this.html.find(".divAppelAuMoral"), rollData.use.appelAuMoral); + HtmlUtility.showControlWhen(this.html.find(".use-encTotal"), rollData.ajustements.encTotal.visible && RdDCarac.isAgiliteOuDerivee(rollData.selectedCarac)); + HtmlUtility.showControlWhen(this.html.find(".use-surenc"), rollData.ajustements.surenc.visible && RdDCarac.isActionPhysique(rollData.selectedCarac)); + HtmlUtility.showControlWhen(this.html.find(".utilisation-moral"), rollData.use.appelAuMoral); + HtmlUtility.showControlWhen(this.html.find(".diffMoral"), rollData.ajustements.moralTotal.used); + HtmlUtility.showControlWhen(this.html.find(".divAppelAuMoral"), rollData.use.appelAuMoral); // Mise à jour valeurs this.html.find(".dialog-roll-title").text(this._getTitle(rollData)); diff --git a/module/rdd-tmr-dialog.js b/module/rdd-tmr-dialog.js index c6c9f5d9..51120319 100644 --- a/module/rdd-tmr-dialog.js +++ b/module/rdd-tmr-dialog.js @@ -208,8 +208,8 @@ export class RdDTMRDialog extends Dialog { return; } - HtmlUtility._showControlWhen(this.html.find(".appliquerFatigue"), ReglesOptionelles.isUsing("appliquer-fatigue")); - HtmlUtility._showControlWhen(this.html.find(".lire-signe-draconique"), this.actor.isResonanceSigneDraconique(this._getActorCoord())); + HtmlUtility.showControlWhen(this.html.find(".appliquerFatigue"), ReglesOptionelles.isUsing("appliquer-fatigue")); + HtmlUtility.showControlWhen(this.html.find(".lire-signe-draconique"), this.actor.isResonanceSigneDraconique(this._getActorCoord())); // Roll Sort this.html.find('.lancer-sort').click((event) => { @@ -246,7 +246,7 @@ export class RdDTMRDialog extends Dialog { } const coord = this._getActorCoord(); - HtmlUtility._showControlWhen(this.html.find(".lire-signe-draconique"), this.actor.isResonanceSigneDraconique(coord)); + HtmlUtility.showControlWhen(this.html.find(".lire-signe-draconique"), this.actor.isResonanceSigneDraconique(coord)); let ptsreve = document.getElementById("tmr-pointsreve-value"); ptsreve.innerHTML = this.actor.system.reve.reve.value; diff --git a/module/rdd-token-hud.js b/module/rdd-token-hud.js index f141caae..6d29ecab 100644 --- a/module/rdd-token-hud.js +++ b/module/rdd-token-hud.js @@ -111,6 +111,6 @@ export class RdDTokenHud { static _toggleHudListActive(hud, list) { hud.toggleClass('active'); - HtmlUtility._showControlWhen(list, hud.hasClass('active')); + HtmlUtility.showControlWhen(list, hud.hasClass('active')); } } \ No newline at end of file