aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortpart <tpart120@proton.me>2024-07-12 01:27:29 +0200
committertpart <tpart120@proton.me>2024-07-12 01:27:29 +0200
commit0f0c7713218dc9fc8beafdbe14785c11a0f61ea8 (patch)
tree339a55302bf91690e9639bceeb1eb8caea18da51
parent78186bdcb2f15f8ad00cb83ccaeb5273f328d41c (diff)
downloadhurrycurry-0f0c7713218dc9fc8beafdbe14785c11a0f61ea8.tar
hurrycurry-0f0c7713218dc9fc8beafdbe14785c11a0f61ea8.tar.bz2
hurrycurry-0f0c7713218dc9fc8beafdbe14785c11a0f61ea8.tar.zst
Add reset camera hint
-rw-r--r--client/global.gd4
-rw-r--r--client/menu/popup_message.gd23
-rw-r--r--client/menu/popup_message.tscn19
3 files changed, 33 insertions, 13 deletions
diff --git a/client/global.gd b/client/global.gd
index 0311910f..4a985e38 100644
--- a/client/global.gd
+++ b/client/global.gd
@@ -28,7 +28,9 @@ var default_profile := {
# HINTS:
"has_moved": false,
"has_boosted": false,
- "has_interacted": false
+ "has_interacted": false,
+ "has_rotated": false,
+ "has_reset": false
}
var languages := [tr("System default"), "en", "de"]
var using_joypad := false
diff --git a/client/menu/popup_message.gd b/client/menu/popup_message.gd
index 2b682343..e70e1fef 100644
--- a/client/menu/popup_message.gd
+++ b/client/menu/popup_message.gd
@@ -25,7 +25,9 @@ class_name PopupMessage
@onready var server_msg_label: Label = $VBox/ServerMessage/CenterContainer/Label
@onready var hint_msg_label: Label = $VBox/HintMessage/CenterContainer/Label
-@onready var hint_timers: Node = $HintTimers
+@onready var auto_hint_timers: Node = $AutoHintTimers
+
+@onready var reset_timer = $Reset
func display_server_msg(msg: String):
server_msg.show()
@@ -44,21 +46,27 @@ func _on_hint_timer_timeout():
hint_msg.hide()
func start_game_hints():
- for c: Timer in hint_timers.get_children():
+ for c: Timer in auto_hint_timers.get_children():
c.start()
func stop_game_hints():
_on_hint_timer_timeout()
- for c: Timer in hint_timers.get_children():
+ for c: Timer in auto_hint_timers.get_children():
c.stop()
func _input(_event):
if Input.is_action_just_pressed("boost"):
Global.set_profile("has_boosted", true)
- elif any_action_just_pressed(["forward", "backwards", "left", "right"]):
+ if any_action_just_pressed(["forward", "backwards", "left", "right"]):
Global.set_profile("has_moved", true)
- elif Input.is_action_just_pressed("interact"):
+ if any_action_just_pressed(["rotate_left", "rotate_right", "rotate_up", "rotate_down"]):
+ if not Global.get_profile("has_reset"):
+ reset_timer.start()
+ Global.set_profile("has_rotated", true)
+ if Input.is_action_just_pressed("interact"):
Global.set_profile("has_interacted", true)
+ if Input.is_action_just_pressed("reset"):
+ Global.set_profile("has_reset", true)
func _on_boost_timeout():
if not Global.get_profile("has_boosted") and not Global.get_setting("touch_controls"):
@@ -72,6 +80,10 @@ func _on_interact_timeout():
if not Global.get_profile("has_interacted") and not Global.get_setting("touch_controls"):
display_hint_msg(tr("Press %s to pick up items and interact with tools") % display_keybind(tr("SPACE"), "A"))
+func _on_reset_timeout():
+ if not Global.get_profile("has_reset") and not Global.get_setting("touch_controls"):
+ display_hint_msg(tr("Press %s to reset the camera view") % display_keybind("R", "Y"))
+
func display_keybind(keyboard: String, joypad: String) -> String:
if Global.using_joypad:
return joypad + " (Joypad)"
@@ -82,3 +94,4 @@ func any_action_just_pressed(actions: Array) -> bool:
if Input.is_action_just_pressed(a):
return true
return false
+
diff --git a/client/menu/popup_message.tscn b/client/menu/popup_message.tscn
index 3eccfc2e..37133847 100644
--- a/client/menu/popup_message.tscn
+++ b/client/menu/popup_message.tscn
@@ -102,22 +102,27 @@ one_shot = true
wait_time = 10.0
one_shot = true
-[node name="HintTimers" type="Node" parent="."]
+[node name="AutoHintTimers" type="Node" parent="."]
-[node name="Move" type="Timer" parent="HintTimers"]
+[node name="Move" type="Timer" parent="AutoHintTimers"]
wait_time = 5.0
one_shot = true
-[node name="Boost" type="Timer" parent="HintTimers"]
+[node name="Boost" type="Timer" parent="AutoHintTimers"]
wait_time = 90.0
one_shot = true
-[node name="Interact" type="Timer" parent="HintTimers"]
+[node name="Interact" type="Timer" parent="AutoHintTimers"]
wait_time = 20.0
one_shot = true
+[node name="Reset" type="Timer" parent="."]
+wait_time = 10.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="HintTimers/Move" to="." method="_on_move_timeout"]
-[connection signal="timeout" from="HintTimers/Boost" to="." method="_on_boost_timeout"]
-[connection signal="timeout" from="HintTimers/Interact" to="." method="_on_interact_timeout"]
+[connection signal="timeout" from="AutoHintTimers/Move" to="." method="_on_move_timeout"]
+[connection signal="timeout" from="AutoHintTimers/Boost" to="." method="_on_boost_timeout"]
+[connection signal="timeout" from="AutoHintTimers/Interact" to="." method="_on_interact_timeout"]
+[connection signal="timeout" from="Reset" to="." method="_on_reset_timeout"]