isJunk item diversity

This commit is contained in:
Salikh Gurgenidze
2026-01-23 21:53:39 +04:00
parent 2e41bc6a16
commit 9657982cf6
6 changed files with 340 additions and 20 deletions
+35 -3
View File
@@ -625,7 +625,11 @@ function CategoryManager:EvaluateRule(rule, itemData, bagID, slotID, isOtherChar
elseif ruleType == "isJunk" then
-- Junk items: gray items (quality 0) OR white equippable items (quality 1 + Weapon/Armor)
-- EXCLUDES: profession tools (skinning knife, mining pick, fishing poles, etc.)
-- EXCLUDES:
-- 1. Trinkets, Rings, Necklaces (these typically have special effects)
-- 2. Profession tools (skinning knife, mining pick, fishing poles, etc.)
-- 3. Items with yellow description text (Use:, Equip:, Chance on hit: effects)
-- 4. Items with green description text (set bonuses, special properties)
local quality = itemData.quality
local isGray = false
local isWhiteEquip = false
@@ -642,9 +646,25 @@ function CategoryManager:EvaluateRule(rule, itemData, bagID, slotID, isOtherChar
if quality == 1 then
local itemClass = itemData.class or ""
local itemSubclass = itemData.subclass or ""
addon:Debug("isJunk check: quality=%s, class='%s', subclass='%s', name='%s'", tostring(quality), tostring(itemClass), tostring(itemSubclass), tostring(itemData.name))
if itemClass == "Weapon" or itemClass == "Armor" then
-- In Turtle WoW, equip slot info is in itemSubType, not itemEquipLoc
local itemSubclass = itemData.subclass or ""
addon:Debug("isJunk check: name='%s', subclass='%s', class='%s'",
tostring(itemData.name), tostring(itemSubclass), tostring(itemClass))
-- EXCLUDE: Trinkets, Rings, Necklaces, Tabards, Shirts - these typically have special effects or are cosmetic
-- Check by itemSubType which contains INVTYPE_* values in Turtle WoW
local isSpecialSlot = (itemSubclass == "INVTYPE_TRINKET" or
itemSubclass == "INVTYPE_FINGER" or
itemSubclass == "INVTYPE_NECK" or
itemSubclass == "INVTYPE_TABARD" or
itemSubclass == "INVTYPE_BODY")
if isSpecialSlot then
addon:Debug("isJunk: EXCLUDED (trinket/ring/neck/tabard/shirt) - %s (subclass=%s)", tostring(itemData.name), tostring(itemSubclass))
return false == ruleValue
end
-- Check if this is a profession tool (should NOT be junk)
local isProfessionTool = false
@@ -663,7 +683,19 @@ function CategoryManager:EvaluateRule(rule, itemData, bagID, slotID, isOtherChar
addon:Debug("isJunk: PROFESSION TOOL (by subtype) - %s", tostring(itemData.name))
end
if not isProfessionTool then
-- Check for special tooltip text (yellow/green descriptions)
-- These items have Use:, Equip:, or special effects and should NOT be junk
local hasSpecialText = false
if not isProfessionTool and not isOtherChar then
if addon.Modules.Utils and addon.Modules.Utils.HasSpecialTooltipText then
hasSpecialText = addon.Modules.Utils:HasSpecialTooltipText(bagID, slotID, itemData.link)
if hasSpecialText then
addon:Debug("isJunk: HAS SPECIAL TEXT (Use:/Equip:/green) - %s", tostring(itemData.name))
end
end
end
if not isProfessionTool and not hasSpecialText then
isWhiteEquip = true
addon:Debug("isJunk: WHITE EQUIP DETECTED - %s", tostring(itemData.name))
end