mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-10 19:13:52 +00:00
feat(editor): add WTBD JSON round-trip (--export/--import-wtbd-json)
Dual encoding for both WTBD enums on import:
backgroundPattern (int 0..4 OR token "solid" / "gradient"
/ "chevron" / "quartered" / "starburst") and
borderPattern (int 0..3 OR token "none" / "thin" /
"thick" / "decorative"). isApproved accepts bool or int.
The 3 RGBA color fields serialize as 0xAARRGGBB uint32
values directly — operators picking colors in JSON can
use any familiar hex form via Python int("0x...", 16) or
similar pre-processing.
All 3 presets (alliance/horde/faction) byte-identical
roundtrip OK. Token-form import smoke-tested with
starburst + decorative pattern combination. CLI flag
count 1146 -> 1148.
This commit is contained in:
parent
0f4c619b49
commit
7fa24af3b2
3 changed files with 203 additions and 0 deletions
|
|
@ -2205,6 +2205,10 @@ void printUsage(const char* argv0) {
|
|||
std::printf(" Print WTBD entries (id / bg-pattern / border / emblem / guild / approval state / name)\n");
|
||||
std::printf(" --validate-wtbd <wtbd-base> [--json]\n");
|
||||
std::printf(" Static checks: id+name required, backgroundPattern 0..4, borderPattern 0..3, no duplicate ids; warns on emblemId>1023, alpha=0 on any color layer (transparent), and emblem-vs-background color similarity (squared RGB distance < 1500 — emblem unreadable)\n");
|
||||
std::printf(" --export-wtbd-json <wtbd-base> [out.json]\n");
|
||||
std::printf(" Export binary .wtbd to a human-editable JSON sidecar (defaults to <base>.wtbd.json; emits both backgroundPattern/borderPattern ints AND name strings; all 3 colors as 0xAARRGGBB uint32)\n");
|
||||
std::printf(" --import-wtbd-json <json-path> [out-base]\n");
|
||||
std::printf(" Import a .wtbd.json sidecar back into binary .wtbd (backgroundPattern int OR \"solid\"/\"gradient\"/\"chevron\"/\"quartered\"/\"starburst\"; borderPattern int OR \"none\"/\"thin\"/\"thick\"/\"decorative\"; isApproved 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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue