Thread Tools Display Modes
01-01-15, 10:45 AM   #1
necroskillz
A Murloc Raider
Join Date: Jan 2015
Posts: 4
Scanning tooltip missing 9th line

Hi,

I can't figure out this issue i have with hidden scanning tooltip. I use standard code to initialize it:

Code:
    local scanningTooltip = CreateFrame("GameTooltip", "StatWeightScore_ScanningTooltip", nil, "GameTooltipTemplate");
    scanningTooltip:AddFontStrings(
        scanningTooltip:CreateFontString("$parentTextLeft1", nil, "GameTooltipText"),
        scanningTooltip:CreateFontString("$parentTextRight1", nil, "GameTooltipText"));
then i Populate it with an item link

Code:
    local scanningTooltip = StatWeightScore_ScanningTooltip;
    scanningTooltip:SetOwner(WorldFrame, "ANCHOR_NONE");
    scanningTooltip:SetHyperlink(link);
then iterate over lines:

Code:
    for l = 1,tooltip:NumLines() do
        local tooltipText = getglobal(tooltip:GetName().."TextLeft"..l);
    end
for the 9th line the tooltip text is nil.

when i show the tooltip in game, it's cut off at 9th line (8th line is empty string in this case):



however the code above can read 10th and lines after it fine. only the 9th is missing.

any insight is appreciated.
  Reply With Quote
01-01-15, 10:49 AM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
If you inherit from the GameTooltipTemplate you do not need to manually add fontstrings. I'm not sure if that's what's causing your problem, but removing that would be the first thing I'd try.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
01-01-15, 11:28 AM   #3
necroskillz
A Murloc Raider
Join Date: Jan 2015
Posts: 4
that was indeed the issue, thx man <3
  Reply With Quote
01-01-15, 01:43 PM   #4
Talyrius
An Onyxian Warder
 
Talyrius's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 363
Originally Posted by necroskillz View Post
Code:
    for l = 1,tooltip:NumLines() do
        local tooltipText = getglobal(tooltip:GetName().."TextLeft"..l);
    end
Don't use getglobal(). It has long since been deprecated. Instead, do this:

Code:
    for l = 1,tooltip:NumLines() do
        local tooltipText = _G[tooltip:GetName().."TextLeft"..l];
    end
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Scanning tooltip missing 9th line


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