feat: category type rules

This commit is contained in:
Salikh Gurgenidze
2026-01-19 14:06:25 +04:00
parent 29a68d4853
commit d282ec27b9
3 changed files with 757 additions and 3 deletions
+12 -1
View File
@@ -31,7 +31,7 @@ local DEFAULT_CATEGORIES = {
{ type = "isBoE", value = true }
},
matchMode = "all",
priority = 60,
priority = 75,
enabled = true,
isBuiltIn = true,
},
@@ -322,6 +322,13 @@ function CategoryManager:MigrateCategories()
addon:Debug("CategoryManager: Migrated Drink category to use restoreTag")
end
end
-- Migrate BoE priority to be higher than Weapon/Armor (75 > 70)
local boeCat = cats.definitions["BoE"]
if boeCat and boeCat.isBuiltIn and boeCat.priority and boeCat.priority < 75 then
boeCat.priority = 75
addon:Debug("CategoryManager: Migrated BoE priority to 75")
end
end
-- Get all categories
@@ -492,6 +499,10 @@ function CategoryManager:EvaluateRule(rule, itemData, bagID, slotID, isOtherChar
elseif ruleType == "quality" then
return itemData.quality == ruleValue
elseif ruleType == "qualityMin" then
-- Minimum quality check (item quality >= ruleValue)
return (itemData.quality or 0) >= (ruleValue or 0)
elseif ruleType == "isBoE" then
if isOtherChar then return false end
if itemData.class ~= "Weapon" and itemData.class ~= "Armor" then