feat(editor): add WMAR JSON round-trip (--export/--import-wmar-json)

Dual encoding for markerKind (int 0..3 OR token
"raidtarget"/"worldmap"/"party"/"custom"). iconPath and
displayChar serialize as plain JSON strings for direct
authoring.

The displayChar field round-trip preserves exact byte
content — important since chat-overlay glyphs may
include short Unicode sequences (the Diamond marker
uses "<>" as a 2-char ASCII fallback for its glyph
rendering).

All 3 presets (raid/world/party) byte-identical
roundtrip OK. CLI flag count 1246 -> 1248.
This commit is contained in:
Kelsi 2026-05-10 02:40:54 -07:00
parent 42842958df
commit e7755c77c9
3 changed files with 147 additions and 0 deletions

View file

@ -2401,6 +2401,10 @@ void printUsage(const char* argv0) {
std::printf(" Print WMAR entries (id / kind / priority / glyph / name)\n");
std::printf(" --validate-wmar <wmar-base> [--json]\n");
std::printf(" Static checks: id+name required, markerKind 0..3, no duplicate markerIds, no two markers at same (kind, priority) slot (picker UI sort would be non-deterministic); warns on empty iconPath, empty/oversized displayChar, RaidTarget priority > 7 (exceeds canonical /raidicon dispatch range)\n");
std::printf(" --export-wmar-json <wmar-base> [out.json]\n");
std::printf(" Export binary .wmar to a human-editable JSON sidecar (defaults to <base>.wmar.json; emits markerKind as both int AND name string; iconPath and displayChar as plain strings)\n");
std::printf(" --import-wmar-json <json-path> [out-base]\n");
std::printf(" Import a .wmar.json sidecar back into binary .wmar (markerKind int OR \"raidtarget\"/\"worldmap\"/\"party\"/\"custom\")\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");