diff options
author | tpart <tpart120@proton.me> | 2024-10-04 11:51:21 +0200 |
---|---|---|
committer | tpart <tpart120@proton.me> | 2024-10-04 11:51:21 +0200 |
commit | 3a08497471c9dbae7277373a967b06c65f940904 (patch) | |
tree | 0795f85ac3b561ea19b7a2e0eeb2019ad70994d0 /client/menu | |
parent | 0f7133a6be99fba03e26fcc26172e06f10aa4f2a (diff) | |
download | hurrycurry-3a08497471c9dbae7277373a967b06c65f940904.tar hurrycurry-3a08497471c9dbae7277373a967b06c65f940904.tar.bz2 hurrycurry-3a08497471c9dbae7277373a967b06c65f940904.tar.zst |
Disable accept button in score display for a few seconds to prevent accidental button press (Fixes #206)
Diffstat (limited to 'client/menu')
-rw-r--r-- | client/menu/rating/rating.gd | 5 | ||||
-rw-r--r-- | client/menu/rating/rating.tscn | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/client/menu/rating/rating.gd b/client/menu/rating/rating.gd index ed3acf12..ced72191 100644 --- a/client/menu/rating/rating.gd +++ b/client/menu/rating/rating.gd @@ -23,10 +23,12 @@ const PARTICLE_AMOUNTS = [1, 6, 32, 128] @onready var stars = $MarginContainer/PanelContainer/VBoxContainer/Stars.get_children() @onready var star_timer = $StarTimer @onready var particles = $Control/Particles +@onready var close_button: Button = $MarginContainer/PanelContainer/VBoxContainer/HBoxContainer/Close func _ready(): super() show_rating(data[0], data[1]) + close_button.disabled = true # Disable for short time period to prevent accidental button press func _process(_delta): particles.emission_rect_extents = get_viewport_rect().size * Vector2(0.5, 0.5) @@ -54,3 +56,6 @@ func show_rating(stars_: int, points: int): func _on_close_pressed(): exit() + +func _on_button_timer_timeout() -> void: + close_button.disabled = false diff --git a/client/menu/rating/rating.tscn b/client/menu/rating/rating.tscn index 780cf261..4b4b7a5f 100644 --- a/client/menu/rating/rating.tscn +++ b/client/menu/rating/rating.tscn @@ -126,6 +126,10 @@ text = "c.menu.accept" wait_time = 0.5 one_shot = true +[node name="ButtonTimer" type="Timer" parent="."] +one_shot = true +autostart = true + [node name="Control" type="Control" parent="."] layout_mode = 1 anchors_preset = 8 @@ -155,3 +159,4 @@ scale_amount_curve = SubResource("Curve_dqga7") color_ramp = SubResource("Gradient_majwe") [connection signal="pressed" from="MarginContainer/PanelContainer/VBoxContainer/HBoxContainer/Close" to="." method="_on_close_pressed"] +[connection signal="timeout" from="ButtonTimer" to="." method="_on_button_timer_timeout"] |