diff --git a/Core/CategoryManager.lua b/Core/CategoryManager.lua index cc913b4..b74b50a 100644 --- a/Core/CategoryManager.lua +++ b/Core/CategoryManager.lua @@ -618,8 +618,10 @@ function CategoryManager:EvaluateRule(rule, itemData, bagID, slotID, isOtherChar -- Check for white equippable items (quality 1 + Weapon/Armor) if quality == 1 then local itemClass = itemData.class or "" + addon:Debug("isJunk check: quality=%s, class='%s', name='%s'", tostring(quality), tostring(itemClass), tostring(itemData.name)) if itemClass == "Weapon" or itemClass == "Armor" then isWhiteEquip = true + addon:Debug("isJunk: WHITE EQUIP DETECTED - %s", tostring(itemData.name)) end end @@ -687,9 +689,23 @@ end function CategoryManager:CategorizeItem(itemData, bagID, slotID, isOtherChar) local sortedCats = self:GetCategoriesByPriority() + -- Debug: show white item categorization + if itemData.quality == 1 and (itemData.class == "Weapon" or itemData.class == "Armor") then + addon:Debug("Categorizing white equip: %s (class=%s, quality=%s)", tostring(itemData.name), tostring(itemData.class), tostring(itemData.quality)) + for i, entry in ipairs(sortedCats) do + addon:Debug(" Cat %d: %s (priority=%s, enabled=%s)", i, entry.id, tostring(entry.def.priority), tostring(entry.def.enabled)) + if i > 10 then break end -- Limit debug output + end + end + for _, entry in ipairs(sortedCats) do if not entry.def.isFallback then - if self:EvaluateCategoryRules(entry.def, itemData, bagID, slotID, isOtherChar) then + local matches = self:EvaluateCategoryRules(entry.def, itemData, bagID, slotID, isOtherChar) + -- Debug: show which category matched for white equip + if itemData.quality == 1 and (itemData.class == "Weapon" or itemData.class == "Armor") and matches then + addon:Debug(" -> MATCHED: %s", entry.id) + end + if matches then return entry.id end end diff --git a/Sorting/SortEngine.lua b/Sorting/SortEngine.lua index 2eb8b89..708078e 100644 --- a/Sorting/SortEngine.lua +++ b/Sorting/SortEngine.lua @@ -590,10 +590,17 @@ local function AddSortKeys(items) item.isMount = isMount -- Class and slot ordering - if itemRarity == 0 or IsItemGrayTooltip(item.bagID, item.slot, item.data.link) then + -- Check for items that should be treated as junk: + -- 1. Gray items (quality 0) + -- 2. Items with gray tooltip + -- 3. White equippable items (quality 1 Weapon/Armor) - vendor trash + local isGrayItem = itemRarity == 0 or IsItemGrayTooltip(item.bagID, item.slot, item.data.link) + local isWhiteEquip = (itemRarity == 1) and (itemCategory == "Weapon" or itemCategory == "Armor") + + if isGrayItem or isWhiteEquip then item.sortedClass = CATEGORY_ORDER["Junk"] or 99 item.equipSlotOrder = 999 - item.isEquippable = false -- Treat gray gear as junk, not gear + item.isEquippable = false -- Treat junk gear as junk, not gear elseif isEquippable then item.sortedClass = 1 -- All equippable gear gets priority class item.equipSlotOrder = EQUIP_SLOT_ORDER[itemSubType] or 999 @@ -1042,12 +1049,19 @@ local function BuildGreyTailPositions(bagIDs, greyCount) return tailSlots end --- Split a list of collected items into non-greys and greys (quality 0) +-- Split a list of collected items into non-junk and junk items +-- Junk includes: gray items (quality 0), gray tooltip items, white equippable items (quality 1 Weapon/Armor) local function SplitGreyItems(items) local nonGreys, greys = {}, {} for _, item in ipairs(items) do - -- Use same logic as AddSortKeys for determining Junk/Grey status (stability) - if tonumber(item.quality or 0) == 0 or IsItemGrayTooltip(item.bagID, item.slot, item.data.link) then + -- Use same logic as AddSortKeys for determining Junk status (stability) + local quality = tonumber(item.quality or 0) + local isGray = quality == 0 or IsItemGrayTooltip(item.bagID, item.slot, item.data.link) + -- White equippable items (Weapon/Armor) are also treated as junk + local itemClass = item.class or "" + local isWhiteEquip = (quality == 1) and (itemClass == "Weapon" or itemClass == "Armor") + + if isGray or isWhiteEquip then table.insert(greys, item) else table.insert(nonGreys, item)