wc3-ts-template icon indicating copy to clipboard operation
wc3-ts-template copied to clipboard

WTS File Parser and Enum Generator

Open bertman12 opened this issue 1 year ago • 2 comments

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

bertman12 avatar Jan 07 '24 21:01 bertman12

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.

image

cipherxof avatar Jan 07 '24 21:01 cipherxof

Gotcha, I'll take a look at the other repo

bertman12 avatar Jan 07 '24 21:01 bertman12