Skip to content

Commit 865e265

Browse files
EtherealCarnivoreLocalIdentity
andauthored
Preserve cluster jewel notables when changing enchantment (#9513)
* Preserve cluster jewel notables when changing enchantment Keep currently-selected affixes in the dropdown even when they can't naturally spawn on the new base. In 3.28 you can change a cluster jewel's enchantment without losing existing mods, so the affix list filter now skips the spawn weight check for whatever mod is already selected in each slot. * Add [Retained] label to cluster jewel notables from previous enchant Grey out notables in the affix dropdown that only appear because they are currently selected but have zero spawn weight on the active enchantment. This makes it clear which mods were carried over from a different cluster jewel enchant. --------- Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent a5dd258 commit 865e265

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

src/Classes/ItemsTab.lua

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1816,10 +1816,17 @@ function ItemsTabClass:UpdateAffixControl(control, item, type, outputTable, outp
18161816
extraTags[skill.tag] = true
18171817
end
18181818
end
1819+
local selAffix = item[outputTable][outputIndex] and item[outputTable][outputIndex].modId
18191820
local affixList = { }
1821+
local retainedAffixes = { }
18201822
for modId, mod in pairs(item.affixes) do
1821-
if mod.type == type and not excludeGroups[mod.group] and item:GetModSpawnWeight(mod, extraTags) > 0 and not item:CheckIfModIsDelve(mod) then
1822-
t_insert(affixList, modId)
1823+
if mod.type == type and not excludeGroups[mod.group] and not item:CheckIfModIsDelve(mod) then
1824+
if item:GetModSpawnWeight(mod, extraTags) > 0 then
1825+
t_insert(affixList, modId)
1826+
elseif modId == selAffix then
1827+
t_insert(affixList, modId)
1828+
retainedAffixes[modId] = true
1829+
end
18231830
end
18241831
end
18251832
table.sort(affixList, function(a, b)
@@ -1854,7 +1861,9 @@ function ItemsTabClass:UpdateAffixControl(control, item, type, outputTable, outp
18541861
end
18551862
local modString = table.concat(mod, "/")
18561863
local label = modString
1857-
if item.type == "Flask" then
1864+
if retainedAffixes[modId] then
1865+
label = "^8[Retained] " .. modString
1866+
elseif item.type == "Flask" then
18581867
label = mod.affix .. " ^8[" .. modString .. "]"
18591868
end
18601869
control.list[i + 1] = {

0 commit comments

Comments
 (0)