Add tabbing
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user