Ok, I'll see if I understand this correctly:
Lua Code:
local function TooltipHook(tooltipControl, method, linkFunc)
local origMethod = tooltipControl[method] -- saving the original method
tooltipControl[method] = function(self, ...) -- redefining the method for the tooltipControl object
origMethod(self, ...) -- do whatever it was supposed to before
AddRuneInfo(self, GetRuneInfoText(linkFunc(...))) -- do additional stuff using the function for the item link
end
end
Am I correct in assuming this only needs to be called once because it just overwrites the original function and it then doesn't require a hook every time it's called? I am somewhat confused as HookBagTips() passes in ItemTooltip to the tooltipControl, I think at first I thought it had to be a defined variable pulled from the game, but this is just actually generally letting us rewrite the functions for any ItemTooltip? I apologize for being a noob with LUA.
With that method, do I still need to use something like ZO_PreHook or an event manager per tooltip? I would guess it only needs to run once. I will try it with SecurePostHook and see where that gets me. Thanks so much!