Skip to content

Commit

Permalink
Add a warning when exceeding jewel limits (#6308)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lilylicious authored Aug 13, 2023
1 parent 4e9b055 commit bbd9f6d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Modules/Build.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1452,6 +1452,14 @@ function buildMode:AddDisplayStatList(statList, actor)
end
end

function buildMode:InsertItemWarnings()
if self.calcsTab.mainEnv.itemWarnings.jewelLimitWarning then
for _, warning in ipairs(self.calcsTab.mainEnv.itemWarnings.jewelLimitWarning) do
InsertIfNew(self.controls.warnings.lines, "You are exceeding jewel limit with the jewel "..warning)
end
end
end

-- Build list of side bar stats
function buildMode:RefreshStatList()
self.controls.warnings.lines = {}
Expand Down Expand Up @@ -1479,6 +1487,7 @@ function buildMode:RefreshStatList()
t_insert(statBoxList, { height = 14, align = "CENTER_X", x = 140, self.calcsTab.mainEnv.player.mainSkill.disableReason })
end
self:AddDisplayStatList(self.displayStats, self.calcsTab.mainEnv.player)
self:InsertItemWarnings()
end

function buildMode:CompareStatList(tooltip, statList, actor, baseOutput, compareOutput, header, nodeCount)
Expand Down
3 changes: 3 additions & 0 deletions src/Modules/CalcSetup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ function calcs.initEnv(build, mode, override, specEnv)
env.grantedSkillsNodes = { }
env.grantedSkillsItems = { }
env.explodeSources = { }
env.itemWarnings = { }
env.flasks = { }

-- tree based
Expand Down Expand Up @@ -635,6 +636,8 @@ function calcs.initEnv(build, mode, override, specEnv)
if item.jewelData then
item.jewelData.limitDisabled = true
end
env.itemWarnings.jewelLimitWarning = env.itemWarnings.jewelLimitWarning or { }
t_insert(env.itemWarnings.jewelLimitWarning, limitKey)
item = nil
else
jewelLimits[limitKey] = (jewelLimits[limitKey] or 0) + 1
Expand Down

0 comments on commit bbd9f6d

Please sign in to comment.