- 825496a17dd3f0d7730da3e45ab7fd703c40e62c
- ElvUI/modules/bags/sort.lua | 31 ++++++++-----------------------
- 1 file changed, 8 insertions(+), 23 deletions(-)
- diff --git a/ElvUI/modules/bags/sort.lua b/ElvUI/modules/bags/sort.lua
- index 999d544..d5f5184 100644
- --- a/ElvUI/modules/bags/sort.lua
- +++ b/ElvUI/modules/bags/sort.lua
- @@ -75,7 +75,6 @@ local bagStacks = {};
- local bagMaxStacks = {};
- local bagGroups = {};
- local initialOrder = {};
- ---local itemTypes, itemSubTypes
- local bagSorted, bagLocked = {}, {};
- local bagRole
- local moves = {};
- @@ -139,18 +138,6 @@ local function IsGuildBankBag(bagid)
- return (bagid > 50 and bagid <= 58)
- end
- ---[[local function BuildSortOrder()
- - itemTypes = {}
- - itemSubTypes = {}
- - for i, iType in ipairs({GetAuctionItemClasses()}) do
- - itemTypes[iType] = i
- - itemSubTypes[iType] = {}
- - for ii, isType in ipairs({GetAuctionItemSubClasses(i)}) do
- - itemSubTypes[iType][isType] = ii
- - end
- - end
- -end]]
- -
- local function UpdateLocation(from, to)
- if (bagIDs[from] == bagIDs[to]) and (bagStacks[to] < bagMaxStacks[to]) then
- local stackSize = bagMaxStacks[to]
- @@ -218,8 +205,8 @@ local function DefaultSort(a, b)
- end
- end
- - local _, _, aRarity, _, _, aType, aSubType, _, aEquipLoc = GetItemInfo(aID)
- - local _, _, bRarity, _, _, bType, bSubType, _, bEquipLoc = GetItemInfo(bID)
- + local _, _, aRarity, _, _, _, _, _, aEquipLoc, _, _, aItemClassId, aItemSubClassId = GetItemInfo(aID)
- + local _, _, bRarity, _, _, _, _, _, bEquipLoc, _, _, bItemClassId, bItemSubClassId = GetItemInfo(bID)
- if bagPetIDs[a] then
- aRarity = 1
- @@ -233,11 +220,11 @@ local function DefaultSort(a, b)
- return aRarity > bRarity
- end
- - --[[if itemTypes[aType] ~= itemTypes[bType] then
- - return (itemTypes[aType] or 99) < (itemTypes[bType] or 99)
- - end]]
- + if aItemClassId ~= bItemClassId then
- + return (aItemClassId or 99) < (bItemClassId or 99)
- + end
- - if aType == ARMOR or aType == ENCHSLOT_WEAPON then
- + if aItemClassId == LE_ITEM_CLASS_ARMOR or aItemClassId == LE_ITEM_CLASS_WEAPON then
- local aEquipLoc = inventorySlots[aEquipLoc] or -1
- local bEquipLoc = inventorySlots[bEquipLoc] or -1
- if aEquipLoc == bEquipLoc then
- @@ -248,12 +235,11 @@ local function DefaultSort(a, b)
- return aEquipLoc < bEquipLoc
- end
- end
- - if aSubType == bSubType then
- + if (aItemClassId == bItemClassId) and (aItemSubClassId == bItemSubClassId) then
- return PrimarySort(a, b)
- end
- - --return (({})[aSubType] or 99) < (({})[bSubType] or 99)
- - return false
- + return (aItemSubClassId or 99) < (bItemSubClassId or 99)
- end
- local function ReverseSort(a, b)
- @@ -545,7 +531,6 @@ end
- function B.Sort(bags, sorter, invertDirection)
- if not sorter then sorter = invertDirection and ReverseSort or DefaultSort end
- - --if not itemTypes then BuildSortOrder() end
- twipe(blackListedSlots)