feat: soundboard pads can load from a JSON5 file (DB fallback)

When the server (soundboard_sounds table) returns no pads, the client now
loads them from a JSON5 config file (loadGamedata accepts plain JSON and
JSON5). Useful when the DB / CMS isn't set up yet.

File-defined pads play locally for the clicker; DB-backed pads still go
through the server broadcast so everyone in the room hears them. Ships a
radio-style soundboard-sounds.json5.example template.
This commit is contained in:
medievalshell
2026-05-28 10:19:16 +02:00
parent 48ed3ad7ba
commit 4833ab8447
3 changed files with 88 additions and 21 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ export const SoundboardView: FC<{}> = () =>
{ sounds.map(sound => (
<button
key={ sound.id }
onClick={ () => play(sound.id) }
onClick={ () => play(sound) }
title={ sound.name }
className="flex h-20 cursor-pointer flex-col items-center justify-center gap-1 rounded-lg bg-[#3a7bb5] px-2 text-white shadow transition-transform hover:bg-[#336ea3] active:scale-95">
<span className="text-2xl leading-none">🔊</span>