1
0
forked from noxious/client

Removed GM tools, added event listener for shift + G to open GM panel

This commit is contained in:
2024-11-05 20:53:39 +01:00
parent afb0edacf6
commit d81c889426
3 changed files with 16 additions and 45 deletions

View File

@ -1,6 +1,5 @@
<template>
<Notifications />
<GmTools v-if="gameStore.character?.role === 'gm'" />
<GmPanel v-if="gameStore.character?.role === 'gm'" />
<component :is="currentScreen" />
</template>
@ -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()
}
})
</script>