Skip to content
47 changes: 37 additions & 10 deletions src/Classes/GemSelectControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ function GemSelectClass:CalcOutputWithThisGem(calcFunc, gemData, useFullDPS)
enableGlobal2 = true,
gemId = gemData.id,
nameSpec = gemData.name,
skillId = gemData.grantedEffectId
skillId = gemData.grantedEffectId,
corrupted = self.skillsTab.defaultCorruptionState,
corruptLevel = self.skillsTab.defaultCorruptionLevel,
}
end

Expand Down Expand Up @@ -90,7 +92,7 @@ end
function GemSelectClass:PopulateGemList()
wipeTable(self.gems)
local showAll = self.skillsTab.showSupportGemTypes == "ALL"
local showAwakened = self.skillsTab.showSupportGemTypes == "AWAKENED"
local showLineage = self.skillsTab.showSupportGemTypes == "LINEAGE"
local showNormal = self.skillsTab.showSupportGemTypes == "NORMAL"
local matchLevel = self.skillsTab.defaultGemLevel == "characterLevel"
local characterLevel = self.skillsTab.build and self.skillsTab.build.characterLevel or 1
Expand All @@ -113,8 +115,8 @@ function GemSelectClass:FilterSupport(gemId, gemData)
local showSupportTypes = self.skillsTab.showSupportGemTypes
return (not gemData.grantedEffect.support
or showSupportTypes == "ALL"
or (showSupportTypes == "NORMAL" and not gemData.grantedEffect.plusVersionOf)
or (showSupportTypes == "AWAKENED" and gemData.grantedEffect.plusVersionOf))
or (showSupportTypes == "NORMAL" and not gemData.grantedEffect.isLineage)
or (showSupportTypes == "LINEAGE" and gemData.grantedEffect.isLineage))
end

