aboutsummaryrefslogtreecommitdiff
path: root/client/gui/overlays/lobby
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-09-18 22:38:12 +0200
committermetamuffin <metamuffin@disroot.org>2025-09-18 22:38:12 +0200
commit9c636b231b432976d9d7c3044f9e488f0f7cedf3 (patch)
tree80ae99b447ff8f9f1985fe2f23db5359b98c7be4 /client/gui/overlays/lobby
parente5a1cdfb593ef6f6d5df6ae1bc22514aaed555da (diff)
downloadhurrycurry-9c636b231b432976d9d7c3044f9e488f0f7cedf3.tar
hurrycurry-9c636b231b432976d9d7c3044f9e488f0f7cedf3.tar.bz2
hurrycurry-9c636b231b432976d9d7c3044f9e488f0f7cedf3.tar.zst
Fix bug showing lobby in game; Fix race condition/UB in scene transition
Diffstat (limited to 'client/gui/overlays/lobby')
-rw-r--r--client/gui/overlays/lobby/lobby.gd13
1 files changed, 5 insertions, 8 deletions
diff --git a/client/gui/overlays/lobby/lobby.gd b/client/gui/overlays/lobby/lobby.gd
index 8c372c70..2b40cada 100644
--- a/client/gui/overlays/lobby/lobby.gd
+++ b/client/gui/overlays/lobby/lobby.gd
@@ -48,8 +48,9 @@ func _ready():
game.update_players.connect(update_players)
initialize()
game.data_updated.connect(initialize)
- game.join_state_updated.connect(_on_game_join_state_updated)
- _on_game_join_state_updated(game.join_state)
+ game.join_state_updated.connect(_update_visible)
+ game.in_lobby_updated.connect(_update_visible)
+ _update_visible(false)
check_for_music()
func initialize():
@@ -165,12 +166,8 @@ func _on_start_pressed():
game.mp.send_chat(game.my_player_id, start_msg)
Sound.play_music("stop") # TODO: Game music enter
-func _on_game_join_state_updated(state: Game.JoinState):
- match state:
- Game.JoinState.JOINED:
- visible = true
- Game.JoinState.SPECTATING:
- visible = false
+func _update_visible(_state: bool):
+ visible = game.in_lobby and game.join_state == Game.JoinState.JOINED
func check_for_music():
if visible: