Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
LocalIdentity committed Jan 24, 2024
2 parents 783daf0 + b3ad403 commit 3e24abb
Show file tree
Hide file tree
Showing 18 changed files with 125 additions and 59 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## [v2.39.1](https://github.com/PathOfBuildingCommunity/PathOfBuilding/tree/v2.39.1) (2024/01/24)

[Full Changelog](https://github.com/PathOfBuildingCommunity/PathOfBuilding/compare/v2.39.0...v2.39.1)

<!-- Release notes generated using configuration in .github/release.yml at dev -->

## What's Changed
### Fixed Crashes
* Fix crash when opening old builds by reverting Cluster Jewel import fix
- Fix crash when hovering attribute requirements [\#7302](https://github.com/PathOfBuildingCommunity/PathOfBuilding/pull/7302) ([Wires77](https://github.com/Wires77))

### User Interface
- Fix breakdown sorting for unrelated stats [\#7303](https://github.com/PathOfBuildingCommunity/PathOfBuilding/pull/7303) ([Wires77](https://github.com/Wires77))
- Fix charge duration not displaying in breakdown [\#7296](https://github.com/PathOfBuildingCommunity/PathOfBuilding/pull/7296) ([Wires77](https://github.com/Wires77))

### Fixed Bugs
- Fix mods not applying to Vaal gems correctly [\#7300](https://github.com/PathOfBuildingCommunity/PathOfBuilding/pull/7300) ([sida-wang](https://github.com/sida-wang))



## [v2.39.0](https://github.com/PathOfBuildingCommunity/PathOfBuilding/tree/v2.39.0) (2024/01/23)

[Full Changelog](https://github.com/PathOfBuildingCommunity/PathOfBuilding/compare/v2.38.4...v2.39.0)
Expand Down
14 changes: 14 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
VERSION[2.39.1][2024/01/24]

--- Fixed Crashes ---
* Fix crash when opening old builds by reverting Cluster Jewel import fix
* Fix crash when hovering attribute requirements (Wires77)

--- User Interface ---
* Fix breakdown sorting for unrelated stats (Wires77)
* Fix charge duration not displaying in breakdown (Wires77)

--- Fixed Bugs ---
* Fix mods not applying to Vaal gems correctly (sida-wang)


VERSION[2.39.0][2024/01/23]

--- New to Path of Building ---
Expand Down
27 changes: 10 additions & 17 deletions src/Classes/CalcBreakdownControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ function CalcBreakdownClass:AddBreakdownSection(sectionData)
local rowList = copyTable(breakdown.rowList, true)
local colKey = breakdown.colList[1].key
table.sort(rowList, function(a, b)
if a.reqNum then
return a.reqNum > b.reqNum
end
return a[colKey] > b[colKey]
end)

Expand Down Expand Up @@ -300,29 +303,19 @@ function CalcBreakdownClass:AddModSection(sectionData, modList)
}
t_insert(self.sectionList, section)

table.sort(rowList, function(a, b)
-- Sort Modifiers by descending value
if type(a.value) == 'number' and type(b.value) == 'number' then
return b.value < a.value
end
if type(a.value) == 'boolean' and type(b.value) == 'boolean' then
return a.value and not b.value
end
return false
end)

if not modList and not sectionData.modType then
-- Sort modifiers by type
for i, row in ipairs(rowList) do
row.index = i
end
table.sort(rowList, function(a, b)
if a.mod.type == b.mod.type then
return a.index < b.index
return a.mod.name > b.mod.name or a.mod.name == b.mod.name and a.value > b.value
else
return a.mod.type < b.mod.type
end
end)
else -- Sort modifiers by value
table.sort(rowList, function(a, b)
return a.mod.name > b.mod.name or a.mod.name == b.mod.name and a.value > b.value
end)
end

local sourceTotals = { }
Expand Down Expand Up @@ -742,9 +735,9 @@ function CalcBreakdownClass:OnKeyUp(key)
if not self:IsShown() or not self:IsEnabled() then
return
end
if key == "WHEELDOWN" then
if self.controls.scrollBar:IsScrollDownKey(key) then
self.controls.scrollBar:Scroll(1)
elseif key == "WHEELUP" then
elseif self.controls.scrollBar:IsScrollUpKey(key) then
self.controls.scrollBar:Scroll(-1)
end
return self
Expand Down
8 changes: 4 additions & 4 deletions src/Classes/CalcsTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ function CalcsTabClass:Draw(viewPort, inputEvents)
section:UpdatePos()
end

for id, event in ipairs(inputEvents) do
for _, event in ipairs(inputEvents) do
if event.type == "KeyDown" then
if event.key == "z" and IsKeyDown("CTRL") then
self:Undo()
Expand All @@ -316,11 +316,11 @@ function CalcsTabClass:Draw(viewPort, inputEvents)
end
end
self:ProcessControlsInput(inputEvents, viewPort)
for id, event in ipairs(inputEvents) do
for _, event in ipairs(inputEvents) do
if event.type == "KeyUp" then
if event.key == "WHEELDOWN" then
if self.controls.scrollBar:IsScrollDownKey(event.key) then
self.controls.scrollBar:Scroll(1)
elseif event.key == "WHEELUP" then
elseif self.controls.scrollBar:IsScrollUpKey(event.key) then
self.controls.scrollBar:Scroll(-1)
end
end
Expand Down
8 changes: 4 additions & 4 deletions src/Classes/ConfigTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ function ConfigTabClass:Draw(viewPort, inputEvents)
self.width = viewPort.width
self.height = viewPort.height

for id, event in ipairs(inputEvents) do
for _, event in ipairs(inputEvents) do
if event.type == "KeyDown" then
if event.key == "z" and IsKeyDown("CTRL") then
self:Undo()
Expand All @@ -707,11 +707,11 @@ function ConfigTabClass:Draw(viewPort, inputEvents)
end

self:ProcessControlsInput(inputEvents, viewPort)
for id, event in ipairs(inputEvents) do
for _, event in ipairs(inputEvents) do
if event.type == "KeyUp" then
if event.key == "WHEELDOWN" then
if self.controls.scrollBar:IsScrollDownKey(event.key) then
self.controls.scrollBar:Scroll(1)
elseif event.key == "WHEELUP" then
elseif self.controls.scrollBar:IsScrollUpKey(event.key) then
self.controls.scrollBar:Scroll(-1)
end
end
Expand Down
4 changes: 2 additions & 2 deletions src/Classes/DropDownControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ function DropDownClass:OnKeyUp(key)
self:SetSel(math.floor((cursorY - dropY + self.controls.scrollBar.offset) / (height - 4)) + 1)
self.dropped = false
end
elseif key == "WHEELDOWN" then
elseif self.controls.scrollBar:IsScrollDownKey(key) then
if self.dropped and self.controls.scrollBar.enabled then
self.controls.scrollBar:Scroll(1)
else
Expand All @@ -439,7 +439,7 @@ function DropDownClass:OnKeyUp(key)
self:SetSel(self:ListIndexToDropIndex(self.selIndex, 0) + 1)
self:ScrollSelIntoView()
return self
elseif key == "WHEELUP" then
elseif self.controls.scrollBar:IsScrollUpKey(key) then
if self.dropped and self.controls.scrollBar.enabled then
self.controls.scrollBar:Scroll(-1)
else
Expand Down
4 changes: 2 additions & 2 deletions src/Classes/EditControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -711,15 +711,15 @@ function EditClass:OnKeyUp(key)
end
end
end
elseif key == "WHEELUP" then
elseif self.controls.scrollBarV:IsScrollUpKey(key) then
if ctrl and self.allowZoom then
self:ZoomText("+")
elseif self.controls.scrollBarV.enabled then
self.controls.scrollBarV:Scroll(-1)
else
self.controls.scrollBarH:Scroll(-1)
end
elseif key == "WHEELDOWN" then
elseif self.controls.scrollBarV:IsScrollDownKey(key) then
if ctrl and self.allowZoom then
self:ZoomText("-")
elseif self.controls.scrollBarV.enabled then
Expand Down
4 changes: 2 additions & 2 deletions src/Classes/GemSelectControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -747,9 +747,9 @@ function GemSelectClass:OnKeyDown(key, doubleClick)
self.selIndex = self.initialIndex
self:UpdateGem(false,true)
return
elseif key == "WHEELUP" then
elseif self.controls.scrollBar:IsScrollUpKey(key) then
self.controls.scrollBar:Scroll(-1)
elseif key == "WHEELDOWN" then
elseif self.controls.scrollBar:IsScrollDownKey(key) then
self.controls.scrollBar:Scroll(1)
elseif key == "DOWN" then
if self.selIndex < #self.list and not self.noMatches then
Expand Down
8 changes: 4 additions & 4 deletions src/Classes/ItemsTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@ function ItemsTabClass:Draw(viewPort, inputEvents)
self.x = self.x - self.controls.scrollBarH.offset
self.y = self.y - self.controls.scrollBarV.offset

for id, event in ipairs(inputEvents) do
for _, event in ipairs(inputEvents) do
if event.type == "KeyDown" then
if event.key == "v" and IsKeyDown("CTRL") then
local newItem = Paste()
Expand Down Expand Up @@ -1176,15 +1176,15 @@ function ItemsTabClass:Draw(viewPort, inputEvents)
end
end
self:ProcessControlsInput(inputEvents, viewPort)
for id, event in ipairs(inputEvents) do
for _, event in ipairs(inputEvents) do
if event.type == "KeyUp" then
if event.key == "WHEELDOWN" or event.key == "PAGEDOWN" then
if self.controls.scrollBarV:IsScrollDownKey(event.key) then
if self.controls.scrollBarV:IsMouseOver() or not self.controls.scrollBarH:IsShown() then
self.controls.scrollBarV:Scroll(1)
else
self.controls.scrollBarH:Scroll(1)
end
elseif event.key == "WHEELUP" or event.key == "PAGEUP" then
elseif self.controls.scrollBarV:IsScrollUpKey(event.key) then
if self.controls.scrollBarV:IsMouseOver() or not self.controls.scrollBarH:IsShown() then
self.controls.scrollBarV:Scroll(-1)
else
Expand Down
4 changes: 2 additions & 2 deletions src/Classes/ListControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -403,13 +403,13 @@ function ListClass:OnKeyUp(key)
if not self:IsShown() or not self:IsEnabled() then
return
end
if key == "WHEELDOWN" then
if self.controls.scrollBarV:IsScrollDownKey(key) then
if self.scroll and self.scrollH and IsKeyDown("SHIFT") then
self.controls.scrollBarH:Scroll(1)
else
self.controls.scrollBarV:Scroll(1)
end
elseif key == "WHEELUP" then
elseif self.controls.scrollBarV:IsScrollUpKey(key) then
if self.scroll and self.scrollH and IsKeyDown("SHIFT") then
self.controls.scrollBarH:Scroll(-1)
else
Expand Down
2 changes: 1 addition & 1 deletion src/Classes/ModStore.lua
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ function ModStoreClass:EvalMod(mod, cfg)
elseif tag.type == "SkillName" then
local match = false
if tag.includeTransfigured then
local matchGameId = tag.summonSkill and (cfg and calcLib.getGameIdFromGemName(cfg.summonSkillName, true) or "") or (cfg and cfg.skillGem and cfg.skillGem.gameId or "")
local matchGameId = tag.summonSkill and (cfg and calcLib.getGameIdFromGemName(cfg.summonSkillName, true) or "") or (cfg and cfg.skillName and calcLib.getGameIdFromGemName(cfg.skillName, true) or "")
if tag.skillNameList then
for _, name in pairs(tag.skillNameList) do
if name and matchGameId == calcLib.getGameIdFromGemName(name, true) then
Expand Down
35 changes: 22 additions & 13 deletions src/Classes/PassiveSpec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1337,9 +1337,7 @@ function PassiveSpecClass:BuildClusterJewelGraphs()
node.alloc = true
if not self.allocNodes[nodeId] then
self.allocNodes[nodeId] = node
if not isValueInArray(self.allocExtendedNodes, nodeId) then
t_insert(self.allocExtendedNodes, nodeId)
end
t_insert(self.allocExtendedNodes, nodeId)
end
end
end
Expand Down Expand Up @@ -1429,10 +1427,6 @@ function PassiveSpecClass:BuildSubgraph(jewel, parentSocket, id, upSize, importe
end

local function addToAllocatedSubgraphNodes(node)
-- Don't add to allocSubgraphNodes if node already exists
if isValueInArray(self.allocSubgraphNodes, node.id) then
return false
end
local proxyGroup = matchGroup(expansionJewel.proxy)
if proxyGroup then
for id, data in pairs(importedNodes) do
Expand Down Expand Up @@ -1479,6 +1473,7 @@ function PassiveSpecClass:BuildSubgraph(jewel, parentSocket, id, upSize, importe
self.nodes[node.id] = node
if addToAllocatedSubgraphNodes(node) then
t_insert(self.allocSubgraphNodes, node.id)
t_insert(self.allocExtendedNodes, node.id)
end
return
end
Expand All @@ -1493,6 +1488,21 @@ function PassiveSpecClass:BuildSubgraph(jewel, parentSocket, id, upSize, importe
end
end

-- Check if we need to downsize the group
local groupSize = expansionJewel.size
upSize = upSize or 0
while clusterJewel.sizeIndex < groupSize do
-- Look for the socket with index 1 first (middle socket of large groups), then index 0
local socket = findSocket(proxyGroup, 1) or findSocket(proxyGroup, 0)
assert(socket, "Downsizing socket not found")

-- Grab the proxy node/group from the socket
proxyNode = self.tree.nodes[tonumber(socket.expansionJewel.proxy)]
proxyGroup = proxyNode.group
groupSize = socket.expansionJewel.size
upSize = upSize + 1
end

-- Initialise orbit flags
local nodeOrbit = clusterJewel.sizeIndex + 1
subGraph.group.oo[nodeOrbit] = true
Expand Down Expand Up @@ -1704,14 +1714,13 @@ function PassiveSpecClass:BuildSubgraph(jewel, parentSocket, id, upSize, importe
return m_floor(srcOidx * destNodesPerOrbit / srcNodesPerOrbit)
end
end

local skillsPerOrbit = self.tree.skillsPerOrbit[clusterJewel.sizeIndex+2]
local startOidx = data.clusterJewels.orbitOffsets[proxyNode.id][clusterJewel.sizeIndex]
local proxyNodeSkillsPerOrbit = self.tree.skillsPerOrbit[proxyNode.o+1]

-- Translate oidx positioning to TreeData-relative values
for _, node in pairs(indicies) do
local startOidxRelativeToClusterIndicies = translateOidx(startOidx, skillsPerOrbit, clusterJewel.totalIndicies)
local correctedNodeOidxRelativeToClusterIndicies = (node.oidx + startOidx) % clusterJewel.totalIndicies
local correctedNodeOidxRelativeToTreeSkillsPerOrbit = translateOidx(correctedNodeOidxRelativeToClusterIndicies, clusterJewel.totalIndicies, skillsPerOrbit)
local proxyNodeOidxRelativeToClusterIndicies = translateOidx(proxyNode.oidx, proxyNodeSkillsPerOrbit, clusterJewel.totalIndicies)
local correctedNodeOidxRelativeToClusterIndicies = (node.oidx + proxyNodeOidxRelativeToClusterIndicies) % clusterJewel.totalIndicies
local correctedNodeOidxRelativeToTreeSkillsPerOrbit = translateOidx(correctedNodeOidxRelativeToClusterIndicies, clusterJewel.totalIndicies, proxyNodeSkillsPerOrbit)
node.oidx = correctedNodeOidxRelativeToTreeSkillsPerOrbit
end

Expand Down
6 changes: 6 additions & 0 deletions src/Classes/PopupDialog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ function PopupDialogClass:ProcessInput(inputEvents, viewPort)
return
end
end
elseif self.scrollBarFunc and event.type == "KeyUp" then
if self.controls.scrollBar:IsScrollDownKey(event.key) then
self.controls.scrollBar:Scroll(1)
elseif self.controls.scrollBar:IsScrollUpKey(event.key) then
self.controls.scrollBar:Scroll(-1)
end
end
end
self:ProcessControlsInput(inputEvents, viewPort)
Expand Down
13 changes: 11 additions & 2 deletions src/Classes/ScrollBarControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,18 @@ function ScrollBarClass:OnKeyUp(key)
self.holdRepeating = nil
self.holdPauseTime = nil
end
elseif key == "WHEELDOWN" then

elseif self:IsScrollDownKey(key) then
self:Scroll(1)
elseif key == "WHEELUP" then
elseif self:IsScrollUpKey(key) then
self:Scroll(-1)
end
end

-- Centralize inputs allowed to keep consistent scroll behavior for all scrollBars
function ScrollBarClass:IsScrollDownKey(key)
return isValueInTable({"WHEELDOWN", "PAGEDOWN"}, key)
end
function ScrollBarClass:IsScrollUpKey(key)
return isValueInTable({"WHEELUP", "PAGEUP"}, key)
end
8 changes: 4 additions & 4 deletions src/Classes/SkillsTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ function SkillsTabClass:Draw(viewPort, inputEvents)
end
self.x = self.x - self.controls.scrollBarH.offset

for id, event in ipairs(inputEvents) do
for _, event in ipairs(inputEvents) do
if event.type == "KeyDown" then
if event.key == "z" and IsKeyDown("CTRL") then
self:Undo()
Expand All @@ -513,11 +513,11 @@ function SkillsTabClass:Draw(viewPort, inputEvents)
end
end
self:ProcessControlsInput(inputEvents, viewPort)
for id, event in ipairs(inputEvents) do
for _, event in ipairs(inputEvents) do
if event.type == "KeyUp" then
if event.key == "WHEELDOWN" or event.key == "PAGEDOWN" then
if self.controls.scrollBarH:IsScrollDownKey(event.key) then
self.controls.scrollBarH:Scroll(1)
elseif event.key == "WHEELUP" or event.key == "PAGEUP" then
elseif self.controls.scrollBarH:IsScrollUpKey(event.key) then
self.controls.scrollBarH:Scroll(-1)
end
end
Expand Down
3 changes: 3 additions & 0 deletions src/Modules/CalcPerform.lua
Original file line number Diff line number Diff line change
Expand Up @@ -750,10 +750,13 @@ local function doActorCharges(env, actor)
-- Calculate current and maximum charges
output.PowerChargesMin = m_max(modDB:Sum("BASE", nil, "PowerChargesMin"), 0)
output.PowerChargesMax = m_max(modDB:Sum("BASE", nil, "PowerChargesMax"), 0)
output.PowerChargesDuration = m_floor(modDB:Sum("BASE", nil, "ChargeDuration") * (1 + modDB:Sum("INC", nil, "PowerChargesDuration", "ChargeDuration") / 100))
output.FrenzyChargesMin = m_max(modDB:Sum("BASE", nil, "FrenzyChargesMin"), 0)
output.FrenzyChargesMax = m_max(modDB:Flag(nil, "MaximumFrenzyChargesIsMaximumPowerCharges") and output.PowerChargesMax or modDB:Sum("BASE", nil, "FrenzyChargesMax"), 0)
output.FrenzyChargesDuration = m_floor(modDB:Sum("BASE", nil, "ChargeDuration") * (1 + modDB:Sum("INC", nil, "FrenzyChargesDuration", "ChargeDuration") / 100))
output.EnduranceChargesMin = m_max(modDB:Sum("BASE", nil, "EnduranceChargesMin"), 0)
output.EnduranceChargesMax = m_max(env.partyMembers.modDB:Flag(nil, "PartyMemberMaximumEnduranceChargesEqualToYours") and env.partyMembers.output.EnduranceChargesMax or (modDB:Flag(nil, "MaximumEnduranceChargesIsMaximumFrenzyCharges") and output.FrenzyChargesMax or modDB:Sum("BASE", nil, "EnduranceChargesMax")), 0)
output.EnduranceChargesDuration = m_floor(modDB:Sum("BASE", nil, "ChargeDuration") * (1 + modDB:Sum("INC", nil, "EnduranceChargesDuration", "ChargeDuration") / 100))
output.SiphoningChargesMax = m_max(modDB:Sum("BASE", nil, "SiphoningChargesMax"), 0)
output.ChallengerChargesMax = m_max(modDB:Sum("BASE", nil, "ChallengerChargesMax"), 0)
output.BlitzChargesMax = m_max(modDB:Sum("BASE", nil, "BlitzChargesMax"), 0)
Expand Down
Loading

0 comments on commit 3e24abb

Please sign in to comment.