Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove left panel EHP, saner Vaal/Guard skill defaults, better disabled gem readability #8340

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
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
15 changes: 14 additions & 1 deletion src/Classes/ImportTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1039,16 +1039,29 @@ function ImportTabClass:ImportSocketedItems(item, socketedItems, slotName)
else
local normalizedBasename, qualityType = self.build.skillsTab:GetBaseNameAndQuality(socketedItem.typeLine, nil)
local gemId = self.build.data.gemForBaseName[normalizedBasename:lower()]
local enable1 = true
local enable2 = false
if socketedItem.hybrid then
-- Used by transfigured gems and dual-skill gems (currently just Stormbind)
normalizedBasename, qualityType = self.build.skillsTab:GetBaseNameAndQuality(socketedItem.hybrid.baseTypeName, nil)
gemId = self.build.data.gemForBaseName[normalizedBasename:lower()]
if gemId and socketedItem.hybrid.isVaalGem then
gemId = self.build.data.gemGrantedEffectIdForVaalGemId[self.build.data.gems[gemId].grantedEffectId]

-- Turn off Vaal skills by default on import
enable1 = false
enable2 = true
end
end
if gemId then
local gemInstance = { level = 20, quality = 0, enabled = true, enableGlobal1 = true, gemId = gemId }
-- if the gem is a guard gem, disable by default
local isGuard = false
if self.build.data.gems[gemId].tags.guard then
isGuard = true
end
local gemInstance = {
level = 20, quality = 0, enabled = not isGuard, enableGlobal1 = enable1, enableGlobal2 = enable2, gemId = gemId
}
gemInstance.nameSpec = self.build.data.gems[gemId].name
gemInstance.support = socketedItem.support
gemInstance.qualityId = qualityType
Expand Down
11 changes: 10 additions & 1 deletion src/Modules/Build.lua
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ function buildMode:Init(dbFileName, buildName, buildXML, convertBuild, importLin
{ },
{ stat = "Devotion", label = "Devotion", color = colorCodes.RARE, fmt = "d" },
{ },
{ stat = "TotalEHP", label = "Effective Hit Pool", fmt = ".0f", compPercent = true },
{ stat = "TotalEHP", label = "Effective Hit Pool", fmt = ".0f", compPercent = true},
{ stat = "PvPTotalTakenHit", label = "PvP Hit Taken", fmt = ".1f", flag = "isPvP", lowerIsBetter = true },
{ stat = "PhysicalMaximumHitTaken", label = "Phys Max Hit", fmt = ".0f", color = colorCodes.PHYS, compPercent = true, },
{ stat = "LightningMaximumHitTaken", label = "Elemental Max Hit", fmt = ".0f", color = colorCodes.LIGHTNING, compPercent = true, condFunc = function(v,o) return o.LightningMaximumHitTaken == o.ColdMaximumHitTaken and o.LightningMaximumHitTaken == o.FireMaximumHitTaken end },
Expand Down Expand Up @@ -1322,6 +1322,9 @@ function buildMode:OnFrame(inputEvents)
if main.decimalSeparator ~= self.lastShowDecimalSeparator then
self:RefreshStatList()
end
if main.showEHPInBuildPanel ~= self.showEHPInBuildPanel then
self:RefreshStatList()
end
if main.showTitlebarName ~= self.lastShowTitlebarName then
self.spec:SetWindowTitleWithBuildClass()
end
Expand Down Expand Up @@ -1680,6 +1683,7 @@ function buildMode:FormatStat(statData, statVal, overCapStatVal, colorOverride)
self.lastShowThousandsSeparators = main.showThousandsSeparators
self.lastShowThousandsSeparator = main.thousandsSeparator
self.lastShowDecimalSeparator = main.decimalSeparator
self.showEHPInBuildPanel = main.showEHPInBuildPanel
self.lastShowTitlebarName = main.showTitlebarName
return valStr
end
Expand All @@ -1701,6 +1705,11 @@ function buildMode:AddDisplayStatList(statList, actor)
end
if statVal and ((statData.condFunc and statData.condFunc(statVal,actor.output)) or (not statData.condFunc and statVal ~= 0)) then
local overCapStatVal = actor.output[statData.overCapStat] or nil

if statData.stat == "TotalEHP" then
statData.hideStat = not self.showEHPInBuildPanel
end

if statData.stat == "SkillDPS" then
labelColor = colorCodes.CUSTOM
table.sort(actor.output.SkillDPS, function(a,b) return (a.dps * a.count) > (b.dps * b.count) end)
Expand Down
8 changes: 6 additions & 2 deletions src/Modules/CalcSetup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1589,8 +1589,12 @@ function calcs.initEnv(build, mode, override, specEnv)
group.displayLabel = nil
for _, gemInstance in ipairs(group.gemList) do
local grantedEffect = gemInstance.gemData and gemInstance.gemData.grantedEffect or gemInstance.grantedEffect
if grantedEffect and not grantedEffect.support and gemInstance.enabled then
group.displayLabel = (group.displayLabel and group.displayLabel..", " or "") .. grantedEffect.name
if grantedEffect and not grantedEffect.support then
if gemInstance.enabled then
group.displayLabel = (group.displayLabel and group.displayLabel..", " or "") .. grantedEffect.name
else
group.displayLabel = (group.displayLabel and group.displayLabel..", " or "") .. "^x7F7F7F" .. grantedEffect.name .. " (Disabled)^xFFFFFF"
end
end
end
group.displayLabel = group.displayLabel or "<No active skills>"
Expand Down
14 changes: 13 additions & 1 deletion src/Modules/Main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ function main:Init()
self.slotOnlyTooltips = true
self.POESESSID = ""
self.showPublicBuilds = true
self.showEHPInBuildPanel = false

if self.userPath then
self:ChangeUserPath(self.userPath, ignoreBuild)
Expand Down Expand Up @@ -617,6 +618,9 @@ function main:LoadSettings(ignoreBuild)
if node.attrib.showPublicBuilds then
self.showPublicBuilds = node.attrib.showPublicBuilds == "true"
end
if node.attrib.showEHPInBuildPanel then
self.showEHPInBuildPanel = node.attrib.showEHPInBuildPanel == "true"
end
end
end
end
Expand Down Expand Up @@ -727,7 +731,8 @@ function main:SaveSettings()
POESESSID = self.POESESSID,
invertSliderScrollDirection = tostring(self.invertSliderScrollDirection),
disableDevAutoSave = tostring(self.disableDevAutoSave),
showPublicBuilds = tostring(self.showPublicBuilds)
showPublicBuilds = tostring(self.showPublicBuilds),
showEHPInBuildPanel = tostring(self.showEHPInBuildPanel)
} })
local res, errMsg = common.xml.SaveXMLFile(setXML, self.userPath.."Settings.xml")
if not res then
Expand Down Expand Up @@ -975,6 +980,13 @@ function main:OpenOptionsPopup()
controls.invertSliderScrollDirection.tooltipText = "Default scroll direction is:\nScroll Up = Move right\nScroll Down = Move left"
controls.invertSliderScrollDirection.state = self.invertSliderScrollDirection

nextRow()
controls.showEHPInBuildPanel = new("CheckBoxControl", { "TOPLEFT", nil, "TOPLEFT" }, { defaultLabelPlacementX, currentY, 20 }, "^7Show EHP In Build Panel:", function(state)
self.showEHPInBuildPanel = state
end)
controls.showEHPInBuildPanel.tooltipText = "Display Effective Health Pool In The Left Build Panel"
controls.showEHPInBuildPanel.state = self.showEHPInBuildPanel

if launch.devMode then
nextRow()
controls.disableDevAutoSave = new("CheckBoxControl", { "TOPLEFT", nil, "TOPLEFT" }, { defaultLabelPlacementX, currentY, 20 }, "^7Disable Dev AutoSave:", function(state)
Expand Down
Loading