mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-11 11:33:52 +00:00
feat(editor): WSWP JSON round-trip closure
Adds --export-wswp-json / --import-wswp-json with the established
readEnumField template factoring int+name dual encoding for
conditionKind ("always"/"zoneonly"/"classonly"/"raceonly"/
"genderonly"). Signed gain field (gainAdjustDb_x10, int16)
preserved bit-for-bit through JSON.
All 3 presets (bosses/race/ui) byte-identical binary roundtrip
OK.
Live-tested both the duplicate-trigger error AND the same-
priority warning in one mutation: copied Nefarian rule's
trigger triple to match Onyxia (originalSoundId=1234,
ZoneOnly, conditionValue=249). Validator emitted BOTH:
ERROR: duplicate trigger triple
WARNING: same priorityIndex=100 — tie-break order undefined
Demonstrates that the validator catches both layers of the
collision (the deterministic data tie + the priority-based
disambiguation that the runtime would have used to resolve it).
CLI flag count 1470 -> 1472.
This commit is contained in:
parent
8c36fc5274
commit
4dd1fb09ff
3 changed files with 172 additions and 0 deletions
|
|
@ -2737,6 +2737,10 @@ void printUsage(const char* argv0) {
|
|||
std::printf(" Print WSWP entries (id / origSound / replSound / conditionKind+value / priority / gain dB / name)\n");
|
||||
std::printf(" --validate-wswp <wswp-base> [--json]\n");
|
||||
std::printf(" Static checks: id+name+originalSoundId+replacementSoundId required, conditionKind 0..4, no duplicate ruleIds, no self-replacement (orig==repl is no-op); CRITICAL: no duplicate (originalSoundId, conditionKind, conditionValue) trigger triple (runtime would have two rules for the same trigger), non-Always conditionKind requires non-zero conditionValue. Warns on priorityIndex=0 (effectively disabled), |gainAdjustDb_x10| > 300 (±30dB clip risk), Always condition with non-zero conditionValue (dead data), and same-priority within same originalSoundId (tie-break undefined when both conditions match)\n");
|
||||
std::printf(" --export-wswp-json <wswp-base> [out.json]\n");
|
||||
std::printf(" Export binary .wswp to a human-editable JSON sidecar (defaults to <base>.wswp.json; emits conditionKind as int + name string)\n");
|
||||
std::printf(" --import-wswp-json <json-path> [out-base]\n");
|
||||
std::printf(" Import a .wswp.json sidecar back into binary .wswp (conditionKind int OR \"always\"/\"zoneonly\"/\"classonly\"/\"raceonly\"/\"genderonly\" — round-trips priority + gain + condition tables byte-identical)\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