From 299fbcd50d71294c3b20ef14f8eafbb5146d26b1 Mon Sep 17 00:00:00 2001 From: rwanoux Date: Fri, 22 Nov 2024 18:17:10 +0100 Subject: [PATCH] essai de fix du bug des hooks sur messages, suppression des tours --- module/system/hooks.mjs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/module/system/hooks.mjs b/module/system/hooks.mjs index 23df76c..40b7042 100644 --- a/module/system/hooks.mjs +++ b/module/system/hooks.mjs @@ -11,7 +11,6 @@ export const registerHooks = function () { Hooks.once('diceSoNiceReady', async (dice3d) => { dice3d.addSystem({ id: "Vermine2047", name: "Vermine 2047" }, "preferred"); - game.users.forEach(user => { initUserDice(dice3d, user) }); @@ -42,8 +41,10 @@ export const registerHooks = function () { if (rerollTitle) { rerollTitle.addEventListener("click", () => { html[0].querySelector(".reroll").classList.toggle('visible') }) } - if (message.author._id != game.user._id || !game.user.isGM) { + if (message.author?._id != game.user._id || !game.user.isGM) { + // désactiver les inputs pour les joueurs non-auteurs du message html[0].querySelectorAll("input").forEach(inp => inp.disabled = true); + //cacher le boutton reroll html[0].querySelectorAll("div.reroll-from-effort").forEach(el => el.style.display = "none") return } @@ -59,7 +60,7 @@ export const registerHooks = function () { }) Hooks.once("ready", async () => { console.info("Vermine 2047 | System Initialized."); - await registerTours(); + //await registerTours(); });