diff options
Diffstat (limited to 'client/global.gd')
| -rw-r--r-- | client/global.gd | 27 | 
1 files changed, 3 insertions, 24 deletions
| diff --git a/client/global.gd b/client/global.gd index e756fcfe..ca0a9603 100644 --- a/client/global.gd +++ b/client/global.gd @@ -129,16 +129,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)  	settings = load_dict("user://settings", default_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")) @@ -187,26 +186,6 @@ func load_dict(path: String, default: Dictionary) -> Dictionary:  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): | 
