Quantcast Adding line of text to player tooltip - WoWInterface
Thread Tools Display Modes
09-13-19, 07:13 AM   #1
MinguasBeef
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: May 2019
Posts: 17
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)
  Reply With Quote
09-13-19, 07:25 AM   #2
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,739
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
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
09-13-19, 09:30 AM   #3
MinguasBeef
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: May 2019
Posts: 17
Originally Posted by zork View Post
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!
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Adding line of text to player tooltip

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off