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 @@ + +