Skip to content

Commit 9c93232

Browse files
PeecheyLocalIdentity
andauthored
[0.5] Add legacy toggle for gems that are no longer obtainable (#1935)
* remove gems that are no longer in game * modcache fix tests * lmao didn't commit test fixes * Revert "remove gems that are no longer in game" This reverts commit b84d0ae. * use legacy tag instead of deleting gems update SkillsTab for legacy toggle * legacy tag the 0.5 changes, remove Not in Game --------- Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent 7fc247c commit 9c93232

15 files changed

Lines changed: 36 additions & 2022 deletions

File tree

spec/System/TestSkills_spec.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ describe("TestSkills", function()
6767

6868
newBuild()
6969

70-
build.skillsTab:PasteSocketGroup("Blasphemy 20/0 1\nDespair 20/0 1\nFlammability 20/0 1\n")
70+
build.skillsTab:PasteSocketGroup("Blasphemy 20/0 1\nDespair 20/0 1\nTemporal Chains 20/0 1\n")
7171
runCallback("OnFrame")
7272

7373
assert.True(build.calcsTab.mainOutput.SpiritReservedPercent > oneCurseReservation)
@@ -384,11 +384,11 @@ describe("TestSkills", function()
384384

385385
it("Test Atziri's Allure - ignore curse limit", function()
386386
build.skillsTab:PasteSocketGroup("Elemental Weakness 20/0 1\nAtziri's Allure 1/0 1")
387-
build.skillsTab:PasteSocketGroup("Flammability 20/0 1\n")
387+
build.skillsTab:PasteSocketGroup("Despair 20/0 1\n")
388388
runCallback("OnFrame")
389389

390390
local curseList = build.calcsTab.calcsOutput.CurseList
391-
assert.True(curseList:match("Flammability") ~= nil and curseList:match("Elemental Weakness") ~= nil)
391+
assert.True(curseList:match("Despair") ~= nil and curseList:match("Elemental Weakness") ~= nil)
392392
end)
393393

394394
-- skills that don't have a base CD and have more than one use need to use the added cooldown by whatever support allows the +1 limit to be supportable

src/Classes/GemSelectControl.lua

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,19 @@ function GemSelectClass:PopulateGemList()
102102
if (self.sortGemsBy and gemData.tags[self.sortGemsBy] == true or not self.sortGemsBy) then
103103
local levelRequirement = (gemData.grantedEffect.levels and gemData.grantedEffect.levels[1] and gemData.grantedEffect.levels[1].levelRequirement) or 1
104104
if characterLevel >= levelRequirement or not matchLevel then
105-
self.gems["Default:" .. gemId] = gemData
105+
if self.skillsTab.showLegacyGems or not (self.skillsTab.showLegacyGems and gemData.grantedEffect.legacy) then
106+
self.gems["Default:" .. gemId] = gemData
107+
end
106108
end
107109
end
108110
end
109111
end
110112

111113
function GemSelectClass:FilterSupport(gemId, gemData)
112114
local showSupportTypes = self.skillsTab.showSupportGemTypes
115+
if gemData.grantedEffect.legacy and not self.skillsTab.showLegacyGems then
116+
return false
117+
end
113118
return (not gemData.grantedEffect.support
114119
or showSupportTypes == "ALL"
115120
or (showSupportTypes == "NORMAL" and not gemData.grantedEffect.isLineage)
@@ -225,11 +230,12 @@ function GemSelectClass:UpdateSortCache()
225230
and sortCache.outputRevision == self.skillsTab.build.outputRevision and sortCache.defaultLevel == self.skillsTab.defaultGemLevel
226231
and (sortCache.characterLevel == self.skillsTab.build.characterLevel or self.skillsTab.defaultGemLevel ~= "characterLevel")
227232
and sortCache.defaultQuality == self.skillsTab.defaultGemQuality and sortCache.sortType == self.skillsTab.sortGemsByDPSField
228-
and sortCache.considerGemType == self.skillsTab.showSupportGemTypes then
233+
and sortCache.considerGemType == self.skillsTab.showSupportGemTypes and sortCache.showLegacyGems == self.skillsTab.showLegacyGems then
229234
return
230235
end
231236

232237
if not sameSortBy or not sortCache or (sortCache.considerGemType ~= self.skillsTab.showSupportGemTypes
238+
or sortCache.showLegacyGems ~= self.skillsTab.showLegacyGems
233239
or sortCache.defaultQuality ~= self.skillsTab.defaultGemQuality
234240
or sortCache.defaultLevel ~= self.skillsTab.defaultGemLevel
235241
or (sortCache.characterLevel ~= self.skillsTab.build.characterLevel and self.skillsTab.defaultGemLevel == "characterLevel")) then
@@ -240,6 +246,7 @@ function GemSelectClass:UpdateSortCache()
240246
-- Initialize a new sort cache
241247
sortCache = {
242248
considerGemType = self.skillsTab.showSupportGemTypes,
249+
showLegacyGems = self.skillsTab.showLegacyGems,
243250
socketGroup = self.skillsTab.displayGroup,
244251
gemInstance = self.skillsTab.displayGroup.gemList[self.index],
245252
outputRevision = self.skillsTab.build.outputRevision,

src/Classes/GemTooltip.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,12 @@ function GemTooltip.AddGemTooltip(tooltip, build, gemInstance, options)
299299
tooltip:AddLine(fontSizeTitle, colorCodes.GEM .. (gemInstance.displayEffect and gemInstance.displayEffect.nameSpec or gemInstance.gemData.name), "FONTIN SC")
300300
else
301301
tooltip:AddLine(fontSizeTitle, colorCodes.GEM .. gemInstance.gemData.name, "FONTIN SC")
302+
tooltip:AddSeparator(10)
303+
if grantedEffect.legacy then
304+
tooltip:AddLine(fontSizeTitle, colorCodes.WARNING .. "Legacy Gem", "FONTIN SC")
305+
tooltip:AddLine(fontSizeBig, colorCodes.WARNING .. "Gem only exists in Standard League", "FONTIN SC")
306+
tooltip:AddSeparator(10)
307+
end
302308
end
303309
tooltip:AddSeparator(10)
304310
tooltip:AddLine(fontSizeBig, colorCodes.NORMAL .. gemInstance.gemData.gemType, "FONTIN SC")

src/Classes/SkillsTab.lua

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ local SkillsTabClass = newClass("SkillsTab", "UndoHandler", "ControlHost", "Cont
8989
self.sortGemsByDPS = true
9090
self.sortGemsByDPSField = "CombinedDPS"
9191
self.showSupportGemTypes = "ALL"
92+
self.showLegacyGems = false
9293
self.defaultGemLevel = "normalMaximum"
9394
self.defaultGemQuality = main.defaultGemQuality
9495
self.defaultCorruptionLevel = 0
@@ -123,7 +124,7 @@ local SkillsTabClass = newClass("SkillsTab", "UndoHandler", "ControlHost", "Cont
123124
-- Gem options
124125
local optionInputsX = 170
125126
local optionInputsY = 45
126-
self.controls.optionSection = new("SectionControl", { "TOPLEFT", self.controls.groupList, "BOTTOMLEFT" }, { 0, optionInputsY + 50, 360, 130 }, "Gem Options")
127+
self.controls.optionSection = new("SectionControl", { "TOPLEFT", self.controls.groupList, "BOTTOMLEFT" }, { 0, optionInputsY + 50, 360, 150 }, "Gem Options")
127128
self.controls.sortGemsByDPS = new("CheckBoxControl", { "TOPLEFT", self.controls.groupList, "BOTTOMLEFT" }, { optionInputsX, optionInputsY + 70, 20 }, "Sort gems by DPS:", function(state)
128129
self.sortGemsByDPS = state
129130
end, nil, true)
@@ -148,6 +149,9 @@ local SkillsTabClass = newClass("SkillsTab", "UndoHandler", "ControlHost", "Cont
148149
self.showSupportGemTypes = value.show
149150
end)
150151
self.controls.showSupportGemTypesLabel = new("LabelControl", { "RIGHT", self.controls.showSupportGemTypes, "LEFT" }, { -4, 0, 0, 16 }, "^7Show support gems:")
152+
self.controls.showLegacyGems = new("CheckBoxControl", { "TOPLEFT", self.controls.groupList, "BOTTOMLEFT" }, { optionInputsX, optionInputsY + 166, 20 }, "^7Show legacy gems:", function(state)
153+
self.showLegacyGems = state
154+
end)
151155

152156
-- Socket group details
153157
if main.portraitMode then
@@ -413,6 +417,10 @@ function SkillsTabClass:Load(xml, fileName)
413417
self.sortGemsByDPS = xml.attrib.sortGemsByDPS == "true"
414418
end
415419
self.controls.sortGemsByDPS.state = self.sortGemsByDPS
420+
if xml.attrib.showLegacyGems then
421+
self.showLegacyGems = xml.attrib.showLegacyGems == "true"
422+
end
423+
self.controls.showLegacyGems.state = self.showLegacyGems
416424
self.controls.showSupportGemTypes:SelByValue(xml.attrib.showSupportGemTypes or "ALL", "show")
417425
self.controls.sortGemsByDPSFieldControl:SelByValue(xml.attrib.sortGemsByDPSField or "CombinedDPS", "type")
418426
self.showSupportGemTypes = self.controls.showSupportGemTypes:GetSelValueByKey("show")
@@ -448,6 +456,7 @@ function SkillsTabClass:Save(xml)
448456
sortGemsByDPS = tostring(self.sortGemsByDPS),
449457
showSupportGemTypes = self.showSupportGemTypes,
450458
sortGemsByDPSField = self.sortGemsByDPSField,
459+
showLegacyGems = tostring(self.showLegacyGems),
451460
}
452461
for _, skillSetId in ipairs(self.skillSetOrderList) do
453462
local skillSet = self.skillSets[skillSetId]

0 commit comments

Comments
 (0)