Thread Tools Display Modes
Prev Previous Post   Next Post Next
05-20-23, 02:57 AM   #1
Shargul
A Defias Bandit
AddOn Author - Click to view addons
Join Date: Jun 2022
Posts: 3
Trouble handling SKILL_LINES_CHANGED event [WOTLK]

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,
  Reply With Quote
 

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Trouble handling SKILL_LINES_CHANGED event [WOTLK]


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off