-
Notifications
You must be signed in to change notification settings - Fork 0
/
AuctionFrameHelper.lua
50 lines (45 loc) · 1.72 KB
/
AuctionFrameHelper.lua
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
local RB = RetailBags
function RB:InitAuctionBrowseItems()
if (AuctionFrameBrowse:IsVisible()) then
local type = "list";
local frameName = "BrowseButton";
local offset = FauxScrollFrame_GetOffset(BrowseScrollFrame);
RB:InitAuctionItems(type, frameName, offset);
end
end
function RB:InitAuctionOwnedItems()
if (AuctionFrame:IsVisible()) then
local type = "owner";
local frameName = "AuctionsButton";
RB:InitAuctionItems(type, frameName, 0);
end
end
function RB:InitAuctionBidItems()
if (AuctionFrame:IsVisible()) then
local type = "bidder";
local frameName = "BidButton";
RB:InitAuctionItems(type, frameName, 0);
end
end
function RB:InitAuctionItems(type, frameName, offset)
local auctionItems = GetNumAuctionItems(type);
if (auctionItems > 0) then
for index = 1, auctionItems do
local name, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, itemId, _ = GetAuctionItemInfo(type, offset + index);
if (name) then
local frame = _G[frameName .. index .. "Item"];
if (frame) then
if (not RB.DB.profile.displayItemQualityBorders) then
if (frame.RetailBagsBorder) then
frame.RetailBagsBorder:Hide();
end
else
local itemName, _, quality, itemLevel, _, _, _, stack, slot, _, sellPrice, classId, subClassId, bindType, expacID, setID, isCraftingReagent =
GetItemInfo(itemId);
CreateBorder(frame, quality, classId, false);
end
end
end
end
end
end