diff options
author | tpart <tpart120@proton.me> | 2024-08-19 15:26:51 +0200 |
---|---|---|
committer | tpart <tpart120@proton.me> | 2024-08-19 15:26:56 +0200 |
commit | b8c4976a3a168b53e01ffcfde1b46888f5f8ae22 (patch) | |
tree | 97d33522e7c2a8817e1bc7648d7f778cf4b7b33c | |
parent | 0ce733f60b7c0eda126a33451ca34e5182e0ceda (diff) | |
download | hurrycurry-b8c4976a3a168b53e01ffcfde1b46888f5f8ae22.tar hurrycurry-b8c4976a3a168b53e01ffcfde1b46888f5f8ae22.tar.bz2 hurrycurry-b8c4976a3a168b53e01ffcfde1b46888f5f8ae22.tar.zst |
Add hint about performance
-rw-r--r-- | client/global.gd | 1 | ||||
-rw-r--r-- | client/menu/popup_message.gd | 5 | ||||
-rw-r--r-- | client/menu/popup_message.tscn | 5 |
3 files changed, 11 insertions, 0 deletions
diff --git a/client/global.gd b/client/global.gd index be83057f..085674ef 100644 --- a/client/global.gd +++ b/client/global.gd @@ -34,6 +34,7 @@ var default_profile := { "has_rotated": false, "has_reset": false, "has_zoomed": false, + "has_seen_performance": false, "has_seen_join_while_running": false } } diff --git a/client/menu/popup_message.gd b/client/menu/popup_message.gd index 9293847b..86b0ee2b 100644 --- a/client/menu/popup_message.gd +++ b/client/menu/popup_message.gd @@ -155,3 +155,8 @@ 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"))) + +func _on_performance_timeout() -> void: + if not Global.get_hint("has_seen_performance") and Engine.get_frames_per_second() < DisplayServer.screen_get_refresh_rate() * 0.75: + Global.set_hint("has_seen_performance", true) + display_hint_msg(tr("Your framerate seems to be low. You can lower your graphics settings in the settings menu.")) diff --git a/client/menu/popup_message.tscn b/client/menu/popup_message.tscn index 765ee345..ebaff05e 100644 --- a/client/menu/popup_message.tscn +++ b/client/menu/popup_message.tscn @@ -122,6 +122,10 @@ one_shot = true wait_time = 2.0 one_shot = true +[node name="Performance" type="Timer" parent="AutoHintTimers"] +wait_time = 20.0 +one_shot = true + [node name="Boost" type="Timer" parent="AutoHintTimers"] wait_time = 90.0 one_shot = true @@ -153,6 +157,7 @@ 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"] +[connection signal="timeout" from="AutoHintTimers/Performance" to="." method="_on_performance_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="AutoHintTimers/RotateCamera" to="." method="_on_rotate_camera_timeout"] |