43 lines
1.4 KiB
GDScript
43 lines
1.4 KiB
GDScript
extends Panel
|
|
|
|
@export var thisTab = 1
|
|
|
|
func _ready() -> void:
|
|
$ScalingOption.select(GlobalVariables.scaling)
|
|
$ThemeOption.select(GlobalVariables.theme)
|
|
$MusicOption.select(GlobalVariables.title_music)
|
|
$DynamicOption.select(GlobalVariables.title_dynamic)
|
|
|
|
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()
|
|
|
|
func _on_music_option_item_selected(index: int) -> void:
|
|
GlobalVariables.title_music = index
|
|
if (index == 0): get_node("../../../Music").stop()
|
|
else: get_node("../../../Music").play()
|
|
GlobalVariables.updateConfig()
|
|
|
|
func _on_dynamic_option_item_selected(index: int) -> void:
|
|
GlobalVariables.title_dynamic = index
|
|
if (index == 0):
|
|
get_node("../../../BackgroundImage").visible = true
|
|
get_node("../../../DynamicBackground").visible = false
|
|
get_node("../../../DynamicBackground").playing = false
|
|
else:
|
|
get_node("../../../BackgroundImage").visible = false
|
|
get_node("../../../DynamicBackground").visible = true
|
|
get_node("../../../DynamicBackground").playing = true
|
|
GlobalVariables.updateConfig()
|