I've been recently updating my TBC addon to WOTLK and found that an event is fired that wasn't fired previously, that is, SKILL_LINES_CHANGED. For context, the addon displays the % chance of a successful skill-up for the items on your tradeskill frame. Previously this was easily implementable by using hooksecurefunc on the TradeSkillFrame_Update() function, like so:
Code:
-- Hook onto TradeSkillFrame_Update and append percentages to the end of spells
hooksecurefunc('TradeSkillFrame_Update', function()
if TradeSkillFrame:IsShown() then
local profName = core:GetProfessionName()
local tradeLevel = core:GetProfessionLevel()
local maxLevel = select(3, GetTradeSkillLine())
if maxLevel ~= tradeLevel then
for i=1, TRADE_SKILLS_DISPLAYED do
core:UpdateTradeSkill(i, profName)
end
end
end
end)
This code would fire on TRADE_SKILL_UPDATE and work perfectly, at least until WOTLK came around.
Now, a new event called SKILL_LINES_CHANGED fires after TRADE_SKILL_UPDATE if you receive a skill-up from crafting and it resets the text my addon appended to the skill names. This results in the percentages flickering on and off at seemingly random and makes the addon very unpleasant to use.
Example (Before & after SKILL_LINES_CHANGED fires):
https://imgur.com/PwCmfuq
https://imgur.com/T8HSCWz
My problem is I have no idea how to fix this. I found using the /api command that SKILL_LINES_CHANGED belongs to the "SkillInfo" system. I tried to find the source code for this so I could hooksecurefunc onto whatever function was being called by this event to undo the resetting of my appended text but I couldn't find anything online. I was thinking maybe theres an alternative way of fixing this that I can't seem to find?
Any help would be very appeciated,