mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-21 23:26:56 +00:00
bags: add /pfBagSort + /pfBankSort buttons
Inline the bag sorter from Bagnon/lib/BagSort.lua — two-pointer stack consolidation, then a category-then-name sort with poor (gray) items placed back-to-front so they sit at the end of the last bag. Sort buttons land in the existing button row on both the bag (right) and bank (left) frames. Fixes a destructuring mismatch in the port: pfUI's compat/vanilla.lua shims GetItemInfo to the modern 10-field return signature (inserts nil for itemLevel between quality and minlevel), so itype/subtype sit at positions 6/7 — not 5/6 like the Bagnon original assumes against raw vanilla. Without the extra placeholder every item fell through to the "non-gear by quality" bucket.
This commit is contained in:
+4
-1
@@ -132,7 +132,10 @@ pfUI:RegisterModule("bags", function ()
|
||||
for slot = 1, numSlots do
|
||||
local itemId = C_Container.GetContainerItemID(bag, slot)
|
||||
if itemId then
|
||||
local name, _, quality, _, itype, subtype = GetItemInfo(itemId)
|
||||
-- pfUI's compat layer shims GetItemInfo to the modern 10-field
|
||||
-- signature (inserts nil for itemLevel between quality and
|
||||
-- minlevel) — so itype/subtype sit at positions 6/7, not 5/6.
|
||||
local name, _, quality, _, _, itype, subtype = GetItemInfo(itemId)
|
||||
local _, count = GetContainerItemInfo(bag, slot)
|
||||
local item = {
|
||||
key = SortKey(itemId, name, itype, subtype, quality, count),
|
||||
|
||||
Reference in New Issue
Block a user