28 lines
1.5 KiB
GDScript
28 lines
1.5 KiB
GDScript
class_name Settings extends MarginContainer
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready() -> void:
|
|
$VBoxContainer/TabContainer/Audio/VBoxContainer/Master/MasterSlider.value = db_to_linear(AudioServer.get_bus_volume_db(0))
|
|
$VBoxContainer/TabContainer/Audio/VBoxContainer/Music/MusicSlider.value = db_to_linear(AudioServer.get_bus_volume_db(1))
|
|
$VBoxContainer/TabContainer/Audio/VBoxContainer/Effects/EffectsSlider.value = db_to_linear(AudioServer.get_bus_volume_db(2))
|
|
$VBoxContainer/TabContainer/Audio/VBoxContainer/Ambiance/AmbianceSlider.value = db_to_linear(AudioServer.get_bus_volume_db(3))
|
|
|
|
$VBoxContainer/TabContainer/Video/VBoxContainer/MSAA/AntiAliasing.selected = get_window().msaa_3d as int
|
|
$VBoxContainer/TabContainer/Video/VBoxContainer/VSync/VSyncMode.selected = MainMenuUIHandler.vsyncSetting
|
|
|
|
match Engine.max_fps:
|
|
0:
|
|
$VBoxContainer/TabContainer/Video/VBoxContainer/FPSCap/FPSCap.selected = 0
|
|
30:
|
|
$VBoxContainer/TabContainer/Video/VBoxContainer/FPSCap/FPSCap.selected = 1
|
|
60:
|
|
$VBoxContainer/TabContainer/Video/VBoxContainer/FPSCap/FPSCap.selected = 2
|
|
90:
|
|
$VBoxContainer/TabContainer/Video/VBoxContainer/FPSCap/FPSCap.selected = 3
|
|
120:
|
|
$VBoxContainer/TabContainer/Video/VBoxContainer/FPSCap/FPSCap.selected = 4
|
|
144:
|
|
$VBoxContainer/TabContainer/Video/VBoxContainer/FPSCap/FPSCap.selected = 5
|
|
if (is_instance_valid(FPSCounter.instance)):
|
|
$VBoxContainer/TabContainer/Video/VBoxContainer/FPSCounter/CheckBox.button_pressed = FPSCounter.instance.visible
|