update bags

This commit is contained in:
Crum
2018-11-15 15:02:45 -06:00
parent dbdb8066e0
commit 6edc3249da
+8 -3
View File
@@ -840,22 +840,25 @@ function B:FormatMoney(amount)
end
function B:GetGraysValue()
local value, itemLink, rarity, itype, stackCount, stackPrice, _ = 0
local value, itemLink, rarity, itemPrice, itype, stackCount, stackPrice, _ = 0
for bag = 0, NUM_BAG_FRAMES do
for slot = 1, GetContainerNumSlots(bag) do
itemLink = GetContainerItemLink(bag, slot)
if itemLink then
_, _, rarity, _, _, itype = GetItemInfo(match(itemLink, "item:(%d+)"))
itemPrice = LIP:GetSellValue(itemLink)
print(itype)
if itemPrice then
stackCount = select(2, GetContainerItemInfo(bag, slot)) or 1
stackPrice = LIP:GetSellValue(itemLink) * stackCount
stackPrice = itemPrice * stackCount
if (rarity and rarity == 0) and (itype and itype ~= "Quest") and (stackPrice and stackPrice > 0) then
value = value + stackPrice
end
end
end
end
end
return value
end
@@ -1291,12 +1294,14 @@ end
function B:OpenBags()
self.BagFrame:Show()
self.BagFrame:UpdateAllSlots()
PlaySound("igBackPackOpen")
E:GetModule("Tooltip"):GameTooltip_SetDefaultAnchor(GameTooltip)
end
function B:CloseBags()
self.BagFrame:Hide()
PlaySound("igBackPackClose")
if self.BankFrame then
self.BankFrame:Hide()