From d81c889426fcc7190a0160202416322ece044441 Mon Sep 17 00:00:00 2001 From: Dennis Postma Date: Tue, 5 Nov 2024 20:53:39 +0100 Subject: [PATCH] Removed GM tools, added event listener for shift + G to open GM panel --- src/App.vue | 13 +++++++- src/components/gameMaster/GmPanel.vue | 4 +++ src/components/gameMaster/GmTools.vue | 44 --------------------------- 3 files changed, 16 insertions(+), 45 deletions(-) delete mode 100644 src/components/gameMaster/GmTools.vue diff --git a/src/App.vue b/src/App.vue index db25e50..3179c4f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,6 +1,5 @@ @@ -44,4 +43,16 @@ addEventListener('click', (event) => { const audio = new Audio('/assets/music/click-btn.mp3') audio.play() }) + +// Watch for "G" key press and toggle the gm panel +addEventListener('keydown', (event) => { + if (gameStore.character?.role !== 'gm') return // Only allow toggling the gm panel if the character is a gm + + // Check if no input is active + if (event.repeat || event.isComposing || event.defaultPrevented) return + + if (event.key === 'G') { + gameStore.toggleGmPanel() + } +}) diff --git a/src/components/gameMaster/GmPanel.vue b/src/components/gameMaster/GmPanel.vue index d4ace4d..4f16ea4 100644 --- a/src/components/gameMaster/GmPanel.vue +++ b/src/components/gameMaster/GmPanel.vue @@ -6,6 +6,8 @@ + +