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.
The pattern
bool jsonOut = (i + 1 < argc &&
std::strcmp(argv[i + 1], "--json") == 0);
if (jsonOut) i++;
is repeated ~50 times across the editor — every --info-*
and --validate-* handler writes the same three lines to
detect and consume an optional --json follower. Extract
to consumeJsonFlag(int& i, int argc, char** argv) in
cli_arg_parse.hpp (the same header that already hosts
parseOptInt / parseOptFloat / parseOptUint / parseOptArg
for similar repeated patterns).
Adopted in the recently-added files:
• cli_world_map.cpp — both --info-womx and --validate-womx
• cli_sound_catalog.cpp — both --info-wsnd and --validate-wsnd
• cli_wom_info.cpp — all 7 --info-* / --validate-wom
handlers (replace_all)
Also adopted the shared stripExt() helper from
cli_box_emitter.hpp instead of the new files' rolled-
own stripWomxExt / stripWsndExt — same observable behavior,
no more local copies of the extension-strip logic.
Future --info-/-validate handlers added to other formats
(WSP, WTC, etc.) get the same one-line jsonOut detection
without reinventing the peek-and-advance dance. Any later
adoption of consumeJsonFlag in the older 50+ sites is now
a mechanical replace_all edit per file.
Behavior preserved: --validate-wom and --info-womx and
--info-wsnd round-trip exactly as before, both text and
--json output unchanged.