Renommage showControlWhen

Vu que la méthode est publique
This commit is contained in:
Vincent Vandemeulebrouck 2023-01-10 22:11:16 +01:00
parent f20788d6d9
commit 05e48b61ff
8 changed files with 20 additions and 20 deletions

View File

@ -111,7 +111,7 @@ export class RdDActorSheet extends RdDBaseActorSheet {
activateListeners(html) { activateListeners(html) {
super.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 // Everything below here is only needed if the sheet is editable
if (!this.options.editable) return; if (!this.options.editable) return;

View File

@ -98,7 +98,7 @@ export class DialogCreateSigneDraconique extends Dialog {
async setEphemere(ephemere) { async setEphemere(ephemere) {
this.dialogData.signe.system.ephemere = 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) { async onSelectActor(event) {

View File

@ -86,6 +86,6 @@ export class DialogItemVente extends Dialog {
setQuantiteIllimite(checked) { setQuantiteIllimite(checked) {
this.venteData.quantiteIllimite = checked; this.venteData.quantiteIllimite = checked;
this.html.find(".label-quantiteIllimite").text(this.venteData.quantiteIllimite ? "Illimités" : "disponibles"); 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)
} }
} }

View File

@ -1,5 +1,5 @@
export class HtmlUtility{ export class HtmlUtility{
static _showControlWhen(jQuerySelector, condition) { static showControlWhen(jQuerySelector, condition) {
if (condition) { if (condition) {
jQuerySelector.show(); jQuerySelector.show();
} }

View File

@ -156,8 +156,8 @@ export class RdDItemSheet extends ItemSheet {
super.activateListeners(html); super.activateListeners(html);
this.html = 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-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-magique"), this.item.isMagique());
// Everything below here is only needed if the sheet is editable // Everything below here is only needed if the sheet is editable
if (!this.options.editable) return; if (!this.options.editable) return;

View File

@ -276,11 +276,11 @@ export class RdDRoll extends Dialog {
const diffVariable = RdDItemSort.isDifficulteVariable(sort); const diffVariable = RdDItemSort.isDifficulteVariable(sort);
const coutVariable = RdDItemSort.isCoutVariable(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-non-rituel"), !sort.system.isrituel);
HtmlUtility._showControlWhen(this.html.find(".div-sort-difficulte-var"), diffVariable); 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-difficulte-fixe"), !diffVariable);
HtmlUtility._showControlWhen(this.html.find(".div-sort-ptreve-var"), coutVariable); 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-ptreve-fixe"), !coutVariable);
} }
async setSelectedSigneDraconique(signe) { async setSelectedSigneDraconique(signe) {
@ -311,11 +311,11 @@ export class RdDRoll extends Dialog {
const resolutionTable = await RdDResolutionTable.buildHTMLTable(RdDResolutionTable.subTable(rollData.caracValue, rollData.finalLevel)) const resolutionTable = await RdDResolutionTable.buildHTMLTable(RdDResolutionTable.subTable(rollData.caracValue, rollData.finalLevel))
const adjustements = await this.buildAjustements(rollData); 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-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(".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(".utilisation-moral"), rollData.use.appelAuMoral);
HtmlUtility._showControlWhen(this.html.find(".diffMoral"), rollData.ajustements.moralTotal.used); HtmlUtility.showControlWhen(this.html.find(".diffMoral"), rollData.ajustements.moralTotal.used);
HtmlUtility._showControlWhen(this.html.find(".divAppelAuMoral"), rollData.use.appelAuMoral); HtmlUtility.showControlWhen(this.html.find(".divAppelAuMoral"), rollData.use.appelAuMoral);
// Mise à jour valeurs // Mise à jour valeurs
this.html.find(".dialog-roll-title").text(this._getTitle(rollData)); this.html.find(".dialog-roll-title").text(this._getTitle(rollData));

View File

@ -208,8 +208,8 @@ export class RdDTMRDialog extends Dialog {
return; return;
} }
HtmlUtility._showControlWhen(this.html.find(".appliquerFatigue"), ReglesOptionelles.isUsing("appliquer-fatigue")); 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(".lire-signe-draconique"), this.actor.isResonanceSigneDraconique(this._getActorCoord()));
// Roll Sort // Roll Sort
this.html.find('.lancer-sort').click((event) => { this.html.find('.lancer-sort').click((event) => {
@ -246,7 +246,7 @@ export class RdDTMRDialog extends Dialog {
} }
const coord = this._getActorCoord(); 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"); let ptsreve = document.getElementById("tmr-pointsreve-value");
ptsreve.innerHTML = this.actor.system.reve.reve.value; ptsreve.innerHTML = this.actor.system.reve.reve.value;

View File

@ -111,6 +111,6 @@ export class RdDTokenHud {
static _toggleHudListActive(hud, list) { static _toggleHudListActive(hud, list) {
hud.toggleClass('active'); hud.toggleClass('active');
HtmlUtility._showControlWhen(list, hud.hasClass('active')); HtmlUtility.showControlWhen(list, hud.hasClass('active'));
} }
} }