update
Some checks failed
Tests / headless (push) Has been cancelled
Tests / fenster-schnell (push) Has been cancelled
Tests / fenster-voll (push) Has been cancelled
Tests / balance (push) Has been cancelled

This commit is contained in:
team3
2026-10-08 14:28:52 +02:00
parent 5bc8569717
commit c245c7af87
21 changed files with 496 additions and 347 deletions

View File

@@ -4,9 +4,10 @@ extends Node
var streams := {}
var players: Array[AudioStreamPlayer] = []
var volume := 0.8
var volume := 0.0 # Ton ist standardmäßig aus
var muted := false # Tests: nie etwas abspielen, egal was die Regler sagen
var music_player: AudioStreamPlayer
var music_volume := 0.5
var music_volume := 0.0
var music_task := -1 # die Musik wird im Hintergrund berechnet (spart ~150 ms beim Start)
var music_box := {}
@@ -78,7 +79,7 @@ func _music() -> AudioStreamWAV:
func set_music_volume(v: float) -> void:
music_volume = clampf(v, 0.0, 1.0)
if music_volume <= 0.0:
if music_volume <= 0.0 or muted:
music_player.stop()
else:
music_player.volume_db = linear_to_db(music_volume * 0.6)
@@ -91,7 +92,7 @@ func set_volume(v: float) -> void:
func play(kind: String) -> void:
if volume <= 0.0 or not streams.has(kind):
if volume <= 0.0 or muted or not streams.has(kind):
return
for p in players:
if not p.playing: