feat(editor): add WSND JSON round-trip authoring workflow

Closes the WSND open-format loop with --export-wsnd-json /
--import-wsnd-json, mirroring the WOL/WOW/WOMX JSON pairs
from earlier batches.

Each entry round-trips all 9 fields:
  soundId, kind (int + kindName string), flags (int +
  flagsList string array), volume, minDistance, maxDistance,
  filePath, label.

Both kind and flags are emitted in dual form (int + named):
  • kind     : 2,
    kindName : "ambient",
  • flags    : 3,
    flagsList: ["loop", "3d"]

The importer accepts either form per field, so a hand-author
can write only the named string forms and skip the integer
boilerplate. Missing optional fields fall back to
WoweeSound::Entry defaults.

Verified byte-identical round-trip on the tavern preset
(5 entries with mixed flags and 3D distances).

Adds 2 flags (467 kArgRequired entries total). All 4 binary
formats added in recent batches now have full JSON round-trip:
WOL, WOW, WOMX, WSND.
This commit is contained in:
Kelsi 2026-05-09 14:51:44 -07:00
parent ec569768fe
commit 40a0194e18
3 changed files with 156 additions and 0 deletions

View file

@ -845,6 +845,10 @@ void printUsage(const char* argv0) {
std::printf(" Print WSND catalog entries (id / kind / flags / volume / 3D distances / file path / label)\n");
std::printf(" --validate-wsnd <wsnd-base> [--json]\n");
std::printf(" Static checks: kind in 0..6, finite distances, 3D needs max>min>=0, no duplicate sound IDs\n");
std::printf(" --export-wsnd-json <wsnd-base> [out.json]\n");
std::printf(" Export binary .wsnd to a human-editable JSON sidecar (defaults to <base>.wsnd.json)\n");
std::printf(" --import-wsnd-json <json-path> [out-base]\n");
std::printf(" Import a .wsnd.json sidecar back into binary .wsnd (accepts either kind int OR kindName string)\n");
std::printf(" --gen-weather-temperate <wow-base> [zoneName]\n");
std::printf(" Emit .wow weather schedule: clear-dominant + occasional rain + fog (forest / grassland)\n");
std::printf(" --gen-weather-arctic <wow-base> [zoneName]\n");