From 318b0a7f94417995e8177bc2205bdc9fefa7724e Mon Sep 17 00:00:00 2001 From: Blitz54 Date: Thu, 26 Feb 2026 22:54:59 -0600 Subject: [PATCH 1/2] Add Desecrated mods to Custom modifiers dropdown --- src/Classes/ItemsTab.lua | 51 +++++++++++++++++++++++++++++++++++++++- src/Modules/Data.lua | 3 ++- 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/src/Classes/ItemsTab.lua b/src/Classes/ItemsTab.lua index 5a2b9aa8f..4526f2802 100644 --- a/src/Classes/ItemsTab.lua +++ b/src/Classes/ItemsTab.lua @@ -2624,16 +2624,65 @@ function ItemsTabClass:AddCustomModifierToDisplayItem() return a.essence.tierLevel > b.essence.tierLevel end end) + elseif sourceId == "DESECRATED" then + for _, mod in pairs(self.displayItem.affixes) do -- Normal mods for the item can be desecrated as well. + if (mod.type == "Prefix" or mod.type == "Suffix") and self.displayItem:GetModSpawnWeight(mod) > 0 then + t_insert(modList, { + label = mod.affix .. " ^8[" .. table.concat(mod, "/") .. "]", + mod = mod, + type = "desecrated", + }) + end + end + for modId, mod in pairs(self.build.data.itemMods.Desecrated) do + for _, weightKey in pairs(mod.weightKey) do + local tag_name = weightKey:lower() + local item_type = self.displayItem.type:lower():gsub(" ", "_") + if tag_name == item_type then + t_insert(modList, { + label = mod.affix .. " " .. "^8[" .. table.concat(mod, "/") .. "]" .. " (" .. (mod.type or "Suffix") .. ") (Desecrated)", + mod = mod, + type = "desecrated", + desecratedSpecific = true, + }) + end + end + end + table.sort(modList, function(a, b) + local modA = a.mod + local modB = b.mod + + -- Desecrated specific mods always come first + if a.desecratedSpecific ~= b.desecratedSpecific then + return a.desecratedSpecific == true + end + + for i = 1, m_max(#modA.statOrder or 0, #modB.statOrder or 0) do + local statA = modA.statOrder and modA.statOrder[i] + local statB = modB.statOrder and modB.statOrder[i] + + if not statA then + return true + elseif not statB then + return false + elseif statA ~= statB then + return statA < statB + end + end + return (modA.level or 0) > (modB.level or 0) + end) end end if not self.displayItem.crafted then t_insert(sourceList, { label = "Prefix", sourceId = "PREFIX" }) t_insert(sourceList, { label = "Suffix", sourceId = "SUFFIX" }) end - buildMods("ESSENCE") -- This is technically a waste if there aren't any essence mods, + buildMods("DESECRATED") + buildMods("ESSENCE") -- This is technically a waste if there aren't any essence mods, -- but it makes it so we don't have to maintain a list of applicable essence-able base types if #modList > 0 then t_insert(sourceList, { label = "Essence", sourceId = "ESSENCE" }) + t_insert(sourceList, { label = "Desecrated", sourceId = "DESECRATED" }) end t_insert(sourceList, { label = "Custom", sourceId = "CUSTOM" }) buildMods(sourceList[1].sourceId) diff --git a/src/Modules/Data.lua b/src/Modules/Data.lua index a92579ce6..340d52861 100644 --- a/src/Modules/Data.lua +++ b/src/Modules/Data.lua @@ -622,7 +622,8 @@ data.itemMods = { Jewel = LoadModule("Data/ModJewel"), Corruption = LoadModule("Data/ModCorrupted"), Runes = LoadModule("Data/ModRunes"), - Exclusive = LoadModule("Data/ModItemExclusive") + Exclusive = LoadModule("Data/ModItemExclusive"), + Desecrated = LoadModule("Data/ModVeiled") } -- update JewelRadius affixes for Time-Lost jewels From d378f4182eb277a21cb1dc195ec03f738ebdc6a9 Mon Sep 17 00:00:00 2001 From: Blitz54 Date: Fri, 27 Feb 2026 00:53:02 -0600 Subject: [PATCH 2/2] Show the remove button for the desecrated custom mod --- src/Classes/ItemsTab.lua | 5 +++++ src/Modules/ItemTools.lua | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Classes/ItemsTab.lua b/src/Classes/ItemsTab.lua index 4526f2802..9208f70df 100644 --- a/src/Classes/ItemsTab.lua +++ b/src/Classes/ItemsTab.lua @@ -2694,6 +2694,11 @@ function ItemsTabClass:AddCustomModifierToDisplayItem() if controls.custom.buf:match("%S") then t_insert(item.explicitModLines, { line = controls.custom.buf, custom = true }) end + elseif sourceId == "DESECRATED" then + local listMod = modList[controls.modSelect.selIndex] + for _, line in ipairs(listMod.mod) do + t_insert(item.explicitModLines, { line = line, modTags = listMod.mod.modTags, [listMod.type] = true, custom = true }) + end else local listMod = modList[controls.modSelect.selIndex] for _, line in ipairs(listMod.mod) do diff --git a/src/Modules/ItemTools.lua b/src/Modules/ItemTools.lua index a013bbd7c..c607c1663 100644 --- a/src/Modules/ItemTools.lua +++ b/src/Modules/ItemTools.lua @@ -331,7 +331,7 @@ function itemLib.formatModLine(modLine, dbMode) line = line .. " ^1'" .. modLine.extra .. "'" end else - colorCode = (modLine.enchant and colorCodes.ENCHANTED) or (modLine.fractured and colorCodes.FRACTURED) or (modLine.mutated and colorCodes.MUTATED) or (modLine.custom and colorCodes.CUSTOM) or colorCodes.MAGIC + colorCode = (modLine.enchant and colorCodes.ENCHANTED) or (modLine.fractured and colorCodes.FRACTURED) or (modLine.mutated and colorCodes.MUTATED) or (modLine.custom and (not modLine.desecrated and colorCodes.CUSTOM)) or colorCodes.MAGIC end return colorCode..line end