1. 825496a17dd3f0d7730da3e45ab7fd703c40e62c
  2. ElvUI/modules/bags/sort.lua | 31 ++++++++-----------------------
  3. 1 file changed, 8 insertions(+), 23 deletions(-)
  4. diff --git a/ElvUI/modules/bags/sort.lua b/ElvUI/modules/bags/sort.lua
  5. index 999d544..d5f5184 100644
  6. --- a/ElvUI/modules/bags/sort.lua
  7. +++ b/ElvUI/modules/bags/sort.lua
  8. @@ -75,7 +75,6 @@ local bagStacks = {};
  9. local bagMaxStacks = {};
  10. local bagGroups = {};
  11. local initialOrder = {};
  12. ---local itemTypes, itemSubTypes
  13. local bagSorted, bagLocked = {}, {};
  14. local bagRole
  15. local moves = {};
  16. @@ -139,18 +138,6 @@ local function IsGuildBankBag(bagid)
  17. return (bagid > 50 and bagid <= 58)
  18. end
  19. ---[[local function BuildSortOrder()
  20. - itemTypes = {}
  21. - itemSubTypes = {}
  22. - for i, iType in ipairs({GetAuctionItemClasses()}) do
  23. - itemTypes[iType] = i
  24. - itemSubTypes[iType] = {}
  25. - for ii, isType in ipairs({GetAuctionItemSubClasses(i)}) do
  26. - itemSubTypes[iType][isType] = ii
  27. - end
  28. - end
  29. -end]]
  30. -
  31. local function UpdateLocation(from, to)
  32. if (bagIDs[from] == bagIDs[to]) and (bagStacks[to] < bagMaxStacks[to]) then
  33. local stackSize = bagMaxStacks[to]
  34. @@ -218,8 +205,8 @@ local function DefaultSort(a, b)
  35. end
  36. end
  37. - local _, _, aRarity, _, _, aType, aSubType, _, aEquipLoc = GetItemInfo(aID)
  38. - local _, _, bRarity, _, _, bType, bSubType, _, bEquipLoc = GetItemInfo(bID)
  39. + local _, _, aRarity, _, _, _, _, _, aEquipLoc, _, _, aItemClassId, aItemSubClassId = GetItemInfo(aID)
  40. + local _, _, bRarity, _, _, _, _, _, bEquipLoc, _, _, bItemClassId, bItemSubClassId = GetItemInfo(bID)
  41. if bagPetIDs[a] then
  42. aRarity = 1
  43. @@ -233,11 +220,11 @@ local function DefaultSort(a, b)
  44. return aRarity > bRarity
  45. end
  46. - --[[if itemTypes[aType] ~= itemTypes[bType] then
  47. - return (itemTypes[aType] or 99) < (itemTypes[bType] or 99)
  48. - end]]
  49. + if aItemClassId ~= bItemClassId then
  50. + return (aItemClassId or 99) < (bItemClassId or 99)
  51. + end
  52. - if aType == ARMOR or aType == ENCHSLOT_WEAPON then
  53. + if aItemClassId == LE_ITEM_CLASS_ARMOR or aItemClassId == LE_ITEM_CLASS_WEAPON then
  54. local aEquipLoc = inventorySlots[aEquipLoc] or -1
  55. local bEquipLoc = inventorySlots[bEquipLoc] or -1
  56. if aEquipLoc == bEquipLoc then
  57. @@ -248,12 +235,11 @@ local function DefaultSort(a, b)
  58. return aEquipLoc < bEquipLoc
  59. end
  60. end
  61. - if aSubType == bSubType then
  62. + if (aItemClassId == bItemClassId) and (aItemSubClassId == bItemSubClassId) then
  63. return PrimarySort(a, b)
  64. end
  65. - --return (({})[aSubType] or 99) < (({})[bSubType] or 99)
  66. - return false
  67. + return (aItemSubClassId or 99) < (bItemSubClassId or 99)
  68. end
  69. local function ReverseSort(a, b)
  70. @@ -545,7 +531,6 @@ end
  71. function B.Sort(bags, sorter, invertDirection)
  72. if not sorter then sorter = invertDirection and ReverseSort or DefaultSort end
  73. - --if not itemTypes then BuildSortOrder() end
  74. twipe(blackListedSlots)