From 014885d0fa2aeb8763af951d7ba764f7ac924683 Mon Sep 17 00:00:00 2001 From: Byroks Date: Tue, 5 Dec 2023 20:19:17 +0100 Subject: [PATCH] Fix falsy display of rightclick context menu --- source/index.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/index.ts b/source/index.ts index 06b81b3..cd856ed 100644 --- a/source/index.ts +++ b/source/index.ts @@ -116,10 +116,11 @@ Hooks.on("getChatLogEntryContext", function (html, options) { condition: (li) => { // Only show this context menu if there are re-rollable dice in the message const damageRolls = li.find(".apply-damage").length; + console.log(game["user"].isGm); // All must be true to show the reroll dialogue // The button doesn't work for the GM right now, so we don't need to show it - return !game["user"].isGm && damageRolls > 0; + return game["user"].character && damageRolls > 0; }, callback: (li) => applyDamage(li, 2), }, @@ -132,7 +133,7 @@ Hooks.on("getChatLogEntryContext", function (html, options) { // All must be true to show the reroll dialogue // The button doesn't work for the GM right now, so we don't need to show it - return !game["user"].isGm && damageRolls > 0; + return game["user"].character && damageRolls > 0; }, callback: (li) => applyDamage(li, 1), }, @@ -145,7 +146,7 @@ Hooks.on("getChatLogEntryContext", function (html, options) { // All must be true to show the reroll dialogue // The button doesn't work for the GM right now, so we don't need to show it - return !game["user"].isGm && damageRolls > 0; + return game["user"].character && damageRolls > 0; }, callback: (li) => applyDamage(li, -1), }, @@ -158,7 +159,7 @@ Hooks.on("getChatLogEntryContext", function (html, options) { // All must be true to show the reroll dialogue // The button doesn't work for the GM right now, so we don't need to show it - return !game["user"].isGm && damageRolls > 0; + return game["user"].character && damageRolls > 0; }, callback: (li) => applyDamage(li, -2), }