Skip to content

Commit 3d61829

Browse files
EtherealCarnivoreLocalIdentity
andauthored
Hide legacy awakened gems from dropdown (#9510)
* Hide legacy awakened gems from dropdown by default Most awakened support gems were discontinued in 3.28. They're now hidden from the gem dropdown unless "Show legacy gems" is checked. Awakened Empower, Enlighten, and Enhance are still shown since they're still obtainable. Existing builds with legacy awakened gems load and calculate fine - this only affects the picker. * Adjust logic --------- Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent 865e265 commit 3d61829

2 files changed

Lines changed: 31 additions & 9 deletions

File tree

src/Classes/GemSelectControl.lua

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ local m_max = math.max
1212
local m_floor = math.floor
1313

1414
local toolTipText = "Prefix tag searches with a colon and exclude tags with a dash. e.g. :fire:lightning:-cold:area"
15+
local nonLegacyAwakened = {
16+
["SupportAwakenedEmpower"] = true,
17+
["SupportAwakenedEnlighten"] = true,
18+
["SupportAwakenedEnhance"] = true,
19+
}
1520
local altQualMap = {
1621
["Default"] = "",
1722
["Alternate1"] = "Anomalous ",
@@ -106,7 +111,7 @@ end
106111
function GemSelectClass:PopulateGemList()
107112
wipeTable(self.gems)
108113
local showAll = self.skillsTab.showSupportGemTypes == "ALL"
109-
local showAwakened = self.skillsTab.showSupportGemTypes == "AWAKENED"
114+
local showExceptional = self.skillsTab.showSupportGemTypes == "EXCEPTIONAL"
110115
local showNormal = self.skillsTab.showSupportGemTypes == "NORMAL"
111116
local matchLevel = self.skillsTab.defaultGemLevel == "characterLevel"
112117
local characterLevel = self.skillsTab.build and self.skillsTab.build.characterLevel or 1
@@ -115,8 +120,10 @@ function GemSelectClass:PopulateGemList()
115120
if (self.sortGemsBy and gemData.tags[self.sortGemsBy] == true or not self.sortGemsBy) then
116121
local levelRequirement = gemData.grantedEffect.levels[1].levelRequirement or 1
117122
if characterLevel >= levelRequirement or not matchLevel then
118-
if (showAwakened or showAll) and gemData.grantedEffect.plusVersionOf then
119-
self.gems["Default:" .. gemId] = gemData
123+
if (showExceptional or showAll) and gemData.grantedEffect.plusVersionOf then
124+
if self.skillsTab.showLegacyGems or nonLegacyAwakened[gemData.grantedEffectId] or not gemData.name:match("^Awakened") then
125+
self.gems["Default:" .. gemId] = gemData
126+
end
120127
elseif showNormal or showAll then
121128
if self.skillsTab.showAltQualityGems and (self.skillsTab.defaultGemQuality or 0) > 0 then
122129
for _, altQual in ipairs(self.skillsTab:getGemAltQualityList(gemData)) do
@@ -137,10 +144,13 @@ end
137144

138145
function GemSelectClass:FilterSupport(gemId, gemData)
139146
local showSupportTypes = self.skillsTab.showSupportGemTypes
147+
if gemData.name:match("^Awakened") and not self.skillsTab.showLegacyGems and not nonLegacyAwakened[gemData.grantedEffectId] then
148+
return false
149+
end
140150
return (not gemData.grantedEffect.support
141151
or showSupportTypes == "ALL"
142152
or (showSupportTypes == "NORMAL" and not gemData.grantedEffect.plusVersionOf)
143-
or (showSupportTypes == "AWAKENED" and gemData.grantedEffect.plusVersionOf))
153+
or (showSupportTypes == "EXCEPTIONAL" and gemData.grantedEffect.plusVersionOf))
144154
and (self.skillsTab.showAltQualityGems or (not self.skillsTab.showAltQualityGems and self:GetQualityType(gemId) == "Default"))
145155
end
146156

@@ -253,11 +263,13 @@ function GemSelectClass:UpdateSortCache()
253263
and sortCache.outputRevision == self.skillsTab.build.outputRevision and sortCache.defaultLevel == self.skillsTab.defaultGemLevel
254264
and (sortCache.characterLevel == self.skillsTab.build.characterLevel or self.skillsTab.defaultGemLevel ~= "characterLevel")
255265
and sortCache.defaultQuality == self.skillsTab.defaultGemQuality and sortCache.sortType == self.skillsTab.sortGemsByDPSField
256-
and sortCache.considerAlternates == self.skillsTab.showAltQualityGems and sortCache.considerGemType == self.skillsTab.showSupportGemTypes then
266+
and sortCache.considerAlternates == self.skillsTab.showAltQualityGems and sortCache.considerGemType == self.skillsTab.showSupportGemTypes
267+
and sortCache.showLegacyGems == self.skillsTab.showLegacyGems then
257268
return
258269
end
259270

260271
if not sameSortBy or not sortCache or (sortCache.considerAlternates ~= self.skillsTab.showAltQualityGems or sortCache.considerGemType ~= self.skillsTab.showSupportGemTypes
272+
or sortCache.showLegacyGems ~= self.skillsTab.showLegacyGems
261273
or sortCache.defaultQuality ~= self.skillsTab.defaultGemQuality
262274
or sortCache.defaultLevel ~= self.skillsTab.defaultGemLevel
263275
or (sortCache.characterLevel ~= self.skillsTab.build.characterLevel and self.skillsTab.defaultGemLevel == "characterLevel")) then
@@ -269,6 +281,7 @@ function GemSelectClass:UpdateSortCache()
269281
sortCache = {
270282
considerGemType = self.skillsTab.showSupportGemTypes,
271283
considerAlternates = self.skillsTab.showAltQualityGems,
284+
showLegacyGems = self.skillsTab.showLegacyGems,
272285
socketGroup = self.skillsTab.displayGroup,
273286
gemInstance = self.skillsTab.displayGroup.gemList[self.index],
274287
outputRevision = self.skillsTab.build.outputRevision,

src/Classes/SkillsTab.lua

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ This hides gems with a minimum level requirement above your character level, pre
5454

5555
local showSupportGemTypeList = {
5656
{ label = "All", show = "ALL" },
57-
{ label = "Non-Awakened", show = "NORMAL" },
58-
{ label = "Awakened", show = "AWAKENED" },
57+
{ label = "Non-Exceptional", show = "NORMAL" },
58+
{ label = "Exceptional", show = "EXCEPTIONAL" },
5959
}
6060

6161
local sortGemTypeList = {
@@ -90,6 +90,7 @@ local SkillsTabClass = newClass("SkillsTab", "UndoHandler", "ControlHost", "Cont
9090
self.sortGemsByDPSField = "CombinedDPS"
9191
self.showSupportGemTypes = "ALL"
9292
self.showAltQualityGems = false
93+
self.showLegacyGems = false
9394
self.defaultGemLevel = "normalMaximum"
9495
self.defaultGemQuality = main.defaultGemQuality
9596

@@ -122,7 +123,7 @@ local SkillsTabClass = newClass("SkillsTab", "UndoHandler", "ControlHost", "Cont
122123
-- Gem options
123124
local optionInputsX = 170
124125
local optionInputsY = 45
125-
self.controls.optionSection = new("SectionControl", { "TOPLEFT", self.controls.groupList, "BOTTOMLEFT" }, { 0, optionInputsY + 50, 360, 156 }, "Gem Options")
126+
self.controls.optionSection = new("SectionControl", { "TOPLEFT", self.controls.groupList, "BOTTOMLEFT" }, { 0, optionInputsY + 50, 360, 180 }, "Gem Options")
126127
self.controls.sortGemsByDPS = new("CheckBoxControl", { "TOPLEFT", self.controls.groupList, "BOTTOMLEFT" }, { optionInputsX, optionInputsY + 70, 20 }, "Sort gems by DPS:", function(state)
127128
self.sortGemsByDPS = state
128129
end, nil, true)
@@ -150,6 +151,9 @@ local SkillsTabClass = newClass("SkillsTab", "UndoHandler", "ControlHost", "Cont
150151
self.controls.showAltQualityGems = new("CheckBoxControl", { "TOPLEFT", self.controls.groupList, "BOTTOMLEFT" }, { optionInputsX, optionInputsY + 166, 20 }, "^7Show quality variants:", function(state)
151152
self.showAltQualityGems = state
152153
end)
154+
self.controls.showLegacyGems = new("CheckBoxControl", { "TOPLEFT", self.controls.groupList, "BOTTOMLEFT" }, { optionInputsX, optionInputsY + 190, 20 }, "^7Show legacy gems:", function(state)
155+
self.showLegacyGems = state
156+
end)
153157

154158
-- Socket group details
155159
if main.portraitMode then
@@ -397,6 +401,10 @@ function SkillsTabClass:Load(xml, fileName)
397401
self.showAltQualityGems = xml.attrib.showAltQualityGems == "true"
398402
end
399403
self.controls.showAltQualityGems.state = self.showAltQualityGems
404+
if xml.attrib.showLegacyGems then
405+
self.showLegacyGems = xml.attrib.showLegacyGems == "true"
406+
end
407+
self.controls.showLegacyGems.state = self.showLegacyGems
400408
self.controls.showSupportGemTypes:SelByValue(xml.attrib.showSupportGemTypes or "ALL", "show")
401409
self.controls.sortGemsByDPSFieldControl:SelByValue(xml.attrib.sortGemsByDPSField or "CombinedDPS", "type")
402410
self.showSupportGemTypes = self.controls.showSupportGemTypes:GetSelValueByKey("show")
@@ -432,7 +440,8 @@ function SkillsTabClass:Save(xml)
432440
sortGemsByDPS = tostring(self.sortGemsByDPS),
433441
showSupportGemTypes = self.showSupportGemTypes,
434442
sortGemsByDPSField = self.sortGemsByDPSField,
435-
showAltQualityGems = tostring(self.showAltQualityGems)
443+
showAltQualityGems = tostring(self.showAltQualityGems),
444+
showLegacyGems = tostring(self.showLegacyGems)
436445
}
437446
for _, skillSetId in ipairs(self.skillSetOrderList) do
438447
local skillSet = self.skillSets[skillSetId]

0 commit comments

Comments
 (0)