From 7aef7f193dca90a5253944450196d2dd71fefed5 Mon Sep 17 00:00:00 2001 From: tpart Date: Mon, 15 Jul 2024 12:40:32 +0200 Subject: Add hint about joining game while it is running --- client/menu/popup_message.gd | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'client/menu/popup_message.gd') diff --git a/client/menu/popup_message.gd b/client/menu/popup_message.gd index 2d707289..82a16a9e 100644 --- a/client/menu/popup_message.gd +++ b/client/menu/popup_message.gd @@ -31,6 +31,7 @@ var is_joined := false @onready var auto_hint_timers: Node = $AutoHintTimers @onready var reset_timer = $Reset +@onready var join_while_running_timer = $JoinWhileRunning @onready var game: Game = $"../Game" @@ -57,6 +58,9 @@ func lobby(): func update_state(): if is_ingame and is_joined: start_game_hints() + elif is_ingame: + stop_game_hints() + join_while_running_timer.start() else: stop_game_hints() @@ -85,6 +89,7 @@ func stop_game_hints(): for c: Timer in auto_hint_timers.get_children(): c.stop() reset_timer.stop() + join_while_running_timer.stop() func _input(_event): if Input.is_action_just_pressed("boost"): @@ -144,3 +149,8 @@ func _on_nametags_timeout(): if not Global.get_hint("has_seen_nametags") and not Global.get_setting("usernames"): Global.set_hint("has_seen_nametags", true) display_hint_msg(tr("Username tags can be enabled/disabled in the settings")) + +func _on_join_while_running_timeout(): + if not game.is_joined and not Global.get_hint("has_seen_join_while_running"): + Global.set_hint("has_seen_join_while_running", true) + display_hint_msg(tr("Press %s and click \"Join\" to join the game while it is running") % display_keybind(tr("ESCAPE"), tr("Menu button"))) -- cgit v1.2.3-70-g09d2