feat(editor): add WMVC JSON round-trip (--export/--import-wmvc-json)

Dual encoding for category (int 0..6 OR token
"production"/"music"/"audio"/"engineering"/"art"/
"voice"/"special"). lines[] serializes as a plain JSON
string array — directly editable to add, remove, or
reorder credit lines without binary tooling. The string-
array round-trip preserves all whitespace and special
characters byte-identically since nlohmann::json escapes
them on export and unescapes on import.

All 3 presets (wotlk/quest/starter, 12 credit blocks
across 44 lines total) byte-identical roundtrip OK.
CLI flag count 1211 -> 1213.
This commit is contained in:
Kelsi 2026-05-10 02:16:54 -07:00
parent 46213baea0
commit 81eb854709
3 changed files with 156 additions and 0 deletions

View file

@ -2331,6 +2331,10 @@ void printUsage(const char* argv0) {
std::printf(" Print WMVC entries (id / cinematicId / category / orderHint / line count / name) plus per-block credit lines\n");
std::printf(" --validate-wmvc <wmvc-base> [--json]\n");
std::printf(" Static checks: id+name+cinematicId required, category 0..6, lines[] non-empty, no duplicate rollIds, no two blocks at same (cinematicId, orderHint) slot (would render in non-deterministic order); warns on empty lines (blank renders) or lines > 80 chars (text-buffer wrap)\n");
std::printf(" --export-wmvc-json <wmvc-base> [out.json]\n");
std::printf(" Export binary .wmvc to a human-editable JSON sidecar (defaults to <base>.wmvc.json; emits category as both int AND name string; lines[] as JSON string array)\n");
std::printf(" --import-wmvc-json <json-path> [out-base]\n");
std::printf(" Import a .wmvc.json sidecar back into binary .wmvc (category int OR \"production\"/\"music\"/\"audio\"/\"engineering\"/\"art\"/\"voice\"/\"special\"; lines[] is a JSON array of strings — directly editable to add/remove credit lines without binary tooling)\n");
std::printf(" --catalog-pluck <wXXX-file> <id> [--json]\n");
std::printf(" Extract one entry by id from any registered catalog format. Auto-detects magic, dispatches to the per-format --info-* handler internally, then prints just the matching entry. Primary-key field is auto-detected (first *Id field, or first numeric)\n");
std::printf(" --catalog-find <directory> <id> [--magic <WXXX>] [--json]\n");