mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 08:24:44 +00:00
update bags
This commit is contained in:
@@ -279,6 +279,13 @@ local bagTypes = {
|
||||
}
|
||||
|
||||
function GetItemFamily(id)
|
||||
if not id then return end
|
||||
if type(id) == "table" or type(id) == "function" then return end
|
||||
|
||||
if type(id) == "string" then
|
||||
id = match(id, "item:(%d+)")
|
||||
end
|
||||
|
||||
local _, _, _, _, _, itemType = GetItemInfo(id)
|
||||
return bagTypes[itemType]
|
||||
end
|
||||
|
||||
@@ -449,11 +449,7 @@ function B:Layout(isBank)
|
||||
end
|
||||
|
||||
f.Bags[bagID].numSlots = numSlots
|
||||
local link = GetInventoryItemLink("player", ContainerIDToInventoryID(bagID))
|
||||
if link then
|
||||
local _, _, id = strfind(link, "item:(%d+)")
|
||||
f.Bags[bagID].type = GetItemFamily(id)
|
||||
end
|
||||
f.Bags[bagID].type = GetItemFamily(GetInventoryItemLink("player", ContainerIDToInventoryID(bagID)))
|
||||
|
||||
--Hide unused slots
|
||||
for i = 1, MAX_CONTAINER_ITEMS do
|
||||
|
||||
@@ -371,7 +371,7 @@ function B:IsSpecialtyBag(bagID)
|
||||
local bag = GetInventoryItemLink("player", inventorySlot)
|
||||
if not bag then return false end
|
||||
|
||||
local family = GetItemFamily(match(bag, "item:(%d+)"))
|
||||
local family = GetItemFamily(bag)
|
||||
if family == 0 or family == nil then return false end
|
||||
|
||||
return family
|
||||
@@ -379,14 +379,14 @@ end
|
||||
|
||||
function B:CanItemGoInBag(bag, slot, targetBag)
|
||||
local item = bagIDs[B:Encode_BagSlot(bag, slot)]
|
||||
local itemFamily = GetItemFamily(match(item, "item:(%d+)"))
|
||||
local itemFamily = GetItemFamily(item)
|
||||
if itemFamily then
|
||||
local equipSlot = select(8, GetItemInfo(item))
|
||||
if equipSlot == "INVTYPE_BAG" then
|
||||
itemFamily = 1
|
||||
end
|
||||
end
|
||||
local bagFamily = GetItemFamily(match(targetBag, "item:(%d+)"))
|
||||
local bagFamily = GetItemFamily(targetBag)
|
||||
if itemFamily then
|
||||
return (bagFamily == 0) or band(itemFamily, bagFamily) > 0
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user