feat(editor): add WMSP JSON round-trip (--export/--import-wmsp-json)

Dual encoding for all 4 WMSP enums (realmType /
realmCategory / expansion / population) on import — each
accepts int OR token string. New readEnumField helper
template factors out the int-or-token coercion logic so
the 4 enums share one parser body instead of repeating
the same 12-line pattern four times. Helper reports the
field label + entry id on parse failure so the operator
knows exactly which token broke.

Export adds a derived versionString "x.y.z" convenience
field alongside the three uint8 components — purely
informational, ignored on import (the int components are
authoritative). gmOnly accepts bool OR int.

All 3 presets (single/cluster/multi-expansion) byte-
identical roundtrip OK. Token-form import smoke-tested
with rppvp + beta + tbc + high (all 4 enums as strings
in the same entry). CLI flag count 1124 -> 1126.
This commit is contained in:
Kelsi 2026-05-10 00:48:27 -07:00
parent 054f44e4aa
commit 4aa7b56e13
3 changed files with 244 additions and 0 deletions

View file

@ -309,6 +309,7 @@ const char* const kArgRequired[] = {
"--export-wcmg-json", "--import-wcmg-json",
"--gen-msp", "--gen-msp-cluster", "--gen-msp-multi",
"--info-wmsp", "--validate-wmsp",
"--export-wmsp-json", "--import-wmsp-json",
"--gen-weather-temperate", "--gen-weather-arctic",
"--gen-weather-desert", "--gen-weather-stormy",
"--gen-zone-atmosphere",