aboutsummaryrefslogtreecommitdiff
path: root/client/menu
diff options
context:
space:
mode:
authortpart <tpart120@proton.me>2025-09-01 21:45:59 +0200
committertpart <tpart120@proton.me>2025-09-01 21:45:59 +0200
commit51ea2ec90d8bc286f0025f0d91e1c5fac461e867 (patch)
tree3aaf942ec3139499255ed94e42f4e65e454ccc5b /client/menu
parent4884c13260b226a79c199176ae230edf03c6b746 (diff)
downloadhurrycurry-51ea2ec90d8bc286f0025f0d91e1c5fac461e867.tar
hurrycurry-51ea2ec90d8bc286f0025f0d91e1c5fac461e867.tar.bz2
hurrycurry-51ea2ec90d8bc286f0025f0d91e1c5fac461e867.tar.zst
Fix error messages related to signals
Diffstat (limited to 'client/menu')
-rw-r--r--client/menu/menu.gd3
-rw-r--r--client/menu/ui_elements/server_list_item.gd4
-rw-r--r--client/menu/ui_elements/server_list_item.tscn2
3 files changed, 7 insertions, 2 deletions
diff --git a/client/menu/menu.gd b/client/menu/menu.gd
index b928118b..7af27148 100644
--- a/client/menu/menu.gd
+++ b/client/menu/menu.gd
@@ -123,7 +123,8 @@ func connect_button_sounds(node: Node):
if not node.is_in_group("no_click_sound"):
node.pressed.connect(Sound.play_click)
if (node is Button and not node.disabled) or (node is LineEdit and node.editable) or node is Slider:
- node.mouse_entered.connect(Sound.play_hover)
+ if not node.is_in_group("no_click_sound"):
+ node.mouse_entered.connect(Sound.play_hover)
for c in node.get_children():
connect_button_sounds(c)
diff --git a/client/menu/ui_elements/server_list_item.gd b/client/menu/ui_elements/server_list_item.gd
index 4b5121db..18b94b12 100644
--- a/client/menu/ui_elements/server_list_item.gd
+++ b/client/menu/ui_elements/server_list_item.gd
@@ -30,5 +30,9 @@ func setup(name_: String, online_players: int, version: Array):
info.add_theme_color_override("font_color", Color("ff2222"))
return
info.text = tr("c.menu.play.server_players").format([online_players])
+
+ # This node is in group not no_click_sound, so sounds won't be automatically connected
+ # by menu system. Reason: These nodes are deleted and re-created every few seconds
+ # in server list, and signals are only connected on ready.
button.pressed.connect(Sound.play_click)
button.mouse_entered.connect(Sound.play_hover)
diff --git a/client/menu/ui_elements/server_list_item.tscn b/client/menu/ui_elements/server_list_item.tscn
index 4a551ae1..8b0eaf13 100644
--- a/client/menu/ui_elements/server_list_item.tscn
+++ b/client/menu/ui_elements/server_list_item.tscn
@@ -11,7 +11,7 @@ size_flags_horizontal = 3
theme_override_styles/panel = SubResource("StyleBoxEmpty_1n1yg")
script = ExtResource("1_1n1yg")
-[node name="Button" type="Button" parent="."]
+[node name="Button" type="Button" parent="." groups=["no_click_sound"]]
layout_mode = 2
[node name="MarginContainer" type="MarginContainer" parent="."]