feat(editor): add WHLD JSON round-trip (--export/--import-whld-json)

Closes the editing loop on the instance-lockout catalog: dump a
.whld to JSON, hand-edit raidLockoutKind / resetIntervalMs /
maxBossKillsPerLockout / raidGroupSize / bonusRolls (e.g. switch
ICC 25-Heroic from Weekly to SemiWeekly for a faster server,
raise Wintergrasp's reset from 2.5h to 3h, mark a custom
heroic+ tier with bonus rolls), re-import to a byte-identical
binary.

raidLockoutKind dual-encoded: int 0..3 OR human-readable name
("daily" / "weekly" / "semi-weekly" / "custom"). All other
fields are scalar uint32/uint8 so no dual encoding needed.

Verified byte-identical round-trip on all three presets
(raid / dungeon / event). The event preset's mixed kinds (2
Daily + 1 Custom 2.5h) round-trip exactly, confirming that the
Custom kind's arbitrary intervalMs preserves through the JSON
serialization. CLI flag count 1067 -> 1069.
This commit is contained in:
Kelsi 2026-05-09 23:54:26 -07:00
parent 321c2610d0
commit 3f65e63ca1
3 changed files with 151 additions and 0 deletions

View file

@ -2051,6 +2051,10 @@ void printUsage(const char* argv0) {
std::printf(" Print WHLD entries (id / map / diff / kind / interval (formatted) / boss kills / size / bonus rolls / name)\n");
std::printf(" --validate-whld <whld-base> [--json]\n");
std::printf(" Static checks: id+name+kind+interval required, no duplicate ids; warns on non-standard group size, kind/interval mismatches (Daily not 24h, Weekly not 7d), 0 boss kill cap\n");
std::printf(" --export-whld-json <whld-base> [out.json]\n");
std::printf(" Export binary .whld to a human-editable JSON sidecar (defaults to <base>.whld.json)\n");
std::printf(" --import-whld-json <json-path> [out-base]\n");
std::printf(" Import a .whld.json sidecar back into binary .whld (accepts raidLockoutKind int OR raidLockoutKindName 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");