diff options
author | nokoe <nokoe@mailbox.org> | 2024-06-26 16:39:50 +0200 |
---|---|---|
committer | nokoe <nokoe@mailbox.org> | 2024-06-26 16:39:50 +0200 |
commit | a8d17ba85a46169fa049c70e1a8f53ea97784c90 (patch) | |
tree | f84853b18396e510149b0704e7238c1c22b87e98 /client/global.gd | |
parent | 5654b69e4c7e0aafe258ad0ab73105722a389def (diff) | |
parent | 677b9c898b0fc3faac2aa505cce438a2b2189265 (diff) | |
download | hurrycurry-a8d17ba85a46169fa049c70e1a8f53ea97784c90.tar hurrycurry-a8d17ba85a46169fa049c70e1a8f53ea97784c90.tar.bz2 hurrycurry-a8d17ba85a46169fa049c70e1a8f53ea97784c90.tar.zst |
Merge branch 'master' of ssh://codeberg.org/metamuffin/undercooked
Diffstat (limited to 'client/global.gd')
-rw-r--r-- | client/global.gd | 10 |
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 |