From 1abb757b6bafd9032420de1a9c8f72d11ba012fe Mon Sep 17 00:00:00 2001 From: LeRatierBretonnien Date: Wed, 14 May 2025 22:32:52 +0200 Subject: [PATCH] Fix layaout --- module/item/sheet-faune.js | 2 +- module/item/sheet-signedraconique.js | 6 +++--- module/rdd-token-hud.js | 8 ++++---- module/rdd-utility.js | 2 +- module/settings/options-avancees.js | 3 +-- module/settings/regles-optionnelles.js | 7 +++---- module/settings/status-effects.js | 3 +-- module/settings/system-compendiums.js | 2 +- module/sommeil/dialog-chateau-dormant.js | 2 +- module/voyage/dialog-fatigue-voyage.js | 4 ++-- 10 files changed, 18 insertions(+), 21 deletions(-) diff --git a/module/item/sheet-faune.js b/module/item/sheet-faune.js index fc351b57..33eb8225 100644 --- a/module/item/sheet-faune.js +++ b/module/item/sheet-faune.js @@ -9,7 +9,7 @@ export class RdDFauneItemSheet extends RdDItemInventaireSheet { if (!this.options.editable) return; - html.find("a.linked-actor-delete").click(async event => await this.onDeleteLinkedActor()); + $(html).find("a.linked-actor-delete").click(async event => await this.onDeleteLinkedActor()); } async _onDropActor(event, dragData) { diff --git a/module/item/sheet-signedraconique.js b/module/item/sheet-signedraconique.js index 616ac781..2f9f0b58 100644 --- a/module/item/sheet-signedraconique.js +++ b/module/item/sheet-signedraconique.js @@ -36,9 +36,9 @@ export class RdDSigneDraconiqueItemSheet extends RdDItemSheetV1 { if (!this.options.editable) return; - html.find(".signe-aleatoire").click(async event => await this.setSigneAleatoire()); - html.find("input.select-tmr").change(async event => await this.onSelectTmr(event)); - html.find(".signe-xp-sort").change(async event => await this.onValeurXpSort(event.currentTarget.attributes['data-typereussite']?.value, Number(event.currentTarget.value))); + $(html).find(".signe-aleatoire").click(async event => await this.setSigneAleatoire()); + $(html).find("input.select-tmr").change(async event => await this.onSelectTmr(event)); + $(html).find(".signe-xp-sort").change(async event => await this.onValeurXpSort(event.currentTarget.attributes['data-typereussite']?.value, Number(event.currentTarget.value))); } async setSigneAleatoire() { diff --git a/module/rdd-token-hud.js b/module/rdd-token-hud.js index ee8369a4..b75a1ef7 100644 --- a/module/rdd-token-hud.js +++ b/module/rdd-token-hud.js @@ -14,8 +14,8 @@ export class RdDTokenHud { /* -------------------------------------------- */ static async removeExtensionHud(app, html, tokenId) { - html.find('.control-icon.rdd-combat').remove(); - html.find('.control-icon.rdd-initiative').remove(); + $(html).find('.control-icon.rdd-combat').remove(); + $(html).find('.control-icon.rdd-initiative').remove(); } /* -------------------------------------------- */ @@ -50,7 +50,7 @@ export class RdDTokenHud { { name: 'Initiative +1', command: 'inc', value: 0.01 }, { name: 'Initiative -1', command: 'dec', value: -0.01 }] }; - const controlIconCombat = html.find('.control-icon[data-action=combat]'); + const controlIconCombat = $(html).find('.control-icon[data-action=combat]'); await RdDTokenHud._configureSubMenu(controlIconCombat, 'systems/foundryvtt-reve-de-dragon/templates/hud-actor-init.hbs', hudData, @@ -69,7 +69,7 @@ export class RdDTokenHud { static async addExtensionHudCombat(html, combatant, token, actions) { const hudData = { combatant, token, actions, commandes: [] }; - const controlIconTarget = html.find('.control-icon[data-action=target]'); + const controlIconTarget = $(html).find('.control-icon[data-action=target]'); await RdDTokenHud._configureSubMenu(controlIconTarget, 'systems/foundryvtt-reve-de-dragon/templates/hud-actor-attaque.hbs', hudData, (event) => { const actionIndex = event.currentTarget.attributes['data-action-index']?.value; diff --git a/module/rdd-utility.js b/module/rdd-utility.js index cc7ede75..c0dd17e0 100644 --- a/module/rdd-utility.js +++ b/module/rdd-utility.js @@ -776,7 +776,7 @@ export class RdDUtility { } }); $(html).on("click", '.rdd-world-content-link', async event => { - const htmlElement = html.find(event.currentTarget); + const htmlElement = $(html).find(event.currentTarget); const id = htmlElement?.data("id"); const doctype = htmlElement?.data("doctype"); switch (doctype ?? 'Item') { diff --git a/module/settings/options-avancees.js b/module/settings/options-avancees.js index c09c745b..ec7e08a1 100644 --- a/module/settings/options-avancees.js +++ b/module/settings/options-avancees.js @@ -75,7 +75,7 @@ export class OptionsAvancees extends FormApplication { } activateListeners(html) { - html.find(".select-option").click((event) => { + $(html).find(".select-option").click((event) => { if (event.currentTarget.attributes.name) { let id = event.currentTarget.attributes.name.value let isChecked = event.currentTarget.checked @@ -88,4 +88,3 @@ export class OptionsAvancees extends FormApplication { this.close() } } - diff --git a/module/settings/regles-optionnelles.js b/module/settings/regles-optionnelles.js index 02c2cd60..ce759ca9 100644 --- a/module/settings/regles-optionnelles.js +++ b/module/settings/regles-optionnelles.js @@ -19,12 +19,12 @@ const listeReglesOptionnelles = [ { group: 'Règles de combat', name: 'categorieParade', descr: "Le défenseur doit obtenir une significative en cas de parade avec des armes de catégories différentes" }, { group: 'Règles de combat', name: 'tripleSignificative', descr: "En cas de demi-surprise, d'attaque particulière en finesse, et de catégories d'armes différentes, le défenseur doit obtenir 1/8 des chances de succès" }, { group: 'Règles de combat', name: 'validation-encaissement-gr', descr: "Le Gardien des Rêves doit valider les jets d'encaissement et peut les changer.", default: false }, - + { group: 'Automatisation', name: 'chateau-dormant-gardien', descr: "Saisie des heures de sommeil/jets de moral par le gardien des rêves", default: true }, { group: 'Affichage', name: 'afficher-colonnes-reussite', descr: "Afficher le nombre de colonnes de réussite ou d'échec", default: false }, { group: 'Affichage', name: 'afficher-prix-joueurs', descr: "Afficher le prix de l'équipement des joueurs", uniquementJoueur: true}, - + { group: 'Confirmations', name: 'confirmer-combat-sans-cible', descr: "Confirmer avant une attaque sans cible", scope: "client"}, { group: 'Confirmations', name: 'confirmation-tmr', descr: "Confirmer pour monter dans les TMR", scope: "client"}, { group: 'Confirmations', name: 'confirmation-tmr-rencontre', descr: "Confirmer pour monter dans les TMR avec rencontre en attente", scope: "client"}, @@ -112,7 +112,7 @@ export class ReglesOptionnelles extends FormApplication { } activateListeners(html) { - html.find(".select-option").click((event) => { + $(html).find(".select-option").click((event) => { if (event.currentTarget.attributes.name) { let id = event.currentTarget.attributes.name.value; let isChecked = event.currentTarget.checked; @@ -125,4 +125,3 @@ export class ReglesOptionnelles extends FormApplication { this.close(); } } - diff --git a/module/settings/status-effects.js b/module/settings/status-effects.js index 3a22d2b3..76346dae 100644 --- a/module/settings/status-effects.js +++ b/module/settings/status-effects.js @@ -131,7 +131,7 @@ export class StatusEffects extends FormApplication { } activateListeners(html) { - html.find(".select-effect").click((event) => { + $(html).find(".select-effect").click((event) => { let id = event.currentTarget.attributes.name?.value; if (id) { let selected = StatusEffects._getUseStatusEffects(); @@ -151,4 +151,3 @@ export class StatusEffects extends FormApplication { this.close(); } } - diff --git a/module/settings/system-compendiums.js b/module/settings/system-compendiums.js index c1524a20..fe782aaf 100644 --- a/module/settings/system-compendiums.js +++ b/module/settings/system-compendiums.js @@ -184,7 +184,7 @@ export class SystemCompendiums extends FormApplication { } activateListeners(html) { - html.find("select.system-compendium-setting").change((event) => { + $(html).find("select.system-compendium-setting").change((event) => { const compendium = $(event.currentTarget).data('compendium') const value = $(event.currentTarget).val(); const systemCompendium = CONFIGURABLE_COMPENDIUMS[compendium]; diff --git a/module/sommeil/dialog-chateau-dormant.js b/module/sommeil/dialog-chateau-dormant.js index 0a928e29..0908cdbf 100644 --- a/module/sommeil/dialog-chateau-dormant.js +++ b/module/sommeil/dialog-chateau-dormant.js @@ -36,7 +36,7 @@ export class DialogChateauDormant extends Dialog { activateListeners(html) { super.activateListeners(html); - this.html = html; + this.html = $(html); this.html.find('input.sommeil-insomnie').change(event => this.onInsomnie(event)); this._activateListenerOnActorMoral(this.html); } diff --git a/module/voyage/dialog-fatigue-voyage.js b/module/voyage/dialog-fatigue-voyage.js index a0e08bb6..18c96e41 100644 --- a/module/voyage/dialog-fatigue-voyage.js +++ b/module/voyage/dialog-fatigue-voyage.js @@ -106,9 +106,9 @@ export class DialogFatigueVoyage extends Dialog { activateListeners(html) { if (this.html == undefined) { - html.find('select[name="code-terrain"]').trigger("focus") + $(html).find('select[name="code-terrain"]').trigger("focus") } - this.html = html; + this.html = $(html); super.activateListeners(html); this.html.find('select[name="code-terrain"]').change(event => this.changeParameters())