filtrage des chat events selon gm ou user

This commit is contained in:
rwanoux
2024-04-28 23:30:02 +02:00
parent ac1116424e
commit 067771d8b9
2 changed files with 52 additions and 40 deletions
+7 -3
View File
@@ -30,12 +30,16 @@ export const registerHooks = function () {
});
await initUserDice(dice3d);
game.users.forEach(user => initUserDice(dice3d, user));
});
Hooks.on('renderChatMessage', async (message, html, data) => {
if (message.user._id != game.user._id) { return }
if (message.user._id != game.user._id || !game.user.isGM) {
html[0].querySelectorAll("input").forEach(inp => inp.disabled = true);
html[0].querySelectorAll("div.reroll-from-effort").forEach(el => el.style.display = "none")
return
}
await VermineUtils.chatListenners(html)
})
@@ -115,7 +119,7 @@ export const registerHooks = function () {
Hooks.on("createCombatant", function (combatant) {
if (game.user.isGM) {
let actor = combatant.actor;
console.log('create combatant', actor);
}
});*/