essai de fix du bug des hooks sur messages, suppression des tours

This commit is contained in:
rwanoux
2024-11-22 18:17:10 +01:00
parent 3a53644213
commit 299fbcd50d
+4 -3
View File
@@ -11,7 +11,6 @@ export const registerHooks = function () {
Hooks.once('diceSoNiceReady', async (dice3d) => { Hooks.once('diceSoNiceReady', async (dice3d) => {
dice3d.addSystem({ id: "Vermine2047", name: "Vermine 2047" }, "preferred"); dice3d.addSystem({ id: "Vermine2047", name: "Vermine 2047" }, "preferred");
game.users.forEach(user => { game.users.forEach(user => {
initUserDice(dice3d, user) initUserDice(dice3d, user)
}); });
@@ -42,8 +41,10 @@ export const registerHooks = function () {
if (rerollTitle) { if (rerollTitle) {
rerollTitle.addEventListener("click", () => { html[0].querySelector(".reroll").classList.toggle('visible') }) 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); 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") html[0].querySelectorAll("div.reroll-from-effort").forEach(el => el.style.display = "none")
return return
} }
@@ -59,7 +60,7 @@ export const registerHooks = function () {
}) })
Hooks.once("ready", async () => { Hooks.once("ready", async () => {
console.info("Vermine 2047 | System Initialized."); console.info("Vermine 2047 | System Initialized.");
await registerTours(); //await registerTours();
}); });