fix: auto sell junk items
This commit is contained in:
@@ -1346,6 +1346,15 @@ function CategoryManager:SyncEquipmentSetCategories()
|
||||
insertPos = table.getn(cats.order) + 1
|
||||
end
|
||||
end
|
||||
if not insertPos then
|
||||
-- Insert before Junk category if it exists, otherwise at end of Main group
|
||||
for i, orderId in ipairs(cats.order) do
|
||||
if orderId == "Junk" then
|
||||
insertPos = i
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
if not insertPos then
|
||||
for i = table.getn(cats.order), 1, -1 do
|
||||
local existDef = cats.definitions[cats.order[i]]
|
||||
|
||||
@@ -130,6 +130,12 @@ function DB:Initialize()
|
||||
if Guda_CharDB.settings.markEquipmentSets == nil then
|
||||
Guda_CharDB.settings.markEquipmentSets = true
|
||||
end
|
||||
if Guda_CharDB.settings.autoVendorJunk == nil then
|
||||
Guda_CharDB.settings.autoVendorJunk = true
|
||||
end
|
||||
if Guda_CharDB.settings.whiteItemsJunk == nil then
|
||||
Guda_CharDB.settings.whiteItemsJunk = false
|
||||
end
|
||||
|
||||
-- Initialize CategoryManager for custom categories
|
||||
if addon.Modules.CategoryManager then
|
||||
|
||||
@@ -241,8 +241,12 @@ local function DetectJunk(lines, itemData)
|
||||
end
|
||||
end
|
||||
|
||||
-- White equippable items might be junk
|
||||
if quality == 1 and (itemClass == "Weapon" or itemClass == "Armor") then
|
||||
-- White equippable items might be junk (only if whiteItemsJunk setting is enabled)
|
||||
local whiteItemsJunk = false
|
||||
if addon and addon.Modules and addon.Modules.DB then
|
||||
whiteItemsJunk = addon.Modules.DB:GetSetting("whiteItemsJunk")
|
||||
end
|
||||
if quality == 1 and whiteItemsJunk and (itemClass == "Weapon" or itemClass == "Armor") then
|
||||
-- Exclusions: trinkets, rings, necklaces, tabards, shirts
|
||||
local subLower = string.lower(itemSubclass)
|
||||
if string.find(subLower, "trinket") or
|
||||
|
||||
Reference in New Issue
Block a user