-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtooltips.lua
More file actions
34 lines (24 loc) · 1.32 KB
/
Copy pathtooltips.lua
File metadata and controls
34 lines (24 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
local ids = LibStub("tekIDmemo")
local origs = {}
local OnTooltipSetItem = function(frame, ...)
assert(frame, "arg 1 is nil, someone isn't hooking correctly")
local _, link = frame:GetItem()
if link then
local id = ids[link]
local min, max, count = tekauc.mins[id], tekauc.maxes[id], tekauc.counts[id]
local _, _, _, _, _, _, _, maxStack = GetItemInfo(id)
if min then frame:AddDoubleLine("AH buyout:", max and max ~= min and (tekauc:GS(min).." - "..tekauc:GS(max)) or tekauc:GS(min)) end
if min and (maxStack or 0) > 1 then frame:AddDoubleLine("AH stack buyout:", max and max ~= min and (tekauc:GS(min*maxStack).." - "..tekauc:GS(max*maxStack)) or tekauc:GS(min*maxStack)) end
if count then frame:AddDoubleLine("Number on AH:", count)
elseif tekauc.manualprices[id] then frame:AddDoubleLine("Manual price:", tekauc:GS(tekauc.manualprices[id])) end
local owner = frame:GetOwner()
if frame == GameTooltip and min and owner and owner.hasItem and AuctionFrame:IsVisible() and owner:GetParent():GetID() ~= KEYRING_CONTAINER then
frame:AddLine("Alt-click to post on AH", 1, 0, 0.5)
end
end
if origs[frame] then return origs[frame](frame, ...) end
end
for i,frame in pairs{GameTooltip, ItemRefTooltip} do
origs[frame] = frame:GetScript("OnTooltipSetItem")
frame:SetScript("OnTooltipSetItem", OnTooltipSetItem)
end