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:
Brues
2026-05-27 23:21:30 -05:00
parent 6cf5ef4468
commit 9a618e4709
+4 -1
View File
@@ -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),