feat(editor): add WCEF JSON round-trip (--export/--import-wcef-json)

Closes the editing loop on the creature-family catalog: dump a
.wcef to JSON, hand-edit familyKind / petTalentTree /
minLevelForTame / petFoodTypes (e.g. add Bread to Bear's diet,
move Boar from Tenacity to Cunning, drop the tame requirement on
exotic Worm from 50 to 45), re-import to a byte-identical binary.

Three different field types each take dual int+name forms:
  - familyKind: int 0..5 OR "beast"/"demon"/"undead"/"elemental"/
    "not-pet"/"exotic"
  - petTalentTree: int 0..3 OR "none"/"ferocity"/"tenacity"/
    "cunning"
  - petFoodTypes: int bitfield OR pipe-separated label string
    ("Meat|Fish|Raw"). Importer prefers the int form when both
    are present so unknown bits round-trip losslessly.

Verified byte-identical round-trip on all three presets
(starter / ferocity / exotic). CLI flag count 919 -> 921.
This commit is contained in:
Kelsi 2026-05-09 21:55:23 -07:00
parent 12faffeb87
commit 3e73860475
3 changed files with 211 additions and 0 deletions

View file

@ -220,6 +220,7 @@ const char* const kArgRequired[] = {
"--export-wscd-json", "--import-wscd-json",
"--gen-cef", "--gen-cef-ferocity", "--gen-cef-exotic",
"--info-wcef", "--validate-wcef",
"--export-wcef-json", "--import-wcef-json",
"--gen-weather-temperate", "--gen-weather-arctic",
"--gen-weather-desert", "--gen-weather-stormy",
"--gen-zone-atmosphere",