From 83314f574ca8e5b1cc8bee701308e5c54c6a53f1 Mon Sep 17 00:00:00 2001 From: Anthony Narkevicius Date: Mon, 1 Dec 2025 10:30:54 -0800 Subject: [PATCH] Deconstruction blacklist (#89) * Missing Non-DE items * Move Deconstruct options into seperate group Adds blacklist functionality for general items and lockboxes * Add translation strings * Add LibItemSearch functionality to blacklist * Clean up redundant variables and API calls --- ElvUI/Locales/deDE.lua | 8 ++ ElvUI/Locales/enUS.lua | 8 ++ ElvUI/Locales/esMX.lua | 8 ++ ElvUI/Locales/frFR.lua | 8 ++ ElvUI/Locales/koKR.lua | 8 ++ ElvUI/Locales/ptBR.lua | 8 ++ ElvUI/Locales/ruRU.lua | 8 ++ ElvUI/Locales/zhCN.lua | 8 ++ ElvUI/Locales/zhTW.lua | 8 ++ ElvUI/Modules/Bags/Deconstruct.lua | 158 +++++++++++++++++++----- ElvUI/Settings/Global.lua | 2 + ElvUI/Settings/Profile.lua | 2 + ElvUI_OptionsUI/Bags.lua | 185 +++++++++++++++++++++++++++-- 13 files changed, 380 insertions(+), 39 deletions(-) diff --git a/ElvUI/Locales/deDE.lua b/ElvUI/Locales/deDE.lua index 23c4451..ca63fec 100644 --- a/ElvUI/Locales/deDE.lua +++ b/ElvUI/Locales/deDE.lua @@ -72,6 +72,14 @@ L["Count"] = "Zähler" L["Current state: %s."] = "Klicken zum Umschalten.\nAktueller Status: %s." L["Deconstruct Mode"] = "Zerlegen Modus" L["Deconstruct Mode Desc"] = "Ermöglicht das Entzaubern, Mahlen, Sondieren und Öffnen von Gegenständen." +L["Deconstruct Blacklist"] = "Ausschlussliste für Zerlegen" +L["Deconstruct Blacklist (Profile)"] = "Ausschlussliste für Zerlegen (Profil)" +L["Deconstruct Blacklist (Global)"] = "Ausschlussliste für Zerlegen (Global)" +L["Lockbox Blacklist"] = "Ausschlussliste für Schließkisten" +L["Lockbox Blacklist (Profile)"] = "Ausschlussliste für Schließkisten (Profil)" +L["Lockbox Blacklist (Global)"] = "Ausschlussliste für Schließkisten (Global)" +L["Add an item or search syntax to the deconstruct blacklist."] = "Füge einen Gegenstand oder Suchbegriff zur Ausschlussliste für Zerlegen hinzu." +L["Add an item or search syntax to the lockbox blacklist."] = "Füge einen Gegenstand oder Suchbegriff zur Ausschlussliste für Schließkisten hinzu." L["DND"] = "DND" L["DPS"] = "DPS" L["Dark"] = "Dunkel" diff --git a/ElvUI/Locales/enUS.lua b/ElvUI/Locales/enUS.lua index f7d6b53..e1e1dfa 100644 --- a/ElvUI/Locales/enUS.lua +++ b/ElvUI/Locales/enUS.lua @@ -75,6 +75,14 @@ L["Count"] = true L["Current state: %s."] = "Click to toggle.\nCurrent state: %s." L["Deconstruct Mode"] = true L["Deconstruct Mode Desc"] = "Allow you to disenchant/mill/prospect/unlock items." +L["Deconstruct Blacklist"] = "Deconstruct Blacklist" +L["Deconstruct Blacklist (Profile)"] = "Deconstruct Blacklist (Profile)" +L["Deconstruct Blacklist (Global)"] = "Deconstruct Blacklist (Global)" +L["Lockbox Blacklist"] = "Lockbox Blacklist" +L["Lockbox Blacklist (Profile)"] = "Lockbox Blacklist (Profile)" +L["Lockbox Blacklist (Global)"] = "Lockbox Blacklist (Global)" +L["Add an item or search syntax to the deconstruct blacklist."] = "Add an item or search syntax to the deconstruct blacklist." +L["Add an item or search syntax to the lockbox blacklist."] = "Add an item or search syntax to the lockbox blacklist." L["DND"] = true L["DPS"] = true L["Dark"] = true diff --git a/ElvUI/Locales/esMX.lua b/ElvUI/Locales/esMX.lua index 39d70f5..d9bf9e2 100644 --- a/ElvUI/Locales/esMX.lua +++ b/ElvUI/Locales/esMX.lua @@ -72,6 +72,14 @@ L["Count"] = "Contador" L["Current state: %s."] = "Haz clic para alternar.\nEstado actual: %s." L["Deconstruct Mode"] = "Modo Deconstruir" L["Deconstruct Mode Desc"] = "Permite desencantar, moler, prospectar y abrir objetos." +L["Deconstruct Blacklist"] = "Lista negra de deconstrucción" +L["Deconstruct Blacklist (Profile)"] = "Lista negra de deconstrucción (Perfil)" +L["Deconstruct Blacklist (Global)"] = "Lista negra de deconstrucción (Global)" +L["Lockbox Blacklist"] = "Lista negra de cofres" +L["Lockbox Blacklist (Profile)"] = "Lista negra de cofres (Perfil)" +L["Lockbox Blacklist (Global)"] = "Lista negra de cofres (Global)" +L["Add an item or search syntax to the deconstruct blacklist."] = "Agrega un objeto o sintaxis de búsqueda a la lista negra de deconstrucción." +L["Add an item or search syntax to the lockbox blacklist."] = "Agrega un objeto o sintaxis de búsqueda a la lista negra de cofres." L["DND"] = "Oc" L["DPS"] = "DPS" L["Dark"] = "Oscuro" diff --git a/ElvUI/Locales/frFR.lua b/ElvUI/Locales/frFR.lua index 747bed7..5ffd1f4 100644 --- a/ElvUI/Locales/frFR.lua +++ b/ElvUI/Locales/frFR.lua @@ -72,6 +72,14 @@ L["Count"] = "Nombre" L["Current state: %s."] = "Cliquez pour basculer.\nÉtat actuel : %s." L["Deconstruct Mode"] = "Mode Déconstruction" L["Deconstruct Mode Desc"] = "Permet de désenchanter, moudre, prospecter et déverrouiller des objets." +L["Deconstruct Blacklist"] = "Liste noire de déconstruction" +L["Deconstruct Blacklist (Profile)"] = "Liste noire de déconstruction (Profil)" +L["Deconstruct Blacklist (Global)"] = "Liste noire de déconstruction (Global)" +L["Lockbox Blacklist"] = "Liste noire des coffres" +L["Lockbox Blacklist (Profile)"] = "Liste noire des coffres (Profil)" +L["Lockbox Blacklist (Global)"] = "Liste noire des coffres (Global)" +L["Add an item or search syntax to the deconstruct blacklist."] = "Ajoute un objet ou une syntaxe de recherche à la liste noire de déconstruction." +L["Add an item or search syntax to the lockbox blacklist."] = "Ajoute un objet ou une syntaxe de recherche à la liste noire des coffres." L["DND"] = "OQP" L["DPS"] = "DPS" L["Dark"] = "Sombre" diff --git a/ElvUI/Locales/koKR.lua b/ElvUI/Locales/koKR.lua index ca25458..3e8eeba 100644 --- a/ElvUI/Locales/koKR.lua +++ b/ElvUI/Locales/koKR.lua @@ -72,6 +72,14 @@ L["Count"] = "갯수" L["Current state: %s."] = "클릭하여 전환합니다.\n현재 상태: %s." L["Deconstruct Mode"] = "분해 모드" L["Deconstruct Mode Desc"] = "마법 부여 분해, 가루로 만들기, 세공 및 잠금 해제를 할 수 있습니다." +L["Deconstruct Blacklist"] = "분해 제외 목록" +L["Deconstruct Blacklist (Profile)"] = "분해 제외 목록 (프로필)" +L["Deconstruct Blacklist (Global)"] = "분해 제외 목록 (전역)" +L["Lockbox Blacklist"] = "잠금 상자 제외 목록" +L["Lockbox Blacklist (Profile)"] = "잠금 상자 제외 목록 (프로필)" +L["Lockbox Blacklist (Global)"] = "잠금 상자 제외 목록 (전역)" +L["Add an item or search syntax to the deconstruct blacklist."] = "분해 제외 목록에 아이템 또는 검색 구문을 추가합니다." +L["Add an item or search syntax to the lockbox blacklist."] = "잠금 상자 제외 목록에 아이템 또는 검색 구문을 추가합니다." L["DND"] = "다른 용무 중" L["DPS"] = "DPS" L["Dark"] = "어두운 느낌" diff --git a/ElvUI/Locales/ptBR.lua b/ElvUI/Locales/ptBR.lua index 914d4cf..ee6a51b 100644 --- a/ElvUI/Locales/ptBR.lua +++ b/ElvUI/Locales/ptBR.lua @@ -72,6 +72,14 @@ L["Count"] = "Contar" L["Current state: %s."] = "Clique para alternar.\nEstado atual: %s." L["Deconstruct Mode"] = "Modo Desconstruir" L["Deconstruct Mode Desc"] = "Permite desencantar, moer, prospectar e desbloquear itens." +L["Deconstruct Blacklist"] = "Lista negra de desconstrução" +L["Deconstruct Blacklist (Profile)"] = "Lista negra de desconstrução (Perfil)" +L["Deconstruct Blacklist (Global)"] = "Lista negra de desconstrução (Global)" +L["Lockbox Blacklist"] = "Lista negra de baús trancados" +L["Lockbox Blacklist (Profile)"] = "Lista negra de baús trancados (Perfil)" +L["Lockbox Blacklist (Global)"] = "Lista negra de baús trancados (Global)" +L["Add an item or search syntax to the deconstruct blacklist."] = "Adicione um item ou sintaxe de pesquisa à lista negra de desconstrução." +L["Add an item or search syntax to the lockbox blacklist."] = "Adicione um item ou sintaxe de pesquisa à lista negra de baús trancados." L["DND"] = "NP" L["DPS"] = "DPS" L["Dark"] = "Escuro" diff --git a/ElvUI/Locales/ruRU.lua b/ElvUI/Locales/ruRU.lua index 4ac3b29..77431a3 100644 --- a/ElvUI/Locales/ruRU.lua +++ b/ElvUI/Locales/ruRU.lua @@ -72,6 +72,14 @@ L["Count"] = "Кол-во" L["Current state: %s."] = "Нажмите для переключения.\nТекущее состояние: %s." L["Deconstruct Mode"] = "Режим разборки" L["Deconstruct Mode Desc"] = "Позволяет распылять, измельчать, обрабатывать и вскрывать предметы." +L["Deconstruct Blacklist"] = "Черный список для разборки" +L["Deconstruct Blacklist (Profile)"] = "Черный список для разборки (Профиль)" +L["Deconstruct Blacklist (Global)"] = "Черный список для разборки (Глобально)" +L["Lockbox Blacklist"] = "Черный список для вскрытия" +L["Lockbox Blacklist (Profile)"] = "Черный список для вскрытия (Профиль)" +L["Lockbox Blacklist (Global)"] = "Черный список для вскрытия (Глобально)" +L["Add an item or search syntax to the deconstruct blacklist."] = "Добавьте предмет или синтаксис поиска в черный список для разборки." +L["Add an item or search syntax to the lockbox blacklist."] = "Добавьте предмет или синтаксис поиска в черный список для вскрытия." L["DND"] = "ДНД" L["DPS"] = "УВС" L["Dark"] = "Темная" diff --git a/ElvUI/Locales/zhCN.lua b/ElvUI/Locales/zhCN.lua index 49a8c01..3ede643 100644 --- a/ElvUI/Locales/zhCN.lua +++ b/ElvUI/Locales/zhCN.lua @@ -72,6 +72,14 @@ L["Count"] = "计数" L["Current state: %s."] = "点击切换。\n当前状态: %s。" L["Deconstruct Mode"] = "分解模式" L["Deconstruct Mode Desc"] = "允许你分解、碾磨、勘探和解锁物品。" +L["Deconstruct Blacklist"] = "分解黑名单" +L["Deconstruct Blacklist (Profile)"] = "分解黑名单(配置文件)" +L["Deconstruct Blacklist (Global)"] = "分解黑名单(全局)" +L["Lockbox Blacklist"] = "开锁黑名单" +L["Lockbox Blacklist (Profile)"] = "开锁黑名单(配置文件)" +L["Lockbox Blacklist (Global)"] = "开锁黑名单(全局)" +L["Add an item or search syntax to the deconstruct blacklist."] = "将物品或搜索语法添加到分解黑名单。" +L["Add an item or search syntax to the lockbox blacklist."] = "将物品或搜索语法添加到开锁黑名单。" L["DND"] = "忙碌" L["DPS"] = "伤害输出" L["Dark"] = "黑暗" diff --git a/ElvUI/Locales/zhTW.lua b/ElvUI/Locales/zhTW.lua index 5b53d8d..c48096b 100644 --- a/ElvUI/Locales/zhTW.lua +++ b/ElvUI/Locales/zhTW.lua @@ -72,6 +72,14 @@ L["Count"] = "計數" L["Current state: %s."] = "點擊切換。\n當前狀態: %s。" L["Deconstruct Mode"] = "分解模式" L["Deconstruct Mode Desc"] = "允許你分解、碾磨、勘探和解鎖物品。" +L["Deconstruct Blacklist"] = "分解黑名單" +L["Deconstruct Blacklist (Profile)"] = "分解黑名單(設定檔)" +L["Deconstruct Blacklist (Global)"] = "分解黑名單(全域)" +L["Lockbox Blacklist"] = "開鎖黑名單" +L["Lockbox Blacklist (Profile)"] = "開鎖黑名單(設定檔)" +L["Lockbox Blacklist (Global)"] = "開鎖黑名單(全域)" +L["Add an item or search syntax to the deconstruct blacklist."] = "將物品或搜尋語法新增到分解黑名單。" +L["Add an item or search syntax to the lockbox blacklist."] = "將物品或搜尋語法新增到開鎖黑名單。" L["DND"] = "忙碌" L["DPS"] = "傷害輸出" L["Dark"] = "黑暗" diff --git a/ElvUI/Modules/Bags/Deconstruct.lua b/ElvUI/Modules/Bags/Deconstruct.lua index 97583aa..b615241 100644 --- a/ElvUI/Modules/Bags/Deconstruct.lua +++ b/ElvUI/Modules/Bags/Deconstruct.lua @@ -9,6 +9,7 @@ local E, L, V, P, G = unpack(select(2, ...)) local B = E:GetModule("Bags") local D = B:NewModule("Deconstruct", "AceHook-3.0", "AceEvent-3.0") +local Search = E.Libs.ItemSearch -- Lua functions local _G = _G @@ -41,7 +42,14 @@ D.ItemTable = { ['70923'] = true, -- Sweater ['34486'] = true, -- Orgrimmar achievement fish ['11287'] = true, -- Lesser Magic Wand - ['11288'] = true -- Greater Magic Wand + ['11288'] = true, -- Greater Magic Wand + ['11289'] = true, -- Lesser Mystic Wand + ['11290'] = true, -- Greater Mystic Wand + ['4614'] = true, -- Pendant of Myzrael + ['20406'] = true, -- Twilight Cultist Mantle + ['20407'] = true, -- Twilight Cultist Robe + ['20408'] = true, -- Twilight Cultist Cowl + ['21766'] = true, -- Opal Necklace of Impact }, ['Cooking'] = { ['46349'] = true -- Chef's Hat @@ -60,6 +68,8 @@ D.ItemTable = { D.Keys = {} D.BlacklistDE = {} D.BlacklistLOCK = {} +D.BlacklistDEPatterns = {} +D.BlacklistLOCKPatterns = {} -- Profession spell names D.DEname = GetSpellInfo(13262) -- Disenchant @@ -107,33 +117,82 @@ end -- Helper function to check if player has a skeleton key local function HaveKey() for key in pairs(D.Keys) do if GetItemCount(key) > 0 then return key end end end --- Build blacklist from settings -function D:Blacklisting(skill) D['BuildBlacklist' .. skill](self) end +function D:Blacklisting(skill) + if skill == 'DE' then + D:BuildBlacklistDE() + elseif skill == 'LOCK' then + D:BuildBlacklistLOCK() + end +end -function D:BuildBlacklistDE(...) +function D:BuildBlacklistDE() wipe(D.BlacklistDE) - for index = 1, select('#', ...) do - local name = select(index, ...) - if name and name ~= "" then - local itemName = GetItemInfo(name) - if itemName then D.BlacklistDE[itemName] = true end + wipe(D.BlacklistDEPatterns) + local db = E.db.bags.deconstructBlacklist or {} + local g = E.global.bags.deconstructBlacklist or {} + + for key, value in pairs(db) do + if value and value ~= "" then + local entry = tostring(value) + entry = entry:match("^%s*(.-)%s*$") or entry + local itemName = GetItemInfo(entry) + if itemName then + D.BlacklistDE[itemName] = true + else + table.insert(D.BlacklistDEPatterns, entry) + end + end + end + + for key, value in pairs(g) do + if value and value ~= "" then + local entry = tostring(value) + entry = entry:match("^%s*(.-)%s*$") or entry + local itemName = GetItemInfo(entry) + if itemName then + D.BlacklistDE[itemName] = true + else + table.insert(D.BlacklistDEPatterns, entry) + end end end end -function D:BuildBlacklistLOCK(...) +function D:BuildBlacklistLOCK() wipe(D.BlacklistLOCK) - for index = 1, select('#', ...) do - local name = select(index, ...) - if name and name ~= "" then - local itemName = GetItemInfo(name) - if itemName then D.BlacklistLOCK[itemName] = true end + wipe(D.BlacklistLOCKPatterns) + local db = E.db.bags.lockBlacklist or {} + local g = E.global.bags.lockBlacklist or {} + + for key, value in pairs(db) do + if value and value ~= "" then + local entry = tostring(value) + entry = entry:match("^%s*(.-)%s*$") or entry + local itemName = GetItemInfo(entry) + if itemName then + D.BlacklistLOCK[itemName] = true + else + table.insert(D.BlacklistLOCKPatterns, entry) + end + end + end + + for key, value in pairs(g) do + if value and value ~= "" then + local entry = tostring(value) + entry = entry:match("^%s*(.-)%s*$") or entry + local itemName = GetItemInfo(entry) + if itemName then + D.BlacklistLOCK[itemName] = true + else + table.insert(D.BlacklistLOCKPatterns, entry) + end end end end -- Check if item can be disenchanted -function D:IsBreakable(itemId, itemName, itemQuality, equipSlot) +function D:IsBreakable(itemId, itemName, itemLink) if not itemId then return false end if type(itemId) == "number" then itemId = tostring(itemId) end @@ -141,24 +200,29 @@ function D:IsBreakable(itemId, itemName, itemQuality, equipSlot) if D.ItemTable['DoNotDE'][itemId] then return false end if D.ItemTable['Cooking'][itemId] then return false end if D.ItemTable['Fishing'][itemId] then return false end - if D.BlacklistDE[itemName] then return false end + if itemName and D.BlacklistDE[itemName] then return false end + + -- Check pattern blacklist using LibItemSearch (supports full search syntax) + for _, query in ipairs(D.BlacklistDEPatterns or {}) do + if query and query ~= "" then + local ok, result = pcall(Search.Matches, Search, itemLink or itemName, query) + if ok and result then + return false + end + end + end return true end -- Check if item is disenchantable -function D:IsDisenchantable(itemId) - if not itemId then return false end - - local itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount, itemEquipLoc = GetItemInfo(itemId) - if not itemName then return false end +function D:IsDisenchantable(itemId, itemName, itemLink, itemRarity, itemType, itemEquipLoc) + if not itemId or not itemName or not D.HasEnchanting then return false end -- Quality: 2=Uncommon, 3=Rare, 4=Epic if not itemRarity or itemRarity < 2 or itemRarity > 4 then return false end - if itemType ~= "Armor" and itemType ~= "Weapon" then return false end if not itemEquipLoc or itemEquipLoc == "" then return false end - if not D.HasEnchanting then return false end return true end @@ -398,6 +462,8 @@ function D:DeconstructParser() local itemId = tonumber(itemLink:match("item:(%d+)")) if not itemId then return end + local itemName, _, itemRarity, _, _, itemType, itemSubType, _, itemEquipLoc = GetItemInfo(itemId) + if InCombatLockdown() then return end -- Check what can be done with this item @@ -406,6 +472,21 @@ function D:DeconstructParser() -- Check for lockboxes local hasKey = HaveKey() if (D.HasPickLock or hasKey) and D:IsUnlockable(itemLink) then + -- Skip if lockbox is blacklisted (exact name or pattern) + if itemName then + if D.BlacklistLOCK[itemName] then + return + end + for _, query in ipairs(D.BlacklistLOCKPatterns or {}) do + if query and query ~= "" then + local ok, result = pcall(Search.Matches, Search, itemLink, query) + if ok and result then + return + end + end + end + end + r, g, b = 0, 1, 1 if D.HasPickLock then D:ApplyDeconstruct(itemLink, itemId, D.LOCKname, 'spell', r, g, b, owner) @@ -430,9 +511,8 @@ function D:DeconstructParser() end -- Check for disenchantable items (Enchanting only) - if D.HasEnchanting and D:IsDisenchantable(itemId) then - local itemName, _, itemQuality, _, _, _, _, _, equipSlot = GetItemInfo(itemId) - if D:IsBreakable(itemId, itemName, itemQuality, equipSlot) then + if D.HasEnchanting and D:IsDisenchantable(itemId, itemName, itemLink, itemRarity, itemType, itemEquipLoc) then + if D:IsBreakable(itemId, itemName, itemLink) then r, g, b = 0.5, 0, 1 D:ApplyDeconstruct(itemLink, itemId, D.DEname, 'spell', r, g, b, owner) return @@ -447,8 +527,25 @@ function D:CanProcessItem(itemLink, hasKey) local itemId = tonumber(itemLink:match("item:(%d+)")) if not itemId then return false end + local itemName, _, itemRarity, _, _, itemType, _, _, itemEquipLoc = GetItemInfo(itemId) + -- Check lockboxes (Rogues only) - if (D.HasPickLock or hasKey) and D:IsUnlockable(itemLink) then return true end + if (D.HasPickLock or hasKey) and D:IsUnlockable(itemLink) then + if itemName then + if D.BlacklistLOCK[itemName] then + return false + end + for _, query in ipairs(D.BlacklistLOCKPatterns or {}) do + if query and query ~= "" then + local ok, result = pcall(Search.Matches, Search, itemLink, query) + if ok and result then + return false + end + end + end + end + return true + end -- Check prospectable (Jewelcrafting only) if D.HasJewelcrafting and D:IsProspectable(itemId) then return true end @@ -457,9 +554,8 @@ function D:CanProcessItem(itemLink, hasKey) if D.HasInscription and D:IsMillable(itemId) then return true end -- Check disenchantable (Enchanting only) - if D.HasEnchanting and D:IsDisenchantable(itemId) then - local itemName, _, itemQuality, _, _, _, _, _, equipSlot = GetItemInfo(itemId) - if D:IsBreakable(itemId, itemName, itemQuality, equipSlot) then return true end + if D.HasEnchanting and D:IsDisenchantable(itemId, itemName, itemLink, itemRarity, itemType, itemEquipLoc) then + if D:IsBreakable(itemId, itemName, itemLink) then return true end end return false diff --git a/ElvUI/Settings/Global.lua b/ElvUI/Settings/Global.lua index 72d6f89..edda816 100644 --- a/ElvUI/Settings/Global.lua +++ b/ElvUI/Settings/Global.lua @@ -31,6 +31,8 @@ G.chat = { G.bags = { ignoredItems = {}, + deconstructBlacklist = {}, + lockBlacklist = {}, } G.nameplates = {} diff --git a/ElvUI/Settings/Profile.lua b/ElvUI/Settings/Profile.lua index 111ecaa..9404a2e 100644 --- a/ElvUI/Settings/Profile.lua +++ b/ElvUI/Settings/Profile.lua @@ -169,6 +169,8 @@ P.bags = { unlearnedVanityIcon = false, unlearnedWardrobeIcon = false, ignoredItems = {}, + deconstructBlacklist = {}, + lockBlacklist = {}, itemLevel = true, itemLevelThreshold = 1, itemLevelFont = "Homespun", diff --git a/ElvUI_OptionsUI/Bags.lua b/ElvUI_OptionsUI/Bags.lua index f6ad163..d23091f 100644 --- a/ElvUI_OptionsUI/Bags.lua +++ b/ElvUI_OptionsUI/Bags.lua @@ -149,13 +149,6 @@ E.Options.args.bags = { name = L["Disable Bank Sort"], set = function(info, value) E.db.bags[info[#info]] = value B:ToggleSortButtonState(true) end }, - deconstruct = { - order = 16, - type = "toggle", - name = L["Deconstruct Mode"], - desc = L["Deconstruct Mode Desc"], - set = function(info, value) E.db.bags[info[#info]] = value E:StaticPopup_Show("PRIVATE_RL") end - }, unlearnedVanityIcon = { order = 17, type = "toggle", @@ -792,9 +785,185 @@ E.Options.args.bags = { } } }, - search_syntax = { + deconstructGroup = { order = 10, type = "group", + name = L["Deconstruct Mode"], + disabled = function() return not E.Bags.Initialized end, + args = { + header = { + order = 1, + type = "header", + name = L["Deconstruct Mode"] + }, + description = { + order = 2, + type = "description", + name = L["Deconstruct Mode Desc"] + } + ,deconstruct = { + order = 3, + type = "toggle", + name = L["Enable"], + set = function(info, value) E.db.bags[info[#info]] = value E:StaticPopup_Show("PRIVATE_RL") end + }, + spacer = { + order = 4, + type = "description", + name = " " + }, + deconstructBlacklistGroup = { + order = 5, + type = "group", + name = L["Deconstruct Blacklist"], + guiInline = true, + args = { + addEntryProfile = { + order = 1, + type = "input", + name = L["Profile"], + desc = L["Add an item or search syntax to the deconstruct blacklist."], + get = function(info) return "" end, + set = function(info, value) + if value == "" or gsub(value, "%s+", "") == "" then return end + local itemID = match(value, "item:(%d+)") + E.db.bags.deconstructBlacklist[(itemID or value)] = value + local D = B:GetModule("Deconstruct") + if D and D.BuildBlacklistDE then D:BuildBlacklistDE() end + end + }, + spacer = { + order = 2, + type = "description", + name = " ", + width = "normal" + }, + addEntryGlobal = { + order = 3, + type = "input", + name = L["Global"], + desc = L["Add an item or search syntax to the deconstruct blacklist."], + get = function(info) return "" end, + set = function(info, value) + if value == "" or gsub(value, "%s+", "") == "" then return end + local itemID = match(value, "item:(%d+)") + E.global.bags.deconstructBlacklist[(itemID or value)] = value + if E.db.bags.deconstructBlacklist[(itemID or value)] then + E.db.bags.deconstructBlacklist[(itemID or value)] = nil + end + local D = B:GetModule("Deconstruct") + if D and D.BuildBlacklistDE then D:BuildBlacklistDE() end + end + } + } + }, + deconstructBlacklistProfile = { + order = 6, + type = "multiselect", + name = L["Deconstruct Blacklist (Profile)"], + values = function() return E.db.bags.deconstructBlacklist end, + get = function(info, value) return E.db.bags.deconstructBlacklist[value] end, + set = function(info, value) + E.db.bags.deconstructBlacklist[value] = nil + GameTooltip:Hide() + local D = B:GetModule("Deconstruct") + if D and D.BuildBlacklistDE then D:BuildBlacklistDE() end + end + }, + deconstructBlacklistGlobal = { + order = 7, + type = "multiselect", + name = L["Deconstruct Blacklist (Global)"], + values = function() return E.global.bags.deconstructBlacklist end, + get = function(info, value) return E.global.bags.deconstructBlacklist[value] end, + set = function(info, value) + E.global.bags.deconstructBlacklist[value] = nil + GameTooltip:Hide() + local D = B:GetModule("Deconstruct") + if D and D.BuildBlacklistDE then D:BuildBlacklistDE() end + end + }, + spacer2 = { + order = 8, + type = "description", + name = " " + }, + lockBlacklistGroup = { + order = 9, + type = "group", + name = L["Lockbox Blacklist"], + guiInline = true, + args = { + addEntryProfile = { + order = 1, + type = "input", + name = L["Profile"], + desc = L["Add an item or search syntax to the lockbox blacklist."], + get = function(info) return "" end, + set = function(info, value) + if value == "" or gsub(value, "%s+", "") == "" then return end + local itemID = match(value, "item:(%d+)") + E.db.bags.lockBlacklist[(itemID or value)] = value + local D = B:GetModule("Deconstruct") + if D and D.BuildBlacklistLOCK then D:BuildBlacklistLOCK() end + end + }, + spacer = { + order = 2, + type = "description", + name = " ", + width = "normal" + }, + addEntryGlobal = { + order = 3, + type = "input", + name = L["Global"], + desc = L["Add an item or search syntax to the lockbox blacklist."], + get = function(info) return "" end, + set = function(info, value) + if value == "" or gsub(value, "%s+", "") == "" then return end + local itemID = match(value, "item:(%d+)") + E.global.bags.lockBlacklist[(itemID or value)] = value + if E.db.bags.lockBlacklist[(itemID or value)] then + E.db.bags.lockBlacklist[(itemID or value)] = nil + end + local D = B:GetModule("Deconstruct") + if D and D.BuildBlacklistLOCK then D:BuildBlacklistLOCK() end + end + } + } + }, + lockBlacklistProfile = { + order = 10, + type = "multiselect", + name = L["Lockbox Blacklist (Profile)"], + values = function() return E.db.bags.lockBlacklist end, + get = function(info, value) return E.db.bags.lockBlacklist[value] end, + set = function(info, value) + E.db.bags.lockBlacklist[value] = nil + GameTooltip:Hide() + local D = B:GetModule("Deconstruct") + if D and D.BuildBlacklistLOCK then D:BuildBlacklistLOCK() end + end + }, + lockBlacklistGlobal = { + order = 11, + type = "multiselect", + name = L["Lockbox Blacklist (Global)"], + values = function() return E.global.bags.lockBlacklist end, + get = function(info, value) return E.global.bags.lockBlacklist[value] end, + set = function(info, value) + E.global.bags.lockBlacklist[value] = nil + GameTooltip:Hide() + local D = B:GetModule("Deconstruct") + if D and D.BuildBlacklistLOCK then D:BuildBlacklistLOCK() end + end + } + } + }, + search_syntax = { + order = 11, + type = "group", name = L["Search Syntax"], disabled = function() return not E.Bags.Initialized end, args = {