pegchamp/Menu/Buttons/AudioSliders/VolumeSlider.gd
2021-10-01 17:28:14 +02:00

12 lines
337 B
GDScript

extends HSlider
export var bus_channel = "Master"
func _ready():
value = db2linear(AudioServer.get_bus_volume_db(AudioServer.get_bus_index(bus_channel)))
func _on_MusicVolumeSlider_value_changed(value):
AudioServer.set_bus_volume_db(AudioServer.get_bus_index(bus_channel), linear2db(value))
func save_volume():
Saves.save_game()