From 5cd87fc5d570d584019a6d6dd8dc25b6e5f274a0 Mon Sep 17 00:00:00 2001 From: tpart Date: Sat, 28 Sep 2024 20:38:56 +0200 Subject: Refactor in_lobby code in popup message --- client/menu/communicate/popup_message/popup_message.gd | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'client/menu') diff --git a/client/menu/communicate/popup_message/popup_message.gd b/client/menu/communicate/popup_message/popup_message.gd index 7a4dce4b..98bd94e3 100644 --- a/client/menu/communicate/popup_message/popup_message.gd +++ b/client/menu/communicate/popup_message/popup_message.gd @@ -50,6 +50,11 @@ func _ready(): else: update_state() ) + game.in_lobby_updated.connect( + func a(in_lobby): + is_ingame = not in_lobby + update_state() + ) func _process(_delta: float): for pos: Vector2 in positional_messages.keys(): @@ -66,14 +71,6 @@ func _process(_delta: float): msg.last_size = msg.node.size msg.node.position = -0.5 * msg.last_size -func ingame(): - is_ingame = true - update_state() - -func lobby(): - is_ingame = false - update_state() - func update_state(): if is_ingame and is_joined: start_game_hints() -- cgit v1.2.3-70-g09d2