39 lines
1.1 KiB
GDScript3
39 lines
1.1 KiB
GDScript3
![]() |
class_name MainMenuUIHandler extends Control
|
||
|
|
||
|
@export var animator: AnimationPlayer
|
||
|
|
||
|
func _on_settings_pressed() -> void:
|
||
|
animator.play_backwards("ShowMain")
|
||
|
await animator.animation_finished
|
||
|
animator.play("ShowSettings")
|
||
|
|
||
|
func _on_credits_pressed() -> void:
|
||
|
animator.play_backwards("ShowMain")
|
||
|
await animator.animation_finished
|
||
|
animator.play("ShowCredits")
|
||
|
|
||
|
func _on_quit_pressed() -> void:
|
||
|
get_tree().quit()
|
||
|
|
||
|
func _on_back_pressed():
|
||
|
animator.play_backwards("ShowSettings")
|
||
|
await animator.animation_finished
|
||
|
animator.play("ShowMain")
|
||
|
|
||
|
func _on_credits_back_pressed():
|
||
|
animator.play_backwards("ShowCredits")
|
||
|
await animator.animation_finished
|
||
|
animator.play("ShowMain")
|
||
|
|
||
|
func _on_master_slider_value_changed(value: float) -> void:
|
||
|
AudioServer.set_bus_volume_db(0, linear_to_db(value))
|
||
|
|
||
|
func _on_music_slider_value_changed(value: float) -> void:
|
||
|
AudioServer.set_bus_volume_db(1, linear_to_db(value))
|
||
|
|
||
|
func _on_effects_slider_value_changed(value: float) -> void:
|
||
|
AudioServer.set_bus_volume_db(2, linear_to_db(value))
|
||
|
|
||
|
func _on_ambiance_slider_value_changed(value: float) -> void:
|
||
|
AudioServer.set_bus_volume_db(3, linear_to_db(value))
|