diff options
author | BigBrotherNii <nicochr1004@gmail.com> | 2024-07-24 14:39:32 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-07-25 11:23:26 +0200 |
commit | b110ea6054f11d3f88ca454bb82f74a1420c84ca (patch) | |
tree | 0fa50837818b738ce73b191fbd0e760e67ee8b83 /client | |
parent | e108944ffab8f69308f78a87c9c9310dff410d6e (diff) | |
download | hurrycurry-b110ea6054f11d3f88ca454bb82f74a1420c84ca.tar hurrycurry-b110ea6054f11d3f88ca454bb82f74a1420c84ca.tar.bz2 hurrycurry-b110ea6054f11d3f88ca454bb82f74a1420c84ca.tar.zst |
stop music when entering lobby
Diffstat (limited to 'client')
-rw-r--r-- | client/audio/sound.gd | 5 | ||||
-rw-r--r-- | client/menu/lobby.gd | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/client/audio/sound.gd b/client/audio/sound.gd index 99bf692f..13fde6a2 100644 --- a/client/audio/sound.gd +++ b/client/audio/sound.gd @@ -25,11 +25,12 @@ extends Node var item_sounds: Dictionary = {} var item_id: int = 0 -func play_music(music : String): +func play_music(music : String): # If music == "stop", this stops all music for stream in music_node.get_children(): stream.stop() - music_node.get_node(music).play() + if music != "stop": + music_node.get_node(music).play() func set_volume(value:float): AudioServer.set_bus_volume_db(0, value) diff --git a/client/menu/lobby.gd b/client/menu/lobby.gd index 89f73473..5b4616cf 100644 --- a/client/menu/lobby.gd +++ b/client/menu/lobby.gd @@ -43,6 +43,7 @@ func _ready(): game.data_updated.connect(initialize) game.joined.connect(_on_game_joined) game.left.connect(_on_game_left) + Sound.play_music("stop") # TODO: Input Lobby music func initialize(): map_count = game.maps.size() |