Thread Tools Display Modes
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
05-20-23, 05:50 PM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
If memory serves they added some Dragonflight API into the Wrath mix. But I could be wrong.


Anyway, this is a 4 month old link to the tradeskill blizzard file from Classic Wrath so hopefully it will provide you with some clues on what you need to change. I've not played with TradeSkill stuff enough, and definitely not recently to offer any suggestions outside of what you already know from earlier incarnations of your addon.

https://github.com/Gethe/wow-ui-sour...adeSkillUI.lua
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
05-20-23, 11:04 PM   #3
Shargul
A Defias Bandit
AddOn Author - Click to view addons
Join Date: Jun 2022
Posts: 3
Originally Posted by Xrystal View Post
If memory serves they added some Dragonflight API into the Wrath mix. But I could be wrong.


Anyway, this is a 4 month old link to the tradeskill blizzard file from Classic Wrath so hopefully it will provide you with some clues on what you need to change. I've not played with TradeSkill stuff enough, and definitely not recently to offer any suggestions outside of what you already know from earlier incarnations of your addon.

https://github.com/Gethe/wow-ui-sour...adeSkillUI.lua
Thanks. I tried hooking onto a handful of functions here hoping it'd solve something but to no avail :/. It seems that the function that is being called is likely not included in the code for any of the blizzard interface addons.

Would there possibly be a way for me to explicitly call the TradeSkillFrame_Update() function from my own add-on? or is that something that's forbidden due to the object oriented nature of lua or since it's actually Blizzard's own code.
  Reply With Quote
05-21-23, 01:40 PM   #4
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
If it's a public function you can call it or hook into it. Just be aware of in combat situations that may cause issues.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  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