-
Notifications
You must be signed in to change notification settings - Fork 0
/
LootFrameHelper.lua
56 lines (47 loc) · 1.9 KB
/
LootFrameHelper.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
51
52
53
54
55
56
local RB = RetailBags
function RB:InitLootFrame()
if (LootFrame.numLootItems) then
RB.Core:Debug("LootFrame shown " .. LootFrame.numLootItems .. " " .. LOOTFRAME_NUMBUTTONS);
if (LootFrame.numLootItems > 0) then
local numLootItems = LootFrame.numLootItems;
local numLootToShow = LOOTFRAME_NUMBUTTONS;
if (numLootItems > LOOTFRAME_NUMBUTTONS) then
numLootToShow = numLootToShow - 1;
end
for index = 1, LOOTFRAME_NUMBUTTONS do
RB:LootFrame_UpdateButton(numLootToShow, index);
end
end
end
end
function RB:LootFrame_UpdateButton(numLootToShow, index)
local frame = _G["LootButton" .. index];
if (not frame) then
return;
end
if (RB.DB.profile.displayItemQualityBorders) then
local slot = (numLootToShow * (LootFrame.page - 1)) + index;
local lootIcon, lootName, lootQuantity, currencyID, lootQuality, locked, isQuestItem, questID, isActive =
GetLootSlotInfo(slot);
if (lootName and not currencyID) then
if lootQuality then
local slotLink = GetLootSlotLink(slot);
if (slotLink) then
local itemName, _, quality, itemLevel, _, _, _, stack, slot, _, sellPrice, classId, subClassId, bindType, expacID, setID, isCraftingReagent =
GetItemInfo(slotLink);
if (itemName) then
local isActiveQuest = true;
if (isQuestItem and questID) then
isActiveQuest = isActive;
end
CreateBorder(frame, quality, classId, isActiveQuest);
return;
end
end
end
end
end
if (frame.RetailBagsBorder) then
frame.RetailBagsBorder:Hide();
end
end