From 01a7f52ed7490a9a0c266f234c7b6dc9b617cfbd Mon Sep 17 00:00:00 2001 From: Dapoolp Date: Tue, 12 Aug 2025 04:15:48 +0200 Subject: [PATCH] Remove buttons from generic roll for non-gm --- module/documents/chatMessage.mjs | 10 +++++++--- templates/ui/chat/foundryRoll.hbs | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/module/documents/chatMessage.mjs b/module/documents/chatMessage.mjs index 2b10e251..398bfcbe 100644 --- a/module/documents/chatMessage.mjs +++ b/module/documents/chatMessage.mjs @@ -70,9 +70,13 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage { } } - if(!game.user.isGM && !this.isAuthor && !this.speakerActor?.isOwner) { - const buttons = html.querySelectorAll(".ability-card-footer > .ability-use-button"); - buttons.forEach(b => b.remove()); + if(!game.user.isGM) { + const applyButtons = html.querySelector(".apply-buttons"); + applyButtons.remove(); + if(!this.isAuthor && !this.speakerActor?.isOwner) { + const buttons = html.querySelectorAll(".ability-card-footer > .ability-use-button"); + buttons.forEach(b => b.remove()); + } } } diff --git a/templates/ui/chat/foundryRoll.hbs b/templates/ui/chat/foundryRoll.hbs index 478cc691..a3c55a9e 100644 --- a/templates/ui/chat/foundryRoll.hbs +++ b/templates/ui/chat/foundryRoll.hbs @@ -8,7 +8,7 @@

{{total}}

-
+
\ No newline at end of file