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 sort by full dps not working on anoints and appearing in other locations #5421

Merged
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
3 changes: 3 additions & 0 deletions src/Classes/ItemDBControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ function ItemDBClass:ListBuilder()
if self.sortDetail and self.sortDetail.stat then -- stat-based
local start = GetTime()
local calcFunc, calcBase = self.itemsTab.build.calcsTab:GetMiscCalculator(self.build)
local storedGlobalCacheDPSView = GlobalCache.useFullDPS
GlobalCache.useFullDPS = GlobalCache.numActiveSkillInFullDPS > 0
for itemIndex, item in ipairs(list) do
item.measuredPower = 0
for slotName, slot in pairs(self.itemsTab.slots) do
Expand All @@ -244,6 +246,7 @@ function ItemDBClass:ListBuilder()
start = now
end
end
GlobalCache.useFullDPS = storedGlobalCacheDPSView
end

table.sort(list, function(a, b)
Expand Down
6 changes: 6 additions & 0 deletions src/Classes/ItemsTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1716,8 +1716,11 @@ function ItemsTabClass:AddModComparisonTooltip(tooltip, mod)
newItem:BuildAndParseRaw()

local calcFunc = self.build.calcsTab:GetMiscCalculator()
local storedGlobalCacheDPSView = GlobalCache.useFullDPS
GlobalCache.useFullDPS = GlobalCache.numActiveSkillInFullDPS > 0
local outputBase = calcFunc({ repSlotName = slotName, repItem = self.displayItem }, {})
local outputNew = calcFunc({ repSlotName = slotName, repItem = newItem }, {})
GlobalCache.useFullDPS = storedGlobalCacheDPSView
self.build:AddStatComparesToTooltip(tooltip, outputBase, outputNew, "\nAdding this mod will give: ")
end

Expand Down Expand Up @@ -2119,8 +2122,11 @@ function ItemsTabClass:AppendAnointTooltip(tooltip, node, actionText)
header = "^7"..actionText.." nothing will give you: "
end
local calcFunc = self.build.calcsTab:GetMiscCalculator()
local storedGlobalCacheDPSView = GlobalCache.useFullDPS
GlobalCache.useFullDPS = GlobalCache.numActiveSkillInFullDPS > 0
local outputBase = calcFunc({ repSlotName = "Amulet", repItem = self.displayItem }, {})
local outputNew = calcFunc({ repSlotName = "Amulet", repItem = self:anointItem(node) }, {})
GlobalCache.useFullDPS = storedGlobalCacheDPSView
local numChanges = self.build:AddStatComparesToTooltip(tooltip, outputBase, outputNew, header)
if node and numChanges == 0 then
tooltip:AddLine(14, "^7"..actionText.." "..node.dn.." changes nothing.")
Expand Down
3 changes: 3 additions & 0 deletions src/Classes/NotableDBControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ function NotableDBClass:ListBuilder()
local start = GetTime()
local calcFunc = self.itemsTab.build.calcsTab:GetMiscCalculator()
local itemType = self.itemsTab.displayItem.base.type
local storedGlobalCacheDPSView = GlobalCache.useFullDPS
GlobalCache.useFullDPS = GlobalCache.numActiveSkillInFullDPS > 0
local calcBase = calcFunc({ repSlotName = itemType, repItem = self.itemsTab:anointItem(nil) }, {})
self.sortMaxPower = 0
for nodeIndex, node in ipairs(list) do
Expand All @@ -156,6 +158,7 @@ function NotableDBClass:ListBuilder()
start = now
end
end
GlobalCache.useFullDPS = storedGlobalCacheDPSView

if #infinites > 0 then
self.sortMaxPower = self.sortMaxPower * 2
Expand Down