feat(editor): add WSPM JSON round-trip (--export/--import-wspm-json)

Dual encoding for edgeFadeMode (int 0..2 OR token "hard"
/ "softedge" / "pulse"). stackable and destroyOnCancel
accept both bool and int. Float fields (radius, duration)
serialize as JSON floats; tickIntervalMs and decalColor
as plain unsigned integers — operators editing JSON can
hand-write 0xAARRGGBB hex colors via Python int() prep.

All 3 presets (mage/raid/env) byte-identical roundtrip
OK. Token-form import smoke-tested with mixed pulse +
stackable + destroyOnCancel false. CLI flag count 1153
-> 1155.
This commit is contained in:
Kelsi 2026-05-10 01:31:49 -07:00
parent 62a10937e0
commit 267d525fe7
3 changed files with 175 additions and 0 deletions

View file

@ -2219,6 +2219,10 @@ void printUsage(const char* argv0) {
std::printf(" Print WSPM entries (id / spell / radius / duration / tick interval / fade mode / stack-flag / destroy-on-cancel / name)\n");
std::printf(" --validate-wspm <wspm-base> [--json]\n");
std::printf(" Static checks: id+name+spellId+texturePath required, radius>0, edgeFadeMode 0..2, no duplicate markerIds, no duplicate spellIds (spell-cast lookup ambiguity); warns on radius>100yd, tickIntervalMs<100ms (perf risk for stackable), decalColor alpha=0 (invisible)\n");
std::printf(" --export-wspm-json <wspm-base> [out.json]\n");
std::printf(" Export binary .wspm to a human-editable JSON sidecar (defaults to <base>.wspm.json; emits edgeFadeMode as both int AND name string; radius+duration as floats; decalColor as 0xAARRGGBB uint32)\n");
std::printf(" --import-wspm-json <json-path> [out-base]\n");
std::printf(" Import a .wspm.json sidecar back into binary .wspm (edgeFadeMode int OR \"hard\"/\"softedge\"/\"pulse\"; stackable/destroyOnCancel bool OR int)\n");
std::printf(" --catalog-pluck <wXXX-file> <id> [--json]\n");
std::printf(" Extract one entry by id from any registered catalog format. Auto-detects magic, dispatches to the per-format --info-* handler internally, then prints just the matching entry. Primary-key field is auto-detected (first *Id field, or first numeric)\n");
std::printf(" --catalog-find <directory> <id> [--magic <WXXX>] [--json]\n");