summaryrefslogtreecommitdiff
path: root/client/global.gd
diff options
context:
space:
mode:
Diffstat (limited to 'client/global.gd')
-rw-r--r--client/global.gd27
1 files changed, 3 insertions, 24 deletions
diff --git a/client/global.gd b/client/global.gd
index 681faa0e..fdb4df28 100644
--- a/client/global.gd
+++ b/client/global.gd
@@ -54,16 +54,15 @@ var settings: Dictionary
var server_url = ""
var error_message = ""
-var focus_auto_changed := false
-
-var fade_next := false # Set true when transitioning from another scene (fade in requried)
-
func _init():
profile = load_dict("user://profile", default_profile)
load_settings("user://settings")
update_fullscreen()
update_language()
+func _ready():
+ get_viewport().gui_focus_changed.connect(Sound.play_hover_maybe)
+
func _input(_event):
if Input.is_action_just_pressed("fullscreen"):
Global.set_setting("fullscreen", not Global.get_setting("fullscreen"))
@@ -133,26 +132,6 @@ func load_settings(path: String):
func on_vulkan() -> bool:
return ProjectSettings.get_setting("rendering/rendering_device/driver") == "vulkan"
-func focus_first_button(node: Node) -> bool:
- focus_auto_changed = true
-
- if node is Button:
- node.grab_focus()
- print("Node %s (%s) was selected for focus" % [node.name, node])
- return true
- for c in node.get_children():
- if focus_first_button(c):
- 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):