wc3-ts-template
wc3-ts-template copied to clipboard
WTS File Parser and Enum Generator
Parses the WTS file and creates enums associated with the data in the WTS file.
Enum types created are Units, Items, Destructibles, Doodads, Abilities, Buffs/Effects, Upgrades
Enum names are customizable in the config.json folder. Output folder is customizable in config.json. Defaults to "src/WTS Generated Enums"
Enum member names are PascalCase.
Handles duplicate names by appending the fourCC code: "nameCopy_R005 = FourCC("R005")" Removes color encoding from enum member names. Example : |cffffcc00My Colored Unit Name|r -> MyColoredUnitName Handles removing color encoding from gradient's as well. Replaces illegal characters for enum member names with "_". "BadName!@#$%" -> "BadName"
Runs on save when dev mode is enabled.
Open to feedback/suggestions
Work was developed here. May also clone to preview parser
https://github.com/bertman12/wc3-magic-defense
The template already supports compile time object data constants by parsing the modification files. Currently it doesn't support custom objects, but if you want to add support for that you should make a PR to https://github.com/cipherxof/war3-objectdata, as I don't think parsing the WTS is the proper way to go about this.
Gotcha, I'll take a look at the other repo