Earlier Versions
Name | Size | Uploaded | Game Version | Downloads | |
ProfessionsDataInitializer v1.4.zip release | 3.47 KB | Jan 24, 2023 | 10.0.2 | 23 | Download |
ProfessionsDataInitializer v1.3.zip release | 2.45 KB | Jan 21, 2023 | 10.0.2 | 6 | Download |
Description
Professions Data Initializer: A library to initialize the professions data by opening the hardware event protected Professions Frame. It took me some time to find a way to open the frame that didn’t require any user interaction as all other methods caused Attempt to call protected function errors…
This lua file is NOT an ADDON. It must be put into YOUR addon to function and YOUR toc file to work.
This is needed so C_TradeSkillUI.GetProfessionInfoBySkillLineID(skillLine) can return the actual data for known professions or you get no current level / max level data when you call it.
The data remains up to date once the panel has been opened for the rest of the session (That I have found) so the panel only needs to be opened once.
It does only 2 things when normally running… Toggles the new hardware event protected ProfessionsFrame and lets you know if it was able to open it. That is it. If it finds that you don’t know any professions it will register itself to be re-ran once you learn one.
This script opens the new Professions Frame if you know any professions (Either primary or secondary) once the World is displayed. If you don’t know any professions then there is nothing this script can do, however it will stop running if it can’t do anything and it will let your addon know that it failed (see below). By using this file instead of rolling your own solution you will prevent multiple addons from doing the same thing by all opening and closing the spell book and Professions Frame.
This file will set a global named ProfessionsDataInitialized once the data is available.
It will also call: (depending if it worked)
EventRegistry:TriggerEvent(“ProfessionDataInitializer.success”)
or
EventRegistry:TriggerEvent(“ProfessionDataInitializer.failed”, reason)
Just put this script into your *.toc file (preferably) as the first loaded file and it will take care of the work by itself and also prevent other addons that use this script from opening and closing the frames by detecting that this script has already been loaded
Supported Profession Addon Frames:
Should now do ALL addons as it is toggling the frame directly from the spellbook for both opening and closing of the frame
Let me know about any errors when controlling other trade skill addon frames and I will try to fix any issues closing them too
Add a comment