aboutsummaryrefslogtreecommitdiff
path: root/client/menu
diff options
context:
space:
mode:
Diffstat (limited to 'client/menu')
-rw-r--r--client/menu/lobby.gd9
-rw-r--r--client/menu/lobby.tscn1
2 files changed, 9 insertions, 1 deletions
diff --git a/client/menu/lobby.gd b/client/menu/lobby.gd
index 5b4616cf..9991fbbf 100644
--- a/client/menu/lobby.gd
+++ b/client/menu/lobby.gd
@@ -43,7 +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
+ check_for_music()
func initialize():
map_count = game.maps.size()
@@ -97,6 +97,7 @@ func _on_right_pressed():
func _on_controller_button_pressed():
if selected_map_name != null:
game.mp.send_chat("/start %s" % selected_map_name)
+ Sound.play_music("stop") # TODO: Game music enter
func _on_join_spectate_pressed():
if game.is_joined:
@@ -105,3 +106,9 @@ func _on_join_spectate_pressed():
elif not game.join_sent:
game.join()
join_spectate.text = tr("Spectate")
+
+func check_for_music():
+ if visible:
+ Sound.play_music("Lobby")
+ else:
+ Sound.play_music("stop") # TODO: Game music enter
diff --git a/client/menu/lobby.tscn b/client/menu/lobby.tscn
index e2da5094..d13498d6 100644
--- a/client/menu/lobby.tscn
+++ b/client/menu/lobby.tscn
@@ -147,6 +147,7 @@ expand_icon = true
controller_texture = ExtResource("11_5uugf")
press_action = "join_spectate"
+[connection signal="visibility_changed" from="." to="." method="check_for_music"]
[connection signal="pressed" from="VBoxContainer/Bottom/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/Left" to="." method="_on_left_pressed"]
[connection signal="pressed" from="VBoxContainer/Bottom/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer2/Right" to="." method="_on_right_pressed"]
[connection signal="pressed" from="VBoxContainer/Bottom/MarginContainer/VBoxContainer/CenterContainer/Start" to="." method="_on_controller_button_pressed"]