1
0
forked from noxious/client

Added connect sound

This commit is contained in:
2025-02-06 21:08:55 +01:00
parent c09e9ea841
commit 557b8aaabb
3 changed files with 8 additions and 2 deletions

View File

@ -20,9 +20,12 @@ import { useMapEditorComposable } from '@/composables/useMapEditorComposable'
import { useGameStore } from '@/stores/gameStore'
import { useMapEditorStore } from '@/stores/mapEditorStore'
import { computed, ref, useTemplateRef, watch } from 'vue'
import { useGameComposable } from '@/composables/useGameComposable'
const gameStore = useGameStore()
const mapEditor = useMapEditorComposable()
const { playSound } = useGameComposable()
const currentScreen = computed(() => {
if (!gameStore.game.isLoaded) return Loading
@ -45,8 +48,7 @@ watch(
// @TODO: Not all button-like elements will actually be a button, so we need to find a better way to do this
addEventListener('click', (event) => {
if (!(event.target instanceof HTMLButtonElement)) return
const audio = new Audio('/assets/sounds/button-click.wav')
audio.play()
playSound('/assets/sounds/button-click.wav')
})
// Watch for "G" key press and toggle the gm panel