-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIntegrations.lua
More file actions
66 lines (61 loc) · 2.18 KB
/
Copy pathIntegrations.lua
File metadata and controls
66 lines (61 loc) · 2.18 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
local VP = VendorPricePlus
local function SetPrice(tt, count, item)
VP:SetPrice(tt, false, "Integration", count, item, true)
end
function VP:IsShown(frame)
return frame and frame:IsVisible() and frame:IsMouseOver()
end
local Auctioneer = {
AucAdvAppraiserFrame = function(tt)
local itemID = select(2, tt:GetItem()):match("item:(%d+)")
for _, v in pairs(AucAdvAppraiserFrame.list) do
if v[1] == itemID then
SetPrice(tt, v[6])
break
end
end
end,
AucAdvSearchUiAuctionFrame = function(tt)
local row = tt:GetOwner():GetID()
local count = AucAdvanced.Modules.Util.SearchUI.Private.gui.sheet.rows[row][4]
SetPrice(tt, tonumber(count:GetText()))
end,
AucAdvSimpFrame = function(tt)
SetPrice(tt, AucAdvSimpFrame.detail[1])
end,
}
local function OnIntegrationTooltipSetItem(tt)
if AucAdvanced and VP:IsShown(AuctionFrame) then
for frame, func in pairs(Auctioneer) do
if VP:IsShown(_G[frame]) then
func(tt)
break
end
end
elseif AuctionFaster and VP:IsShown(AuctionFrame) and AuctionFrame.selectedTab >= 4 then
local count
if AuctionFrame.selectedTab == 4 then
local item = tt:GetOwner().item
count = item and item.count
elseif AuctionFrame.selectedTab == 5 then
local hoverRowData = AuctionFaster.hoverRowData
count = hoverRowData and hoverRowData.count
end
SetPrice(tt, count)
elseif AtlasLoot and VP:IsShown(_G["AtlasLoot_GUI-Frame"]) then
SetPrice(tt)
else
local mouseFocus = tt:GetOwner()
if mouseFocus and mouseFocus.GetObjectType and mouseFocus:GetObjectType() == "FontString" then
for i = 1, FCF_GetNumActiveChatFrames() do
if _G["ChatFrame"..i]:IsMouseOver() then
SetPrice(tt)
break
end
end
end
end
end
if GameTooltip and GameTooltip.HasScript and GameTooltip:HasScript("OnTooltipSetItem") then
GameTooltip:HookScript("OnTooltipSetItem", OnIntegrationTooltipSetItem)
end