56 lines
1.6 KiB
GDScript3
56 lines
1.6 KiB
GDScript3
|
extends Node
|
||
|
|
||
|
# Video Settings UI References
|
||
|
@export var display_options_button : OptionButton
|
||
|
@export var vsync_toggle : CheckButton
|
||
|
@export var resolutions_options_button : OptionButton
|
||
|
|
||
|
# Audio Settings UI References
|
||
|
@export var master_volume_slider : Slider
|
||
|
@export var music_volume_slider : Slider
|
||
|
@export var sfx_volume_slider : Slider
|
||
|
|
||
|
# Engine Callbacks
|
||
|
func _ready():
|
||
|
display_options_button.select(Save.game_data.display_mode)
|
||
|
GlobalSettings.set_display_mode(Save.game_data.display_mode)
|
||
|
vsync_toggle.set_pressed_no_signal(Save.game_data.vsync_on)
|
||
|
GlobalSettings.toggle_vsync(Save.game_data.vsync_on)
|
||
|
master_volume_slider.value = Save.game_data.master_volume
|
||
|
GlobalSettings.update_master_volume(Save.game_data.master_volume)
|
||
|
music_volume_slider.value = Save.game_data.music_volume
|
||
|
GlobalSettings.update_music_volume(Save.game_data.music_volume)
|
||
|
sfx_volume_slider.value = Save.game_data.sfx_volume
|
||
|
GlobalSettings.update_sfx_volume(Save.game_data.sfx_volume)
|
||
|
pass
|
||
|
|
||
|
# Other Buttons
|
||
|
func _on_back_pressed():
|
||
|
queue_free()
|
||
|
pass
|
||
|
|
||
|
# Video Settings
|
||
|
func _on_display_mode_options_item_selected(index):
|
||
|
GlobalSettings.set_display_mode(index)
|
||
|
pass
|
||
|
|
||
|
func _on_vsync_button_toggled(button_pressed):
|
||
|
GlobalSettings.toggle_vsync(button_pressed)
|
||
|
pass
|
||
|
|
||
|
func _on_resolutions_options_item_selected(index):
|
||
|
pass
|
||
|
|
||
|
# Audio Settings
|
||
|
func _on_master_volume_slider_value_changed(value):
|
||
|
GlobalSettings.update_master_volume(value)
|
||
|
pass
|
||
|
|
||
|
func _on_music_vol_slider_value_changed(value):
|
||
|
GlobalSettings.update_music_volume(value)
|
||
|
pass
|
||
|
|
||
|
func _on_sfx_vol_slider_value_changed(value):
|
||
|
GlobalSettings.update_sfx_volume(value)
|
||
|
pass
|