View Single Post
07-30-19, 10:28 AM   #3
LudiusMaximus
A Rage Talon Dragon Guard
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 321
Thanks a lot, this helped me a great deal already.

But copying a tooltip line is not so straight forward, is it?

First of all, I have to check if it is a single or double line by checking
Code:
if (_G[self:GetName().."TextRight"..i]:GetText()) then

And then I have to not just copy the text content but also the formating.

For instance, if I want to duplicate the last line, I would do:

Code:
local copyText = _G["GameTooltipTextLeft"..GameTooltip:NumLines()]:GetText()
local copyR, copyG, copyB = _G["GameTooltipTextLeft"..GameTooltip:NumLines()]:GetTextColor()

GameTooltip:AddLine(copyText, copyR, copyG, copyB)
But what about the wrapText attribute of a tooltip line?
I could not find the equivalent to GetText() and GetTextColor() for that.

I tried _G["GameTooltipTextLeft"..GameTooltip:NumLines()]:CanNonSpaceWrap() but this always returns false.
EDIT: The same for GetIndentedWordWrap().

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