Sort the scripts and scenes into folders
main/ holds the main window and top bar, quiz/ the quiz and its parts, player/ the music player, popups/ every popup and what they share, data/ the songs, players, playlist and settings, server/ the MusicServer client, common/ the list row and GameLog, and themes/ the themes and style boxes.
This commit is contained in:
1 parent
a0428e3475
commit
d77b72159d
115 files changed
+94
-84
No files matched your search
@@ -0,0 +1,24 @@
|
||||
class_name VolumeSlider
|
||||
extends HSlider
|
||||
## A slider that sets the volume of an audio bus.
|
||||
|
||||
## The audio bus whose volume the slider sets.
|
||||
|
||||
@export var audio_bus_name: String = "music"
|
||||
|
||||
var _bus: int
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
_bus = AudioServer.get_bus_index(audio_bus_name)
|
||||
value_changed.connect(_on_value_changed)
|
||||
value = db_to_linear(AudioServer.get_bus_volume_db(_bus))
|
||||
|
||||
|
||||
## Sets the bus volume to [param changed_value], from 0 (silent) to 1 (full).
|
||||
func change_volume(changed_value: float) -> void:
|
||||
AudioServer.set_bus_volume_db(_bus, linear_to_db(changed_value))
|
||||
|
||||
|
||||
func _on_value_changed(changed_value: float) -> void:
|
||||
AudioServer.set_bus_volume_db(_bus, linear_to_db(changed_value))
|
||||
Reference in new issue
Block a user