View Single Post
09-11-18, 06:28 AM   #4
Xruptor
A Flamescale Wyrmkin
 
Xruptor's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 137
Another way to see if a player will be removing a skill , as a pre-check and post check you can use the following. Since this is the popup they get before a skill is removed.

Code:
hooksecurefunc("StaticPopup_Show", function(event, skillName, skillLine)
  if (event == "UNLEARN_SKILL") then
    --do something here, but remember they haven't accepted yet, grab skillName and skillLine
  end
end)
But if you want to grab the OnAccept of the dialog above you can do the following.

Code:
hooksecurefunc(StaticPopupDialogs["UNLEARN_SKILL"], "OnAccept", function(self, data)
	--do something here
end)

To be honest AbandonSkill is the best way to do it. But just wanted to post another possible way of checking for player intentions.
__________________
Click HERE for the ultimate idiot test.

if (sizeof(sadness) > sizeof(happiness)) { initDepression(); }
  Reply With Quote