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

Fix cluster jewel notable compare tooltip when crafting a cluster #5777

Merged
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
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