mirror of
https://github.com/lightsoutgames/godot-accessibility.git
synced 2024-12-22 07:35:56 +00:00
Apparently these _s aren't needed.
This commit is contained in:
parent
035a0699e1
commit
e42b054e86
|
@ -3,12 +3,12 @@ extends EditorPlugin
|
|||
|
||||
var Accessible = preload("accessible.gd")
|
||||
|
||||
func _augment_node(node):
|
||||
func augment_node(node):
|
||||
if node is Control:
|
||||
node.set_focus_mode(Control.FOCUS_ALL)
|
||||
Accessible.new(node)
|
||||
|
||||
func _set_initial_screen_focus(screen):
|
||||
func set_initial_screen_focus(screen):
|
||||
print("Screen ",screen)
|
||||
var focus
|
||||
var root = self
|
||||
|
@ -20,13 +20,13 @@ func _set_initial_screen_focus(screen):
|
|||
focus.grab_click_focus()
|
||||
focus.grab_focus()
|
||||
|
||||
func _set_initial_scene_focus(scene):
|
||||
func set_initial_scene_focus(scene):
|
||||
print("Set focus in scene")
|
||||
|
||||
func _enter_tree():
|
||||
get_tree().connect("node_added", self, "_augment_node")
|
||||
connect("scene_changed", self, "_set_initial_scene_focus")
|
||||
connect("main_screen_changed", self, "_set_initial_screen_focus")
|
||||
get_tree().connect("node_added", self, "augment_node")
|
||||
connect("scene_changed", self, "set_initial_scene_focus")
|
||||
connect("main_screen_changed", self, "set_initial_screen_focus")
|
||||
|
||||
func _exit_tree():
|
||||
# Clean-up of the plugin goes here
|
||||
|
|
|
@ -2,21 +2,21 @@ extends Object
|
|||
|
||||
var node
|
||||
|
||||
func _focused():
|
||||
func focused():
|
||||
print("Focus entered.")
|
||||
|
||||
func _unfocused():
|
||||
func unfocused():
|
||||
print("Unfocused")
|
||||
|
||||
func _gui_input():
|
||||
func gui_input():
|
||||
print("GUI input.")
|
||||
|
||||
func _init(node):
|
||||
# print(node.get_path())
|
||||
self.node = node
|
||||
self.node.connect("focus_entered", self, "_focused")
|
||||
self.node.connect("mouse_entered", self, "_focused")
|
||||
self.node.connect("focus_exited", self, "_unfocused")
|
||||
self.node.connect("mouse_exited", self, "_unfocused")
|
||||
self.node.connect("gui_input", self, "_gui_input")
|
||||
self.node.connect("focus_entered", self, "focused")
|
||||
self.node.connect("mouse_entered", self, "focused")
|
||||
self.node.connect("focus_exited", self, "unfocused")
|
||||
self.node.connect("mouse_exited", self, "unfocused")
|
||||
self.node.connect("gui_input", self, "gui_input")
|
||||
self.node.connect("tree_exiting", self, "free")
|
||||
|
|
Loading…
Reference in New Issue
Block a user