forked from team-sg/hero-mark-2
15 lines
445 B
GDScript
15 lines
445 B
GDScript
extends HBoxContainer
|
|
|
|
export (ButtonGroup) var group
|
|
|
|
func _ready():
|
|
focus_mode = FOCUS_ALL
|
|
for child in get_children():
|
|
if child is BaseButton:
|
|
child.focus_neighbour_top = "../%s" % focus_neighbour_top
|
|
child.focus_neighbour_bottom = "../%s" % focus_neighbour_bottom
|
|
child.connect("focus_entered", child, "set_pressed", [true])
|
|
connect("focus_entered", self, "_focused")
|
|
|
|
func _focused():
|
|
group.get_pressed_button().grab_focus()
|