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), }