PneumaticPlaything/Scripts/InterfaceOptions.gd
2025-08-13 00:21:27 -07:00

23 lines
664 B
GDScript

extends Panel
@export var thisTab = 1
func _ready() -> void:
$ScalingOption.select(Globalvariables.scaling)
$ThemeOption.select(Globalvariables.theme)
func _on_tab_bar_tab_changed(tab: int) -> void:
if (thisTab == tab):
visible = true
else:
visible = false
func _on_scaling_option_item_selected(index: int) -> void:
Globalvariables.scaling = index
get_window().content_scale_mode = index as Window.ContentScaleMode
Globalvariables.updateConfig()
func _on_theme_option_item_selected(index: int) -> void:
Globalvariables.theme = index
get_window().set_theme(load(Globalvariables.theme_index[Globalvariables.theme]))
Globalvariables.updateConfig()