Audio: mood music, ambience, sound effects and creature voices (Kenney CC0 + synthesised); protocol 13

This commit is contained in:
Paul Bailey
2026-11-05 21:03:54 +00:00
parent 2a9d47630e
commit caa611fac6
159 changed files with 1814 additions and 3 deletions

View File

@@ -80,6 +80,25 @@ func bind(p: CharacterBody3D) -> void:
sens_row.add_child(sens)
_main.add_child(sens_row)
# Volumes (sfx.gd keeps them in user://audio.json).
for row in [["Music", "Music"], ["Sounds", "SFX"], ["Ambience", "Ambience"]]:
var vr := HBoxContainer.new()
var lab := UITheme.label(row[0], 16)
lab.custom_minimum_size = Vector2(150, 0)
vr.add_child(lab)
var vs := HSlider.new()
vs.min_value = 0.0
vs.max_value = 1.0
vs.step = 0.05
vs.value = float(Sfx.volumes.get(row[1], 0.8))
vs.size_flags_horizontal = Control.SIZE_EXPAND_FILL
vs.focus_mode = Control.FOCUS_NONE
vs.accessibility_name = "%s volume" % row[0]
var bus: String = row[1]
vs.value_changed.connect(func(v: float): Sfx.set_volume(bus, v))
vr.add_child(vs)
_main.add_child(vr)
# Old Tam's tips in normal worlds (T4): on or off, or all of them again.
if not Guide.active:
var tips_row := HBoxContainer.new()