mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 08:24:44 +00:00
test sort
This commit is contained in:
@@ -48,11 +48,8 @@ local SEARCH = SEARCH
|
||||
local SEARCH_STRING = ""
|
||||
|
||||
B.ProfessionColors = {
|
||||
["8"] = {224/255, 187/255, 74/255}, -- Leatherworking
|
||||
["16"] = {18/255, 181/255, 32/255}, -- Herbs
|
||||
["32"] = {160/255, 3/255, 168/255}, -- Enchanting
|
||||
["64"] = {232/255, 118/255, 46/255}, -- Engineering
|
||||
["128"] = {105/255, 79/255, 7/255}, -- Mining
|
||||
["8"] = {18/255, 181/255, 32/255}, -- Herbs
|
||||
["16"] = {160/255, 3/255, 168/255}, -- Enchanting
|
||||
}
|
||||
|
||||
function B:GetContainerFrame(arg)
|
||||
@@ -449,7 +446,7 @@ function B:Layout(isBank)
|
||||
end
|
||||
|
||||
f.Bags[bagID].numSlots = numSlots
|
||||
f.Bags[bagID].type = GetItemFamily(GetInventoryItemLink("player", ContainerIDToInventoryID(bagID)))
|
||||
f.Bags[bagID].type = GetBagFamily(GetInventoryItemLink("player", ContainerIDToInventoryID(bagID)))
|
||||
|
||||
--Hide unused slots
|
||||
for i = 1, MAX_CONTAINER_ITEMS do
|
||||
|
||||
@@ -258,7 +258,7 @@ local function IterateForwards(bagList, i)
|
||||
end
|
||||
|
||||
local function IterateBackwards(bagList, i)
|
||||
i = i + 1
|
||||
--[[i = i + 1
|
||||
local step = 1
|
||||
for ii = getn(bagList), 1, -1 do
|
||||
local bag = bagList[ii]
|
||||
@@ -273,6 +273,21 @@ local function IterateBackwards(bagList, i)
|
||||
step = step + 1
|
||||
end
|
||||
end
|
||||
end]]
|
||||
i = i + 1
|
||||
local step = 1
|
||||
for _, bag in bagList do
|
||||
local slots = B:GetNumSlots(bag)
|
||||
if i > slots + step then
|
||||
step = step + slots
|
||||
else
|
||||
for slot = 1, slots do
|
||||
if step == i then
|
||||
return i, bag, slot
|
||||
end
|
||||
step = step + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
bagRole = nil
|
||||
end
|
||||
@@ -376,7 +391,7 @@ function B:IsSpecialtyBag(bagID)
|
||||
local bag = GetInventoryItemLink("player", inventorySlot)
|
||||
if not bag then return false end
|
||||
|
||||
local family = GetItemFamily(bag)
|
||||
local family = GetBagFamily(bag)
|
||||
if family == 0 or family == nil then return false end
|
||||
|
||||
return family
|
||||
@@ -385,13 +400,13 @@ end
|
||||
function B:CanItemGoInBag(bag, slot, targetBag)
|
||||
local item = bagIDs[B:Encode_BagSlot(bag, slot)]
|
||||
local itemFamily = GetItemFamily(item)
|
||||
if itemFamily and itemFamily > 0 then
|
||||
if itemFamily then
|
||||
local equipSlot = select(8, GetItemInfo(item))
|
||||
if equipSlot == "INVTYPE_BAG" then
|
||||
itemFamily = 1
|
||||
end
|
||||
end
|
||||
local bagFamily = GetItemFamily(targetBag)
|
||||
local bagFamily = GetBagFamily(GetInventoryItemLink("player", ContainerIDToInventoryID(targetBag)))
|
||||
if itemFamily then
|
||||
return (bagFamily == 0) or band(itemFamily, bagFamily) > 0
|
||||
else
|
||||
@@ -482,7 +497,7 @@ function B.Sort(bags, sorter, invertDirection)
|
||||
local link = B:GetItemLink(bag, slot)
|
||||
local id = B:GetItemID(bag, slot)
|
||||
|
||||
if id then
|
||||
if link then
|
||||
if blackList[GetItemInfo(id)] then
|
||||
blackListedSlots[bagSlot] = true
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user