-
Notifications
You must be signed in to change notification settings - Fork 0
/
BorderHelper.lua
43 lines (38 loc) · 1.37 KB
/
BorderHelper.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
local RB = RetailBags
function CreateBorder(frame, itemQuality, itemClass, isActiveQuest)
if (itemQuality == Enum.ItemQuality.Poor) then
if (frame.RetailBagsBorder) then
frame.RetailBagsBorder:Hide();
end
else
if (not frame.RetailBagsBorder) then
local f = frame:CreateTexture('ItemButtonBorder', 'OVERLAY');
f:SetSize(frame:GetWidth(), frame:GetHeight());
f:SetPoint("CENTER", 0, 0);
frame.RetailBagsBorder = f;
end
if (itemClass == Enum.ItemClass.Questitem) then
if (isActiveQuest) then
frame.RetailBagsBorder:SetTexture(TEXTURE_ITEM_QUEST_BORDER);
else
frame.RetailBagsBorder:SetTexture(TEXTURE_ITEM_QUEST_BANG);
end
frame.RetailBagsBorder:SetVertexColor(1, 1, 1);
else
frame.RetailBagsBorder:SetTexture([[Interface\Common\WhiteIconFrame]]);
local color;
if (itemClass == Enum.ItemClass.Tradegoods and RB.DB.profile.makeReagentBordersBlue) then
color = CreateColor(0.300, 0.780, 0.875);
elseif (itemClass == Enum.ItemClass.Consumable and RB.DB.profile.makeConsumableBordersColored) then
color = CreateColor(0.700, 0.280, 0.575);
else
color = BAG_ITEM_QUALITY_COLORS[itemQuality];
end
if (color) then
RB.Core:Debug("Adding border " .. color.r .. " " .. color.g .. " " .. color.b);
frame.RetailBagsBorder:SetVertexColor(color.r, color.g, color.b);
end
end
frame.RetailBagsBorder:Show();
end
end