Add tabbing

This commit is contained in:
2026-06-11 20:51:52 -05:00
parent f46f08c083
commit 0b3ea48cb8
2 changed files with 22 additions and 0 deletions
+10
View File
@@ -17,6 +17,16 @@ func _notification(what:int) -> void:
if what == NOTIFICATION_VISIBILITY_CHANGED and visible:
tabs.grab_focus()
func _input(event:InputEvent) -> void:
if !is_visible_in_tree():
return
if event.is_action_pressed("tab_next"):
tabs.current_tab = (tabs.current_tab + 1) % tabs.tab_count
get_viewport().set_input_as_handled()
elif event.is_action_pressed("tab_prev"):
tabs.current_tab = (tabs.current_tab - 1 + tabs.tab_count) % tabs.tab_count
get_viewport().set_input_as_handled()
func onTabChanged(tabIndex:int) -> void:
for control in tabControls:
control.visible = false