forked from noxious/client
Added connect sound
This commit is contained in:
parent
c09e9ea841
commit
557b8aaabb
BIN
public/assets/sounds/connect.wav
Normal file
BIN
public/assets/sounds/connect.wav
Normal file
Binary file not shown.
@ -20,9 +20,12 @@ import { useMapEditorComposable } from '@/composables/useMapEditorComposable'
|
|||||||
import { useGameStore } from '@/stores/gameStore'
|
import { useGameStore } from '@/stores/gameStore'
|
||||||
import { useMapEditorStore } from '@/stores/mapEditorStore'
|
import { useMapEditorStore } from '@/stores/mapEditorStore'
|
||||||
import { computed, ref, useTemplateRef, watch } from 'vue'
|
import { computed, ref, useTemplateRef, watch } from 'vue'
|
||||||
|
import { useGameComposable } from '@/composables/useGameComposable'
|
||||||
|
|
||||||
const gameStore = useGameStore()
|
const gameStore = useGameStore()
|
||||||
|
|
||||||
const mapEditor = useMapEditorComposable()
|
const mapEditor = useMapEditorComposable()
|
||||||
|
const { playSound } = useGameComposable()
|
||||||
|
|
||||||
const currentScreen = computed(() => {
|
const currentScreen = computed(() => {
|
||||||
if (!gameStore.game.isLoaded) return Loading
|
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
|
// @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) => {
|
addEventListener('click', (event) => {
|
||||||
if (!(event.target instanceof HTMLButtonElement)) return
|
if (!(event.target instanceof HTMLButtonElement)) return
|
||||||
const audio = new Audio('/assets/sounds/button-click.wav')
|
playSound('/assets/sounds/button-click.wav')
|
||||||
audio.play()
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// Watch for "G" key press and toggle the gm panel
|
// Watch for "G" key press and toggle the gm panel
|
||||||
|
@ -29,8 +29,10 @@ import Menu from '@/components/game/gui/Menu.vue'
|
|||||||
import Map from '@/components/game/map/Map.vue'
|
import Map from '@/components/game/map/Map.vue'
|
||||||
import { useGameStore } from '@/stores/gameStore'
|
import { useGameStore } from '@/stores/gameStore'
|
||||||
import { Game, Scene } from 'phavuer'
|
import { Game, Scene } from 'phavuer'
|
||||||
|
import { useGameComposable } from '@/composables/useGameComposable'
|
||||||
|
|
||||||
const gameStore = useGameStore()
|
const gameStore = useGameStore()
|
||||||
|
const { playSound } = useGameComposable()
|
||||||
|
|
||||||
const gameConfig = {
|
const gameConfig = {
|
||||||
name: config.name,
|
name: config.name,
|
||||||
@ -57,6 +59,8 @@ const createGame = (game: Phaser.Game) => {
|
|||||||
})
|
})
|
||||||
gameStore.disconnectSocket()
|
gameStore.disconnectSocket()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
playSound('/assets/sounds/connect.wav')
|
||||||
}
|
}
|
||||||
|
|
||||||
function preloadScene(scene: Phaser.Scene) {
|
function preloadScene(scene: Phaser.Scene) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user