Skip to content

Commit

Permalink
Don't use anointed amulets to calculate cluster notables (PathOfBuild…
Browse files Browse the repository at this point in the history
  • Loading branch information
Edvinas-Smita authored and Dullson committed Dec 6, 2023
1 parent a9ec13c commit 4ba47be
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/Classes/ItemsTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@ holding Shift will put it in the second.]])
return self.displayItem and self.displayItem.crafted and self.displayItem.clusterJewel
end
}

self.controls.displayItemClusterJewelNodeCountLabel = new("LabelControl", {"TOPLEFT",self.controls.displayItemClusterJewelSkill,"BOTTOMLEFT"}, 0, 7, 0, 14, "^7Added Passives:")
self.controls.displayItemClusterJewelNodeCount = new("SliderControl", {"LEFT",self.controls.displayItemClusterJewelNodeCountLabel,"RIGHT"}, 2, 0, 150, 20, function(val)
local divVal = self.controls.displayItemClusterJewelNodeCount:GetDivVal()
Expand Down Expand Up @@ -710,7 +711,7 @@ holding Shift will put it in the second.]])

-- Comparison
tooltip:AddSeparator(14)
self:AppendAnointTooltip(tooltip, node, "Allocating")
self:AppendAddedNotableTooltip(tooltip, node)

-- Information of for this notable appears
local clusterInfo = self.build.data.clusterJewelInfoForNotable[notableName]
Expand Down Expand Up @@ -2133,6 +2134,21 @@ function ItemsTabClass:AppendAnointTooltip(tooltip, node, actionText)
end
end

---Appends tooltip with information about added notable passive node if it would be allocated.
---@param tooltip table @The tooltip to append into
---@param node table @The passive tree node that will be added
function ItemsTabClass:AppendAddedNotableTooltip(tooltip, node)
local storedGlobalCacheDPSView = GlobalCache.useFullDPS
GlobalCache.useFullDPS = GlobalCache.numActiveSkillInFullDPS > 0
local calcFunc, calcBase = self.build.calcsTab:GetMiscCalculator()
local outputNew = calcFunc({ addNodes = { [node] = true } }, { requirementsItems = true, requirementsGems = true, skills = true })
GlobalCache.useFullDPS = storedGlobalCacheDPSView
local numChanges = self.build:AddStatComparesToTooltip(tooltip, calcBase, outputNew, "^7Allocating "..node.dn.." will give you: ")
if numChanges == 0 then
tooltip:AddLine(14, "^7Allocating "..node.dn.." changes nothing.")
end
end

-- Opens the item anointing popup
function ItemsTabClass:AnointDisplayItem(enchantSlot)
self.anointEnchantSlot = enchantSlot or 1
Expand Down

0 comments on commit 4ba47be

Please sign in to comment.