function GemSelectClass:BuildList(buf)
Expand Down Expand Up @@ -464,7 +466,9 @@ function GemSelectClass:Draw(viewPort, noTooltip)
nameSpec = gemData.name,
skillId = gemData.grantedEffectId,
displayEffect = nil,
gemData = gemData
gemData = gemData,
corruptLevel = self.skillsTab.defaultCorruptionLevel,
corrupted = self.skillsTab.defaultCorruptionState == true,
}
self:AddGemTooltip(gemInstance)
self.tooltip:AddSeparator(10)
Expand Down Expand Up @@ -602,11 +606,30 @@ function GemSelectClass:AddGrantedEffectInfo(gemInstance, grantedEffect, addReq)
self.tooltip:AddLine(fontSizeBig, string.format("^x7F7F7FTier: ^7%d", gemInstance.gemData.Tier), "FONTIN SC")
end
if addReq and not grantedEffect.support then
self.tooltip:AddLine(fontSizeBig, string.format("^x7F7F7FLevel: ^7%d%s%s",
gemInstance.level,
((displayInstance.level > gemInstance.level) and " (" .. colorCodes.MAGIC .. "+" .. (displayInstance.level - gemInstance.level) .. "^7)") or ((displayInstance.level < gemInstance.level) and " (" .. colorCodes.WARNING .. "-" .. (gemInstance.level - displayInstance.level) .. "^7)") or "",
(gemInstance.level >= gemInstance.gemData.naturalMaxLevel) and " (Max)" or ""
),"FONTIN SC")
local totalLevel
totalLevel = m_max(displayInstance.level, (gemInstance.level + gemInstance.corruptLevel)) -- Needed for tooltip comparison for dropdown gems. Otherwise they only show level 20 when corrupted.
if displayInstance.corruptLevel ~= 0 or
(displayInstance.gemPropertyInfo and displayInstance.gemPropertyInfo[1].value.value > 0 ) or
(displayInstance.level - gemInstance.level - displayInstance.corruptLevel > 0)
then
self.tooltip:AddLine(fontSizeBig, string.format("^x7F7F7FLevel: ^7" .. colorCodes.MAGIC .. totalLevel), "FONTIN SC")
self.tooltip:AddLine(fontSizeBig, "^7" .. gemInstance.level .. " Levels from Gem" .. ((gemInstance.level >= gemInstance.gemData.naturalMaxLevel) and " (Max)" or ""), "FONTIN SC")
else
self.tooltip:AddLine(fontSizeBig, string.format("^x7F7F7FLevel: ^7" .. totalLevel .. ((gemInstance.level >= gemInstance.gemData.naturalMaxLevel) and " (Max)" or "")), "FONTIN SC")
end
if displayInstance.corruptLevel > 0 then
self.tooltip:AddLine(fontSizeBig, colorCodes.MAGIC .. "+" .. displayInstance.corruptLevel .. " Level from Corruption", "FONTIN SC")
elseif displayInstance.corruptLevel < 0 then
self.tooltip:AddLine(fontSizeBig, colorCodes.MAGIC .. displayInstance.corruptLevel .. " Level from Corruption", "FONTIN SC")
end
if displayInstance.gemPropertyInfo and displayInstance.gemPropertyInfo[1].value.value > 0 then
self.tooltip:AddLine(fontSizeBig, colorCodes.MAGIC .. "+" .. displayInstance.gemPropertyInfo[1].value.value .. " Levels from Global Modifiers", "FONTIN SC")
if totalLevel - gemInstance.level - displayInstance.corruptLevel*2 - displayInstance.gemPropertyInfo[1].value.value > 0 then
self.tooltip:AddLine(fontSizeBig, colorCodes.MAGIC .. "+" .. totalLevel - gemInstance.level - displayInstance.corruptLevel - displayInstance.gemPropertyInfo[1].value.value .. " Levels from Supports", "FONTIN SC")
end
elseif totalLevel - gemInstance.level - displayInstance.corruptLevel > 0 then
self.tooltip:AddLine(fontSizeBig, colorCodes.MAGIC .. "+" .. totalLevel - gemInstance.level - displayInstance.corruptLevel .. " Levels from Supports", "FONTIN SC")
end
end
if grantedEffect.support then
if grantedEffectLevel.manaMultiplier and grantedEffectLevel.reservationMultiplier and grantedEffectLevel.manaMultiplier == grantedEffectLevel.reservationMultiplier then
Expand Down Expand Up @@ -709,6 +732,10 @@ function GemSelectClass:AddGrantedEffectInfo(gemInstance, grantedEffect, addReq)
for _, line in ipairs(wrap) do
self.tooltip:AddLine(fontSizeBig, colorCodes.GEMDESCRIPTION..line, "FONTIN ITALIC")
end
if displayInstance.corrupted == true then
self.tooltip:AddSeparator(10)
self.tooltip:AddLine(fontSizeBig, colorCodes.NEGATIVE .. "Corrupted", "FONTIN SC")
end
end
end
function GemSelectClass:AddStatSetInfo(gemInstance, grantedEffect, statSet, noLabel, index)
Expand Down
7 changes: 5 additions & 2 deletions src/Classes/ImportTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,7 @@ function ImportTabClass:ImportItemsAndSkills(charData)
if gemId then
local gemInstance = { level = 20, quality = 0, enabled = true, enableGlobal1 = true, enableGlobal2 = true, count = 1, gemId = gemId }
gemInstance.support = skillData.support
gemInstance.corrupted = skillData.corrupted

local spectreList = data.spectres
if typeLine:sub(1, 8) == "Spectre:" then
Expand Down Expand Up @@ -854,8 +855,10 @@ function ImportTabClass:ImportItemsAndSkills(charData)
else
gemInstance.level = tonumber(property.values[1][1]:match("%d+"))
end
if skillData.properties[_ + 2] and skillData.properties[_ + 2].values[1][1]:match("(%d+) Level[s]? from Corruption") then
gemInstance.level = gemInstance.level + tonumber(skillData.properties[_ + 2].values[1][1]:match("(%d+) Level[s]? from Corruption"))
if skillData.properties[_ + 2] and skillData.properties[_ + 2].values[1][1]:match("(-?%d+) Level[s]? from Corruption") then
gemInstance.corruptLevel = tonumber(skillData.properties[_ + 2].values[1][1]:match("(-?%d+) Level[s]? from Corruption"))
else
gemInstance.corruptLevel = 0
end
elseif escapeGGGString(property.name) == "Quality" then
gemInstance.quality = tonumber(property.values[1][1]:match("%d+"))
Expand Down
Loading