feat(editor): add WSTC JSON round-trip (--export/--import-wstc-json)

Closes the editing loop on the hunter-stable-slot catalog: dump
a .wstc to JSON, hand-edit displayOrder / minLevelToUnlock /
copperCost / isPremium (e.g. lower the lvl 50 stable slot 4
unlock to lvl 45, mark slot 5 as premium for a donor server,
raise slot 3 cost from 2g to 5g for a tighter economy),
re-import to a byte-identical binary.

isPremium dual-encoded: bool OR int (machine-generated sidecars
work too). All other fields are scalar so no special handling
needed.

Verified byte-identical round-trip on all three presets
(std / cata / premium). CLI flag count 1074 -> 1076.
This commit is contained in:
Kelsi 2026-05-10 00:00:43 -07:00
parent 8f6f6ac91e
commit 68c20bd152
3 changed files with 122 additions and 0 deletions

View file

@ -2065,6 +2065,10 @@ void printUsage(const char* argv0) {
std::printf(" Print WSTC entries (id / displayOrder / minLevelToUnlock / cost (formatted) / premium flag / name)\n");
std::printf(" --validate-wstc <wstc-base> [--json]\n");
std::printf(" Static checks: id+name required, no duplicate ids; warns on lvl>80 (unreachable), Premium+nonzero cost (donor slots are free), duplicate displayOrder (UI collision)\n");
std::printf(" --export-wstc-json <wstc-base> [out.json]\n");
std::printf(" Export binary .wstc to a human-editable JSON sidecar (defaults to <base>.wstc.json)\n");
std::printf(" --import-wstc-json <json-path> [out-base]\n");
std::printf(" Import a .wstc.json sidecar back into binary .wstc (isPremium accepts bool OR int)\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");