EDIT: Nevermind, I eventually figured it out.
Sigh - I have the following code:
Code:
print("==LOADED==")
MyScanningTooltip = CreateFrame( "GameTooltip", "MyScanningTooltip", nil, "GameTooltipTemplate" ); -- Tooltip name cannot be nil
MyScanningTooltip:SetOwner( WorldFrame, "ANCHOR_NONE" );
MyScanningTooltip:ClearLines()
local function EnumerateTooltipLines_helper(...)
print("EnumerateTooltipLines_helper")
for i = 1, select("#", ...) do
print(i)
local region = select(i, ...)
if region and region:GetObjectType() == "FontString" then
local text = region:GetText() -- string or nil
if text ~= nil then
print("=="..text.."==")
else
print("NIL!")
end
end
end
end
function EnumerateTooltipLines(tooltip) -- good for script handlers that pass the tooltip as the first argument.
EnumerateTooltipLines_helper(tooltip:GetRegions())
end
MyScanningTooltip:ClearLines()
MyScanningTooltip:SetBagItem(bagID, bagSlotID);
EnumerateTooltipLines_helper(MyScanningTooltip:GetRegions())
Problem is, it returns a lot of nil lines, and I'm not entirely sure how tooltip scanning is supposed to work. Help?