WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   Adding line of text to player tooltip (https://www.wowinterface.com/forums/showthread.php?t=57481)

MinguasBeef 09-13-19 07:13 AM

Adding line of text to player tooltip
 
I've been having trouble getting this to work...

I want it so that when I mouse over a player, or unit that there will be an extra line of text in the tooltip window.

I tried hooking SetUnit, but didn't have any luck.

Code:

function AdditionalUnitText(unit)
        GameTooltip:AddLine("Test", 1, 1, 1)
        GameTooltip:Show()
end
hooksecurefunc(GameTooltip,"SetUnit",AdditionalUnitText)


zork 09-13-19 07:25 AM

You can do it like so:
lua Code:
  1. GameTooltip:HookScript("OnTooltipSetUnit", OnTooltipSetUnit)
https://github.com/zorker/rothui/blo.../core.lua#L211
https://github.com/zorker/rothui/blo...p/core.lua#L44

MinguasBeef 09-13-19 09:30 AM

Quote:

Originally Posted by zork (Post 333716)
You can do it like so:
lua Code:
  1. GameTooltip:HookScript("OnTooltipSetUnit", OnTooltipSetUnit)
https://github.com/zorker/rothui/blo.../core.lua#L211
https://github.com/zorker/rothui/blo...p/core.lua#L44

Perfect thank you!


All times are GMT -6. The time now is 06:24 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI