diff options
| author | tpart <tpart120@proton.me> | 2024-07-15 12:40:32 +0200 | 
|---|---|---|
| committer | tpart <tpart120@proton.me> | 2024-07-15 12:40:32 +0200 | 
| commit | 7aef7f193dca90a5253944450196d2dd71fefed5 (patch) | |
| tree | 7f8b2ffb9917f7fe3308408bc30b2adfb46b8a43 /client | |
| parent | 64732f9ddb16c5d9ad01eb8de61b96e7b8974877 (diff) | |
| download | hurrycurry-7aef7f193dca90a5253944450196d2dd71fefed5.tar hurrycurry-7aef7f193dca90a5253944450196d2dd71fefed5.tar.bz2 hurrycurry-7aef7f193dca90a5253944450196d2dd71fefed5.tar.zst | |
Add hint about joining game while it is running
Diffstat (limited to 'client')
| -rw-r--r-- | client/global.gd | 3 | ||||
| -rw-r--r-- | client/menu/popup_message.gd | 10 | ||||
| -rw-r--r-- | client/menu/popup_message.tscn | 5 | 
3 files changed, 17 insertions, 1 deletions
| diff --git a/client/global.gd b/client/global.gd index b4d5a535..e3fe9000 100644 --- a/client/global.gd +++ b/client/global.gd @@ -32,7 +32,8 @@ var default_profile := {  		"has_interacted": false,  		"has_rotated": false,  		"has_reset": false, -		"has_zoomed": false +		"has_zoomed": false, +		"has_seen_join_while_running": false  	}  }  var languages := [tr("System default"), "en", "de"] 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"))) diff --git a/client/menu/popup_message.tscn b/client/menu/popup_message.tscn index b83d15a0..8a91f7c8 100644 --- a/client/menu/popup_message.tscn +++ b/client/menu/popup_message.tscn @@ -138,6 +138,10 @@ one_shot = true  wait_time = 10.0  one_shot = true +[node name="JoinWhileRunning" type="Timer" parent="."] +wait_time = 5.0 +one_shot = true +  [connection signal="timeout" from="ServerTimer" to="." method="_on_server_timer_timeout"]  [connection signal="timeout" from="HintTimer" to="." method="_on_hint_timer_timeout"]  [connection signal="timeout" from="AutoHintTimers/Move" to="." method="_on_move_timeout"] @@ -147,3 +151,4 @@ one_shot = true  [connection signal="timeout" from="AutoHintTimers/Zoom" to="." method="_on_zoom_timeout"]  [connection signal="timeout" from="AutoHintTimers/Nametags" to="." method="_on_nametags_timeout"]  [connection signal="timeout" from="Reset" to="." method="_on_reset_timeout"] +[connection signal="timeout" from="JoinWhileRunning" to="." method="_on_join_while_running_timeout"] | 
