View Single Post
07-30-19, 03:38 PM   #4
LudiusMaximus
A Rage Talon Dragon Guard
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 320
When I apply SetText() to a tooltip line like
Code:
_G["GameTooltipTextLeft1"]:SetText("bla", 1, 0, 0, 1, true)
it does not even change the text colour. Only the text is updated.

So if I want to have the same text colours in the modified tooltip, I would have to built my copy tooltip from scratch only using AddLine() and AddDoubleLine().


EDIT: This is not viable either. When I do GameTooltip:ClearLines() and refill the tooltip with my stored plus added lines, future calls of GameTooltip:GetItem() will only get nil, as the item is apparently cleared by ClearLines().

I can overcome this by

Code:
local originalGetItem = GameTooltip.GetItem
GameTooltip:HookScript("OnHide", function(self)
  GameTooltip.GetItem = originalGetItem
end)

and

Code:
local name, link = GameTooltip:GetItem()
GameTooltip:ClearLines()
GameTooltip.GetItem = function(self) return name, link end
But this is getting more and more cumbersome...

Last edited by LudiusMaximus : 07-30-19 at 05:12 PM.
  Reply With Quote