Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions spec/System/TestSkills_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe("TestSkills", function()

newBuild()

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

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

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

local curseList = build.calcsTab.calcsOutput.CurseList
assert.True(curseList:match("Flammability") ~= nil and curseList:match("Elemental Weakness") ~= nil)
assert.True(curseList:match("Despair") ~= nil and curseList:match("Elemental Weakness") ~= nil)
end)

-- 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
Expand Down
11 changes: 9 additions & 2 deletions src/Classes/GemSelectControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,19 @@ function GemSelectClass:PopulateGemList()
if (self.sortGemsBy and gemData.tags[self.sortGemsBy] == true or not self.sortGemsBy) then
local levelRequirement = (gemData.grantedEffect.levels and gemData.grantedEffect.levels[1] and gemData.grantedEffect.levels[1].levelRequirement) or 1
if characterLevel >= levelRequirement or not matchLevel then
self.gems["Default:" .. gemId] = gemData
if self.skillsTab.showLegacyGems or not (self.skillsTab.showLegacyGems and gemData.grantedEffect.legacy) then
self.gems["Default:" .. gemId] = gemData
end
end
end
end
end

function GemSelectClass:FilterSupport(gemId, gemData)
local showSupportTypes = self.skillsTab.showSupportGemTypes
if gemData.grantedEffect.legacy and not self.skillsTab.showLegacyGems then
return false
end
return (not gemData.grantedEffect.support
or showSupportTypes == "ALL"
or (showSupportTypes == "NORMAL" and not gemData.grantedEffect.isLineage)
Expand Down Expand Up @@ -225,11 +230,12 @@ function GemSelectClass:UpdateSortCache()
and sortCache.outputRevision == self.skillsTab.build.outputRevision and sortCache.defaultLevel == self.skillsTab.defaultGemLevel
and (sortCache.characterLevel == self.skillsTab.build.characterLevel or self.skillsTab.defaultGemLevel ~= "characterLevel")
and sortCache.defaultQuality == self.skillsTab.defaultGemQuality and sortCache.sortType == self.skillsTab.sortGemsByDPSField
and sortCache.considerGemType == self.skillsTab.showSupportGemTypes then
and sortCache.considerGemType == self.skillsTab.showSupportGemTypes and sortCache.showLegacyGems == self.skillsTab.showLegacyGems then
return
end

if not sameSortBy or not sortCache or (sortCache.considerGemType ~= self.skillsTab.showSupportGemTypes
or sortCache.showLegacyGems ~= self.skillsTab.showLegacyGems
or sortCache.defaultQuality ~= self.skillsTab.defaultGemQuality
or sortCache.defaultLevel ~= self.skillsTab.defaultGemLevel
or (sortCache.characterLevel ~= self.skillsTab.build.characterLevel and self.skillsTab.defaultGemLevel == "characterLevel")) then
Expand All @@ -240,6 +246,7 @@ function GemSelectClass:UpdateSortCache()
-- Initialize a new sort cache
sortCache = {
considerGemType = self.skillsTab.showSupportGemTypes,
showLegacyGems = self.skillsTab.showLegacyGems,
socketGroup = self.skillsTab.displayGroup,
gemInstance = self.skillsTab.displayGroup.gemList[self.index],
outputRevision = self.skillsTab.build.outputRevision,
Expand Down
6 changes: 6 additions & 0 deletions src/Classes/GemTooltip.lua
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,12 @@ function GemTooltip.AddGemTooltip(tooltip, build, gemInstance, options)
tooltip:AddLine(fontSizeTitle, colorCodes.GEM .. (gemInstance.displayEffect and gemInstance.displayEffect.nameSpec or gemInstance.gemData.name), "FONTIN SC")
else
tooltip:AddLine(fontSizeTitle, colorCodes.GEM .. gemInstance.gemData.name, "FONTIN SC")
tooltip:AddSeparator(10)
if grantedEffect.legacy then
tooltip:AddLine(fontSizeTitle, colorCodes.WARNING .. "Legacy Gem", "FONTIN SC")
tooltip:AddLine(fontSizeBig, colorCodes.WARNING .. "Gem only exists in Standard League", "FONTIN SC")
tooltip:AddSeparator(10)
end
end
tooltip:AddSeparator(10)
tooltip:AddLine(fontSizeBig, colorCodes.NORMAL .. gemInstance.gemData.gemType, "FONTIN SC")
Expand Down
11 changes: 10 additions & 1 deletion src/Classes/SkillsTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ local SkillsTabClass = newClass("SkillsTab", "UndoHandler", "ControlHost", "Cont
self.sortGemsByDPS = true
self.sortGemsByDPSField = "CombinedDPS"
self.showSupportGemTypes = "ALL"
self.showLegacyGems = false
self.defaultGemLevel = "normalMaximum"
self.defaultGemQuality = main.defaultGemQuality
self.defaultCorruptionLevel = 0
Expand Down Expand Up @@ -123,7 +124,7 @@ local SkillsTabClass = newClass("SkillsTab", "UndoHandler", "ControlHost", "Cont
-- Gem options
local optionInputsX = 170
local optionInputsY = 45
self.controls.optionSection = new("SectionControl", { "TOPLEFT", self.controls.groupList, "BOTTOMLEFT" }, { 0, optionInputsY + 50, 360, 130 }, "Gem Options")
self.controls.optionSection = new("SectionControl", { "TOPLEFT", self.controls.groupList, "BOTTOMLEFT" }, { 0, optionInputsY + 50, 360, 150 }, "Gem Options")
self.controls.sortGemsByDPS = new("CheckBoxControl", { "TOPLEFT", self.controls.groupList, "BOTTOMLEFT" }, { optionInputsX, optionInputsY + 70, 20 }, "Sort gems by DPS:", function(state)
self.sortGemsByDPS = state
end, nil, true)
Expand All @@ -148,6 +149,9 @@ local SkillsTabClass = newClass("SkillsTab", "UndoHandler", "ControlHost", "Cont
self.showSupportGemTypes = value.show
end)
self.controls.showSupportGemTypesLabel = new("LabelControl", { "RIGHT", self.controls.showSupportGemTypes, "LEFT" }, { -4, 0, 0, 16 }, "^7Show support gems:")
self.controls.showLegacyGems = new("CheckBoxControl", { "TOPLEFT", self.controls.groupList, "BOTTOMLEFT" }, { optionInputsX, optionInputsY + 166, 20 }, "^7Show legacy gems:", function(state)
self.showLegacyGems = state
end)

-- Socket group details
if main.portraitMode then
Expand Down Expand Up @@ -413,6 +417,10 @@ function SkillsTabClass:Load(xml, fileName)
self.sortGemsByDPS = xml.attrib.sortGemsByDPS == "true"
end
self.controls.sortGemsByDPS.state = self.sortGemsByDPS
if xml.attrib.showLegacyGems then
self.showLegacyGems = xml.attrib.showLegacyGems == "true"
end
self.controls.showLegacyGems.state = self.showLegacyGems
self.controls.showSupportGemTypes:SelByValue(xml.attrib.showSupportGemTypes or "ALL", "show")
self.controls.sortGemsByDPSFieldControl:SelByValue(xml.attrib.sortGemsByDPSField or "CombinedDPS", "type")
self.showSupportGemTypes = self.controls.showSupportGemTypes:GetSelValueByKey("show")
Expand Down Expand Up @@ -448,6 +456,7 @@ function SkillsTabClass:Save(xml)
sortGemsByDPS = tostring(self.sortGemsByDPS),
showSupportGemTypes = self.showSupportGemTypes,
sortGemsByDPSField = self.sortGemsByDPSField,
showLegacyGems = tostring(self.showLegacyGems),
}
for _, skillSetId in ipairs(self.skillSetOrderList) do
local skillSet = self.skillSets[skillSetId]
Expand Down
Loading
Loading