WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   GameTooltip Issue (https://www.wowinterface.com/forums/showthread.php?t=58409)

sgkdnay 11-26-20 05:41 PM

GameTooltip Issue
 
Trying to understand GameTooltip but for some reason not working as intended (reading tooltips)

Code:

function vQC_ToolTips(self)
        local lines = self:NumLines()
        print(lines)
        for i = 1, lines do
                local txtL = getglobal(self:GetName() .. "TextLeft" .. i)
                if txtL:GetText() ~= nil then
                        if txtL:GetText() == "Quest ID" then
                                local txtR = getglobal(self:GetName() .. "TextRight" .. i)
                                print("Found it "..txtR:GetText())
                        end
                end
        end
end
GameTooltip:HookScript("OnShow", vQC_ToolTips)

Some would give me information, other will not.
This will NOT give me QuestID into chat, also x.Numlines shows 3 when it's 11
http://prntscr.com/vqv2ya
But this one will, while this x.NumLines shows 12 properly
https://prnt.sc/vqv3fx

So what am i missing? Im trying to extract all information from whomever's addon's tooltip created

SDPhantom 11-26-20 06:44 PM

What exactly is your goal? Depending on what you intend to do, there are probably better ways in getting this info than tooltip scanning.

sgkdnay 11-26-20 06:57 PM

Just reading the tooltip, was looking for LeftText "Quest ID" then pull the info on RightText with actual "#". No modification or anything.

SDPhantom 11-27-20 12:17 AM

Reading tooltips is a desperate last-ditch effort to get information. From your screenshots, another addon is putting that into there, which means it's getting it form somewhere else to display it. The only thing I can suggest at this time is to look at that addon's code to see where it's getting that information from.

If you need further help, I need to know what addon you're trying to grab this from. If there's more to your code, it'll help to show all of it for context.

sgkdnay 11-27-20 12:40 AM

Its trying to read from AllTheThings.lua that generate tooltips. Most tooltip I could read and pull information, some cannot. I might have to ask the author and see if something can be fixed in regard to tooltip or of some sort.

SDPhantom 11-27-20 03:20 AM

If you're really set on tooltips, you might try looking at ItemRefTooltip that handles chat links.


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

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