30 lines
775 B
GDScript
30 lines
775 B
GDScript
extends Control
|
|
|
|
@onready var _options_popup: Window = $OptionsPopup
|
|
@onready var _music_slider: HSlider = $OptionsPopup/VBox/MusicSlider
|
|
@onready var _sfx_slider: HSlider = $OptionsPopup/VBox/SFXSlider
|
|
|
|
func _ready() -> void:
|
|
AudioManager.play_music("underwater_theme.mp3")
|
|
AudioManager.play_ambient_loop("underwater_ambient.ogg")
|
|
|
|
|
|
func _on_dive_pressed() -> void:
|
|
get_tree().change_scene_to_file("res://scenes/Main.tscn")
|
|
|
|
|
|
func _on_options_pressed() -> void:
|
|
_options_popup.popup_centered()
|
|
|
|
|
|
func _on_quit_pressed() -> void:
|
|
get_tree().quit()
|
|
|
|
|
|
func _on_music_slider_value_changed(value: float) -> void:
|
|
AudioManager.set_music_volume(linear_to_db(value))
|
|
|
|
|
|
func _on_sfx_slider_value_changed(value: float) -> void:
|
|
AudioManager.set_sfx_volume(linear_to_db(value))
|