WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Professions API for BFA and the expansion-specific skills? (https://www.wowinterface.com/forums/showthread.php?t=56531)

CC_WOW 08-12-18 03:16 PM

Professions API for BFA and the expansion-specific skills?
 
Greetings,

I'm trying to find out the skill levels for each expansion's profession (Legion Cooking etc.). Before 8.0.1, I simply used GetProfessions() and then GetProfessionInfo(), which would provide me with the desired data. Now, it merely tells me that I have 100/100 in Legion Cooking (or whatever is the highest skill being displayed in the UI), but there's no info whatsoever about the other ones. This doesn't help me very much, unfortunately.

Is there a simple way to do this? I've searched these forums, Google, and FrameXML/Blizzard's UI but I didn't find so much as a hint. I noticed that I could detect the individual expansion-specific spells by ID, but that doesn't help in finding the exact skill level they're at.

Thanks for your time!

p3lim 08-12-18 04:11 PM

You need to query each category using C_TradeSkillUI.GetCategoryInfo(categoryID).
This returns a table populated with the name of the category, "skillLineCurrentLevel" and "skillLineMaxLevel" for cur/max.
(sidenote: skillLine == profession)

Here's a full list of possible category IDs: https://github.com/p3lim-wow/LibProc....lua#L509-L620

To get the category data the profession data must be loaded, which you can do by registering the "TRADE_SKILL_SHOW" event and calling C_TradeSkillUI.OpenTradeSkill(professionID).
Profession IDs can be found in the same list as above.

The downside of this is that you actually have to open the profession to get the information, which can trigger a boatload of issues for you when users of your addon uses other addons who also do something when the data is loaded or the profession UI is shown.

I've petitioned Blizzard for an alternate way of retrieving the data without opening the profession completely, but the response was "unlikely".


All times are GMT -6. The time now is 03:09 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI