View Single Post
08-23-22, 07:20 AM   #3
nyxxir
A Defias Bandit
Join Date: Aug 2022
Posts: 2
Originally Posted by Kanegasi View Post
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)
Thank you!
Anyway, my addon is not working... How do you debug addons? Because I even don't know where is the problem.
  Reply With Quote