Added volume bar and song list and refactored character select

This commit is contained in:
2023-08-29 21:06:19 +02:00
parent a48fc04e3b
commit c15afc3dc5
8 changed files with 274 additions and 69 deletions

15
volume_slider.gd Normal file
View File

@@ -0,0 +1,15 @@
extends HSlider
@export
var audio_bus_name := "music"
@onready
var _bus: int
func _ready():
_bus = AudioServer.get_bus_index(audio_bus_name)
value_changed.connect(_on_value_changed)
value = db_to_linear(AudioServer.get_bus_volume_db(_bus))
func _on_value_changed(value: float) -> void:
AudioServer.set_bus_volume_db(_bus, linear_to_db(value))