View Single Post
08-22-22, 02:25 PM   #2
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
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:
  1. function TooltipCallback(tooltip)
  2.     local unitName, unitId = tooltip:GetUnit()
  3.     tooltip:AddLine(unitName)
  4.     tooltip:Show()
  5. end
  6.  
  7. GameTooltip:HookScript("OnTooltipSetUnit", TooltipCallback)
  Reply With Quote