aboutsummaryrefslogtreecommitdiff
path: root/client/global.gd
diff options
context:
space:
mode:
Diffstat (limited to 'client/global.gd')
-rw-r--r--client/global.gd10
1 files changed, 10 insertions, 0 deletions
diff --git a/client/global.gd b/client/global.gd
index be230890..6e12d0cf 100644
--- a/client/global.gd
+++ b/client/global.gd
@@ -69,3 +69,13 @@ func load_dict(path: String, default: Dictionary) -> Dictionary:
print("Loaded dict: ", res)
return res
+
+func focus_first_button(node: Node) -> bool:
+ 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