feat(editor): add WIFS JSON round-trip (--export/--import-wifs-json)

Closes the editing loop on the item-flag bit catalog: dump a
.wifs to JSON, hand-edit bitMask hex / flagKind / isPositive
(e.g. add a server-custom Heroic25man flag at bit 0x10000000,
re-tag NoLoot from Drop kind to Quality kind, mark BindToAccount
as positive for an account-wide-loot server), re-import to a
byte-identical binary.

Two dual-encoded fields:
  - flagKind: int 0..6 OR "quality" / "drop" / "trade" /
    "magic" / "account" / "server" / "misc"
  - isPositive: bool OR int (machine-generated sidecars work
    too)

Hex bitMasks export as raw uint32 — pasting "0x40000000" hex
values into JSON works directly.

Verified byte-identical round-trip on all three presets
(std / bind / srv). CLI flag count 1023 -> 1025.
This commit is contained in:
Kelsi 2026-05-09 23:12:01 -07:00
parent 0ceb70f3e7
commit fd0e2cc50b
3 changed files with 150 additions and 0 deletions

View file

@ -265,6 +265,7 @@ const char* const kArgRequired[] = {
"--export-wscs-json", "--import-wscs-json",
"--gen-ifs", "--gen-ifs-binding", "--gen-ifs-server",
"--info-wifs", "--validate-wifs",
"--export-wifs-json", "--import-wifs-json",
"--gen-weather-temperate", "--gen-weather-arctic",
"--gen-weather-desert", "--gen-weather-stormy",
"--gen-zone-atmosphere",