feat/sound-preview · PurpleFuchs · 2 Dateien · +128 −7 · 2026-10-28
Zusammenfassung
Card 651bd1 — Sound-Optionen: Test-Sample beim Ändern pro Kanal
All 5 channels were staged-only until 'Save & Update' — volume was tuned blind. Now a representative sample plays at the STAGED volume × staged master.
Implementation
DrawSoundChanger— returns the slider interaction{Dragging, ToggleFlipped}as a 4th value;drawChangersis its only consumer (flag: backward-compatible).DrawSoundOptions— per-channel cachedlove.audiosources +FILE_ChannelStateframe-state machine:Vol@DragStartcaptured on drag-begin, preview fires on release iff changed; toggle-click previews post-flip state.- Samples: Master/Effects →
Buildingplacement1.mp3; Music → firstMusic/*.mp3viaBastiFileSystem.dir(folder is build-level — nothing hardcoded, flag 1); Voice →CommenceExtraction.mp3(own source —VoiceManagerreads saved volume + owns in-flight files); Ambience →Ambience.wav. - Guards:
stop()beforeplay()(retrigger); toggle-off stops in-flight sample; master-off skips all previews;stopAllPreviews()on Save & Update. - Ambience standalone vars normalized through
updateChannel(flag 6).
Verified: luajit per-file + lovec .syntaxchk 4056/0.
Geänderte Dateien (2)
| Source/GuiElements/DrawSoundChanger.lua | geändert | +7 −2 |
| Source/GuiElements/Options/DrawSoundOptions.lua | geändert | +121 −5 |