Originally Posted by haste
Not to be completely evil (but quite a bit). Think about exactly what you logically want to do (all the steps of hooking and calling), and what you are doing now.
Or put in another way: Explain to yourself exactly what your code does every time you execute those two functions.
|
Made it a bit cleaner, now trying to get what you mean, hmmm
The first self shouldn't be there, it affect the unitframe instead of the exp bar frame maybe, but if it's not there it doesn't work at all... hmmm
Code:
self:SetScript("OnEnter", function(self)
local origOnEnter = self.Experience:GetScript("OnEnter")
self.Experience:SetScript('OnEnter', function(self,...) self:SetAlpha(1) origOnEnter(self, ...) end)
end)
self:SetScript("OnLeave", function(self)
local origOnLeave = self.Experience:GetScript("OnLeave")
self.Experience:SetScript('OnLeave', function(self, ...) self:SetAlpha(0) origOnLeave(self,...) end)
end)