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

@@ -83,6 +83,7 @@ func _redraw() -> void:
_progress.text = Guide.progress_text()
func _on_done(_i: int, s: Dictionary) -> void:
Sfx.ui("ui_step")
_tick.text = "✓ " + String(s.title)
var tw := create_tween()
_tick.modulate.a = 1.0

View File

@@ -37,6 +37,7 @@ func setup() -> void:
Hints.shown.connect(show_hint)
func show_hint(h: Dictionary) -> void:
Sfx.ui("ui_tip")
_title.text = String(h.title)
_text.text = ("\"%s\"" % String(h.text)) if not Hints.guide_name.is_empty() else String(h.text)
_box.visible = true

View File

@@ -99,6 +99,7 @@ func bind(p: CharacterBody3D) -> void:
player.inventory.changed.connect(_refresh)
player.selected_changed.connect(_refresh)
player.selected_changed.connect(func(): Sfx.ui("ui_tick"))
player.inventory_requested.connect(_on_inventory_requested)
player.hands.prompt_changed.connect(func(t): _prompt.text = t)
_hurt = ColorRect.new()

View File

@@ -144,12 +144,15 @@ func open(chest: Node) -> void:
container.inventory.changed.connect(_refresh)
visible = true
player.ui_open = true
Sfx.ui("ui_open")
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
_pick_tab()
_rebuild_chest()
_refresh()
func close() -> void:
if visible:
Sfx.ui("ui_close")
if WorldNet.is_client():
PlayerNet.ask("close") # the server puts the cursor back in our bag
_cursor = null

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()