I want to call the GetAuctionItemInfo api on mouse hover of an auction listing. I thought I could grab the ah index off of the frame name but I can't do that reliably.
Lua Code:
local function SetGameToolTipPrice(tt)
if (AuctionFrameBrowse:IsVisible()) then
local container = GetMouseFocus()
local ahIndex = container:GetName()
--Prints "BrowseButton1Item", "BrowseButton2Item", "BrowseButton3Item", etc.
--up until 8 (max items viewable without scrolling)!
print(ahIndex)
--call GetAuctionItemInfo(), with index stripped from ahIndex
end
end
GameTooltip:HookScript("OnTooltipSetItem", SetGameToolTipPrice)
This works perfect if the listing is only a few items and has no scrollbar. The problem occurs when scrolling down a listing, the "first" listing you see is always "BrowseButton1Item" and the "last" is always "BrowseButton8Item". This leaves me without a useful index to call GetAuctionItemInfo with.