mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-11 11:33:52 +00:00
feat(editor): WCRA JSON round-trip closure
Adds --export-wcra-json / --import-wcra-json. Variable-length
reagent arrays serialize as JSON object array of {itemId, count}
allowing hand-edits of recipe formulas. tradeSkillName field on
export is informational (tradeSkillId int is authoritative).
All 3 presets (alchemy/engineering/blacksmithing) byte-identical
binary roundtrip OK including the 5-reagent Target Dummy
recipe.
Live-tested perpetual-motion validator: hand-mutated Minor
Healing Potion (recipeId 1, produces itemId 118) to add itemId
118 to its reagents. Validator correctly errored: "reagent
itemId equals producedItemId=118 — recipe consumes what it
makes (perpetual-motion bug)" — catches a class of crafting
bugs that would silently let players duplicate items.
CLI flag count 1398 -> 1400.
This commit is contained in:
parent
7df59b1d80
commit
6c77419633
3 changed files with 141 additions and 0 deletions
|
|
@ -2625,6 +2625,10 @@ void printUsage(const char* argv0) {
|
|||
std::printf(" Print WCRA entries (recipeId / spellId / tradeSkillName / requiredSkillLevel / producedItemId / producedCount / reagent count / name)\n");
|
||||
std::printf(" --validate-wcra <wcra-base> [--json]\n");
|
||||
std::printf(" Static checks: id+name+spellId+tradeSkillId+producedItemId+producedCount required, no duplicate recipeIds, no duplicate spellIds (cast-handler conflict), no zero-itemId/zero-count reagents, no duplicate reagent itemIds within a single recipe (should be merged), no self-reagent (recipe consuming its own output is a perpetual-motion bug); warns on requiredSkillLevel > 450 (above WotLK cap), empty reagent list (free-to-craft is unusual)\n");
|
||||
std::printf(" --export-wcra-json <wcra-base> [out.json]\n");
|
||||
std::printf(" Export binary .wcra to a human-editable JSON sidecar (defaults to <base>.wcra.json; tradeSkillName is informational; reagents emitted as JSON object array of {itemId,count})\n");
|
||||
std::printf(" --import-wcra-json <json-path> [out-base]\n");
|
||||
std::printf(" Import a .wcra.json sidecar back into binary .wcra (tradeSkillId int authoritative, tradeSkillName ignored; reagents accept JSON object array — round-trips per-recipe variable-length reagent lists 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