feat(editor): add WSPR JSON round-trip (--export/--import-wspr-json)

Closes the editing loop on the spell-reagent catalog: dump a
.wspr to JSON, hand-edit reagentKind / spellId / per-slot
itemId+count pairs (e.g. swap a Mage Portal's reagent from Rune
of Portals to a server-custom item, change a Warlock summon to
need 2 Soul Shards instead of 1, add Tier-3 Catalyst entries
for upgraded spell variants), re-import to a byte-identical
binary.

Reagent slot arrays (8 itemIds, 8 counts) are exported as JSON
arrays — easier to read and edit than 16 individual numbered
fields. Importer pads arrays shorter than 8 with zeros and
silently truncates longer arrays, so hand-edited sidecars don't
need to spell out every empty slot.

The exporter emits both reagentKind (int 0..4) and the human-
readable reagentKindName ("standard" / "soul-shard" /
"focused-item" / "catalyst" / "tradeable"); the importer accepts
either form.

Verified byte-identical round-trip on all three presets
(mage / warlock / rez). CLI flag count 979 -> 981.
This commit is contained in:
Kelsi 2026-05-09 22:40:12 -07:00
parent d97f4bf5db
commit 8e85278d89
3 changed files with 171 additions and 0 deletions

View file

@ -246,6 +246,7 @@ const char* const kArgRequired[] = {
"--export-wctr-json", "--import-wctr-json",
"--gen-spr", "--gen-spr-warlock", "--gen-spr-rez",
"--info-wspr", "--validate-wspr",
"--export-wspr-json", "--import-wspr-json",
"--gen-weather-temperate", "--gen-weather-arctic",
"--gen-weather-desert", "--gen-weather-stormy",
"--gen-zone-atmosphere",