Files
Dawn-Godot/ui/settings/SettingsMenu.gd
T
2026-06-11 20:19:15 -05:00

19 lines
516 B
GDScript

class_name SettingsMenu extends Control
@export var tabs:TabBar
@export var tabControls:Array[Control]
func _ready() -> void:
tabs.tab_changed.connect(onTabChanged)
onTabChanged(tabs.current_tab)
func _notification(what:int) -> void:
if what == NOTIFICATION_VISIBILITY_CHANGED and visible:
tabs.grab_focus()
func onTabChanged(tabIndex:int) -> void:
for control in tabControls:
control.visible = false
if tabIndex >= 0 and tabIndex < tabControls.size():
tabControls[tabIndex].visible = true