Ketho / vscode-wow-api

VS Code extension for World of Warcraft AddOns
https://marketplace.visualstudio.com/items?itemName=ketho.wow-api
MIT License
143 stars 31 forks source link

Adding more WoW-specific types would be helpful #41

Closed Arxareon closed 2 years ago

Arxareon commented 2 years ago

Hey!

I find myself adding more and more @alias definitions as I work - some of the complex types which are missing from the extension's definitions (or I couldn't find them - in that case a documentation in the wiki with the list of currently supported types could be useful) would be cool to have.

See:

Examples:

For some of the types I didn't find official names so I just came up with one based on what made sense.

ChatTypeId image

I gave the name: https://wowpedia.fandom.com/wiki/API_GameTooltip_SetOwner#Arguments image

I gave the name: https://wowpedia.fandom.com/wiki/Hyperlinks#Types image

Also used for Widget API SetJustiyH & SetJustifyV: https://wowwiki-archive.fandom.com/wiki/XML/JUSTIFYH https://wowwiki-archive.fandom.com/wiki/XML/JUSTIFYV image


Type.lua:

I think these could be added to Type.lua, in fact I added the above mentioned examples already (changing it to a txt to be uploadable): Type.lua.txt

Ketho commented 2 years ago

Is there any API that accepts a hyperlink type as a parameter? I'm not sure if there otherwise is any use adding them

Arxareon commented 2 years ago

That specific one I use for a function to create hyperlink escape sequences. There is no API function I found at present that does this, but I'd still be useful to have. Maybe as an extension to the base API types - a separate onus file perhaps?

If you want to keep the extension, I'd totally understand that. I can define that alias within my project at the end of the day..

Thanks for looking into this, though! :) Let me know if I can help.

Ketho commented 2 years ago

Well it doesn't hurt I guess, I'll add the hyperlink one too.

Arxareon commented 2 years ago

@Ketho Some other candidates to be added could be classFilename, className, and classId. https://wowpedia.fandom.com/wiki/ClassId https://wowpedia.fandom.com/wiki/API_UnitClass

Similarly, race id types: https://wowpedia.fandom.com/wiki/RaceId

Ketho commented 2 years ago

I will add ClassFile but not ClassId since it feels kind of clunky to have it; only as an argument, as a return it also doesn't really feel useful. Similarly for RaceId, it would just be a list of numbers 1 to 37

also could you please open a new issue in the future :)

image

image

---@alias ClassId
---|1  # WARRIOR
---|2  # PALADIN
---|3  # HUNTER
---|4  # ROGUE
---|5  # PRIEST
---|6  # DEATHKNIGHT
---|7  # SHAMAN
---|8  # MAGE
---|9  # WARLOCK
---|10 # MONK
---|11 # DRUID
---|12 # DEMONHUNTER