Originally Posted by Kanegasi
You can name the arguments whatever you want. The first one provided here will be the tooltip frame and you can skip the vararg (...).
As for the line not working, you need to use :Show() for custom lines to render. You should also use the tooltip frame object you already have, not GameTooltip.
Finally, you should put the hook after defining the function. TooltipCallback does not exist where you are using it. You weren't getting an error since nil is a valid argument to HookScript.
Lua Code:
function TooltipCallback(tooltip) local unitName, unitId = tooltip:GetUnit() tooltip:AddLine(unitName) tooltip:Show() end GameTooltip:HookScript("OnTooltipSetUnit", TooltipCallback)
|
Thank you!
Anyway, my addon is not working... How do you debug addons? Because I even don't know where is the problem.