Originally Posted by Phanx
I don't have time to look over it in detail at the moment, but I did notice:
Code:
local function HookHandler(self, event, func)
self:HookScript(event, func)
end
for i = 1, NUM_CHAT_WINDOWS do
local chatframe = _G["ChatFrame" .. i]
HookHandler(chatframe, "OnHyperLinkEnter", MouseHoverToolTip_Show)
HookHandler(chatframe, "OnHyperLinkLeave", MouseHoverToolTip_Hide)
end
What is the purpose of the HookHandler script? Why spend memory and CPU time wrapping :HookScript in a second function like that when you can just call it directly:
Code:
for i = 1, NUM_CHAT_WINDOWS do
local chatframe = _G["ChatFrame" .. i]
chatframe:HookScript("OnHyperLinkEnter", MouseHoverToolTip_Show)
chatframe:HookScript("OnHyperLinkLeave", MouseHoverToolTip_Hide)
end
|
Makes sense - thanks
also seems more readable to me!