From 9a76089edbae93c874b24c53a9b79f1fe10ebe2f Mon Sep 17 00:00:00 2001 From: tpart Date: Sat, 29 Jun 2024 22:08:39 +0200 Subject: Add Sound singleton; Restructure sound system; Add button sounds to ingame menu --- client/global.gd | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'client/global.gd') diff --git a/client/global.gd b/client/global.gd index 7c547d64..4d1139d2 100644 --- a/client/global.gd +++ b/client/global.gd @@ -156,6 +156,14 @@ func focus_first_button(node: Node) -> bool: return true return false +func connect_button_sounds(node: Node): + if node is Button: + node.pressed.connect(Sound.play_click) + if node is Button or node is LineEdit or node is Slider: + node.mouse_entered.connect(Sound.play_hover) + for c in node.get_children(): + connect_button_sounds(c) + func add_missing_keys(dict: Dictionary, reference: Dictionary): for k in reference.keys(): if !dict.has(k): -- cgit v1.2.3-70-g09d2