1
0
mirror of https://github.com/JohnBreaux/Boat-Battle.git synced 2024-11-15 05:25:57 +00:00
Boat-Battle/godot_ship/script/options/Options.gd

37 lines
1.0 KiB
GDScript3
Raw Normal View History

2021-10-20 17:10:18 +00:00
extends Control
onready var sound_slider = find_node("SFX Slider", true, true)
onready var music_slider = find_node("Volume Slider", true, true)
onready var theme_buttons = find_node("Buttons", true, true).get_children()
2021-10-20 17:10:18 +00:00
# Called when the node enters the scene tree for the first time.
func _ready():
OptionsController.load_options()
find_next_valid_focus().grab_focus()
sound_slider.value = OptionsController.get_sfx_volume()
music_slider.value = OptionsController.get_mus_volume()
2021-10-20 17:10:18 +00:00
func _on_Button_pressed():
2021-11-01 09:26:17 +00:00
$ButtonSFX.play()
2021-10-20 17:10:18 +00:00
queue_free()
2021-10-22 06:53:04 +00:00
# MessageBus.emit_signal("change_scene", "Title")
func _on_SFX_Slider_value_changed(value):
OptionsController.set_sfx_vol(value)
OptionsController.save_options()
func _on_Volume_Slider_value_changed(value):
OptionsController.set_mus_vol(value)
OptionsController.save_options()
func _on_Light_pressed():
OptionsController.set_theme("light")
OptionsController.save_options()
2021-11-01 09:26:17 +00:00
$ButtonSFX.play()
func _on_Dark_pressed():
OptionsController.set_theme("dark")
OptionsController.save_options()
2021-11-01 09:26:17 +00:00
$ButtonSFX.play()