From afa17b7894f7c35d3a6c12d1c2ec863520f3a478 Mon Sep 17 00:00:00 2001 From: Peechey Date: Tue, 26 May 2026 07:49:36 +0000 Subject: [PATCH 1/3] Apply changes from https://github.com/PathOfBuildingCommunity/PathOfBuilding-PoE2/pull/1972 --- src/Modules/Build.lua | 2 +- src/Modules/Build.lua.rej | 151 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 152 insertions(+), 1 deletion(-) create mode 100644 src/Modules/Build.lua.rej diff --git a/src/Modules/Build.lua b/src/Modules/Build.lua index b7376f5d6bb..f140fb04a2a 100644 --- a/src/Modules/Build.lua +++ b/src/Modules/Build.lua @@ -188,7 +188,6 @@ function buildMode:Init(dbFileName, buildName, buildXML, convertBuild, importLin end self.controls.pointDisplay = new("Control", {"LEFT",self.anchorTopBarRight,"RIGHT"}, {function() return getPointDisplayX() end, 0, 0, 20}) self.controls.pointDisplay.width = function(control) - control.str, control.req = self:EstimatePlayerProgress() return DrawStringWidth(16, "FIXED", control.str) + 8 end self.controls.pointDisplay.Draw = function(control) @@ -1777,6 +1776,7 @@ function buildMode:RefreshStatList() end self:AddDisplayStatList(self.displayStats, self.calcsTab.mainEnv.player) self:InsertItemWarnings() + self:EstimatePlayerProgress() end function buildMode:CompareStatList(tooltip, statList, actor, baseOutput, compareOutput, header, nodeCount) diff --git a/src/Modules/Build.lua.rej b/src/Modules/Build.lua.rej new file mode 100644 index 00000000000..1cba69d5a90 --- /dev/null +++ b/src/Modules/Build.lua.rej @@ -0,0 +1,151 @@ +diff a/src/Modules/Build.lua b/src/Modules/Build.lua (rejected hunks) +@@ -831,78 +830,80 @@ function buildMode:SyncLoadouts() + end + + function buildMode:EstimatePlayerProgress() +- local PointsUsed, AscUsed, SecondaryAscUsed, socketsUsed, weaponSet1Used, weaponSet2Used = self.spec:CountAllocNodes() +- local extra = self.calcsTab.mainOutput and self.calcsTab.mainOutput.ExtraPoints or 0 +- local maxWeaponSets = self.maxWeaponSets +- local extraWeaponSets = self.calcsTab.mainOutput and self.calcsTab.mainOutput.PassivePointsToWeaponSetPoints or 0 +- local usedMax, ascMax, secondaryAscMax, level, act = 99 + maxWeaponSets + extra, 8, 8, 1, 0 +- +- repeat +- act = act + 1 +- level = m_min(m_max(PointsUsed + 1 - self.acts[act].questPoints - extra - m_min(weaponSet1Used, weaponSet2Used), self.acts[act].level), 100) +- until act == self.maxActs or level <= self.acts[act + 1].level +- +- if self.characterLevelAutoMode and self.characterLevel ~= level then +- self.characterLevel = level +- self.controls.characterLevel:SetText(self.characterLevel) +- self.configTab:BuildModList() +- end +- +- -- Ascendancy points for lab +- -- this is a recommendation for beginners who are using Path of Building for the first time and trying to map out progress in PoB +- local labSuggest = level < 33 and "" +- or level < 55 and "\nLabyrinth: Normal Lab" +- or level < 68 and "\nLabyrinth: Cruel Lab" +- or level < 75 and "\nLabyrinth: Merciless Lab" +- or level < 90 and "\nLabyrinth: Uber Lab" +- or "" +- +- local normalPassives = PointsUsed - m_min(weaponSet1Used, weaponSet2Used) +- if normalPassives > usedMax then InsertIfNew(self.controls.warnings.lines, "You have too many passive points allocated") end +- if AscUsed > ascMax then InsertIfNew(self.controls.warnings.lines, "You have too many ascendancy points allocated") end +- if SecondaryAscUsed > secondaryAscMax then InsertIfNew(self.controls.warnings.lines, "You have too many secondary ascendancy points allocated") end +- +- -- if you are using more than maxWeaponSets + extraWeaponSets, you are using too many weapon sets +- local warningsWeaponSet = false +- if weaponSet1Used > (maxWeaponSets + extraWeaponSets) then +- warningsWeaponSet = true +- InsertIfNew(self.controls.warnings.lines, string.format( +- "You have allocated %d too many weapon set 1 passives", +- math.abs((maxWeaponSets + extraWeaponSets) - weaponSet1Used) +- )) +- end +- if weaponSet2Used > (maxWeaponSets + extraWeaponSets) then +- warningsWeaponSet = true +- InsertIfNew(self.controls.warnings.lines, string.format( +- "You have allocated %d too many weapon set 2 passives", +- math.abs((maxWeaponSets + extraWeaponSets) - weaponSet2Used) +- )) +- end +- +- if not warningsWeaponSet and weaponSet1Used ~= weaponSet2Used then +- InsertIfNew(self.controls.warnings.lines, string.format( +- "You have %d Weapon set 2 passives available", +- math.abs(weaponSet2Used - weaponSet1Used) +- )) +- end +- +- self.Act = act == self.maxActs and "Endgame" or "Act " .. act +- +- return string.format( +- "%s%3d / %3d %s%2d / %2d %s%2d / %2d %s%d / %d", +- normalPassives > usedMax and colorCodes.NEGATIVE or "^7", +- normalPassives, usedMax, +- colorCodes.NEGATIVE, +- weaponSet1Used, maxWeaponSets + extraWeaponSets, +- colorCodes.POSITIVE, +- weaponSet2Used, maxWeaponSets + extraWeaponSets, +- AscUsed > ascMax and colorCodes.NEGATIVE or "^7", +- AscUsed, ascMax +- ), +- string.format( ++ if self.spec then ++ local PointsUsed, AscUsed, SecondaryAscUsed, socketsUsed, weaponSet1Used, weaponSet2Used = self.spec:CountAllocNodes() ++ local extra = self.calcsTab.mainOutput and self.calcsTab.mainOutput.ExtraPoints or 0 ++ local maxWeaponSets = self.maxWeaponSets ++ local extraWeaponSets = self.calcsTab.mainOutput and self.calcsTab.mainOutput.PassivePointsToWeaponSetPoints or 0 ++ local usedMax, ascMax, secondaryAscMax, level, act = 99 + maxWeaponSets + extra, 8, 8, 1, 0 ++ ++ repeat ++ act = act + 1 ++ level = m_min(m_max(PointsUsed + 1 - self.acts[act].questPoints - extra - m_min(weaponSet1Used, weaponSet2Used), self.acts[act].level), 100) ++ until act == self.maxActs or level <= self.acts[act + 1].level ++ ++ if self.characterLevelAutoMode and self.characterLevel ~= level then ++ self.characterLevel = level ++ self.controls.characterLevel:SetText(self.characterLevel) ++ self.configTab:BuildModList() ++ end ++ ++ -- Ascendancy points for lab ++ -- this is a recommendation for beginners who are using Path of Building for the first time and trying to map out progress in PoB ++ local labSuggest = level < 33 and "" ++ or level < 55 and "\nLabyrinth: Normal Lab" ++ or level < 68 and "\nLabyrinth: Cruel Lab" ++ or level < 75 and "\nLabyrinth: Merciless Lab" ++ or level < 90 and "\nLabyrinth: Uber Lab" ++ or "" ++ ++ local normalPassives = PointsUsed - m_min(weaponSet1Used, weaponSet2Used) ++ if normalPassives > usedMax then InsertIfNew(self.controls.warnings.lines, "You have too many passive points allocated") end ++ if AscUsed > ascMax then InsertIfNew(self.controls.warnings.lines, "You have too many ascendancy points allocated") end ++ if SecondaryAscUsed > secondaryAscMax then InsertIfNew(self.controls.warnings.lines, "You have too many secondary ascendancy points allocated") end ++ ++ -- if you are using more than maxWeaponSets + extraWeaponSets, you are using too many weapon sets ++ local warningsWeaponSet = false ++ if weaponSet1Used > (maxWeaponSets + extraWeaponSets) then ++ warningsWeaponSet = true ++ InsertIfNew(self.controls.warnings.lines, string.format( ++ "You have allocated %d too many weapon set 1 passives", ++ math.abs((maxWeaponSets + extraWeaponSets) - weaponSet1Used) ++ )) ++ end ++ if weaponSet2Used > (maxWeaponSets + extraWeaponSets) then ++ warningsWeaponSet = true ++ InsertIfNew(self.controls.warnings.lines, string.format( ++ "You have allocated %d too many weapon set 2 passives", ++ math.abs((maxWeaponSets + extraWeaponSets) - weaponSet2Used) ++ )) ++ end ++ ++ if not warningsWeaponSet and weaponSet1Used ~= weaponSet2Used then ++ InsertIfNew(self.controls.warnings.lines, string.format( ++ "You have %d Weapon set 2 passives available", ++ math.abs(weaponSet2Used - weaponSet1Used) ++ )) ++ end ++ ++ self.Act = act == self.maxActs and "Endgame" or "Act " .. act ++ ++ self.controls.pointDisplay.str = string.format( ++ "%s%3d / %3d %s%2d / %2d %s%2d / %2d %s%d / %d", ++ normalPassives > usedMax and colorCodes.NEGATIVE or "^7", ++ normalPassives, usedMax, ++ colorCodes.NEGATIVE, ++ weaponSet1Used, maxWeaponSets + extraWeaponSets, ++ colorCodes.POSITIVE, ++ weaponSet2Used, maxWeaponSets + extraWeaponSets, ++ AscUsed > ascMax and colorCodes.NEGATIVE or "^7", ++ AscUsed, ascMax ++ ) ++ self.controls.pointDisplay.req = string.format( + "Required Level: %d\nEstimated Progress:\nAct: %s\nExtra Skillpoints: %d%s", + level, self.Act, extra, labSuggest + ) ++ end + end + + function buildMode:CanExit(mode) From 56424e53f4ce16992d72baf7f1d401a1eecb1804 Mon Sep 17 00:00:00 2001 From: LocalIdentity Date: Thu, 23 Jul 2026 08:38:51 +1000 Subject: [PATCH 2/3] Fix merge --- src/Modules/Build.lua | 72 ++++++++++-------- src/Modules/Build.lua.rej | 151 -------------------------------------- 2 files changed, 41 insertions(+), 182 deletions(-) delete mode 100644 src/Modules/Build.lua.rej diff --git a/src/Modules/Build.lua b/src/Modules/Build.lua index f140fb04a2a..2394c2fca93 100644 --- a/src/Modules/Build.lua +++ b/src/Modules/Build.lua @@ -871,38 +871,48 @@ function buildMode:SyncLoadouts() end function buildMode:EstimatePlayerProgress() - local PointsUsed, AscUsed, SecondaryAscUsed = self.spec:CountAllocNodes() - local extra = self.calcsTab.mainOutput and self.calcsTab.mainOutput.ExtraPoints or 0 - local usedMax, ascMax, secondaryAscMax, level, act = 99 + 23 + extra, 8, 8, 1, 0 - - -- Find estimated act and level based on points used - repeat - act = act + 1 - level = m_min(m_max(PointsUsed + 1 - acts[act].questPoints - actExtra(act, extra), acts[act].level), 100) - until act == 11 or level <= acts[act + 1].level - - if self.characterLevelAutoMode and self.characterLevel ~= level then - self.characterLevel = level - self.controls.characterLevel:SetText(self.characterLevel) - self.configTab:BuildModList() + if self.spec then + local PointsUsed, AscUsed, SecondaryAscUsed = self.spec:CountAllocNodes() + local extra = self.calcsTab.mainOutput and self.calcsTab.mainOutput.ExtraPoints or 0 + local usedMax, ascMax, secondaryAscMax, level, act = 99 + 23 + extra, 8, 8, 1, 0 + + -- Find estimated act and level based on points used + repeat + act = act + 1 + level = m_min(m_max(PointsUsed + 1 - acts[act].questPoints - actExtra(act, extra), acts[act].level), 100) + until act == 11 or level <= acts[act + 1].level + + if self.characterLevelAutoMode and self.characterLevel ~= level then + self.characterLevel = level + self.controls.characterLevel:SetText(self.characterLevel) + self.configTab:BuildModList() + end + + -- Ascendancy points for lab + -- this is a recommendation for beginners who are using Path of Building for the first time and trying to map out progress in PoB + local labSuggest = level < 33 and "" + or level < 55 and "\nLabyrinth: Normal Lab" + or level < 68 and "\nLabyrinth: Cruel Lab" + or level < 75 and "\nLabyrinth: Merciless Lab" + or level < 90 and "\nLabyrinth: Uber Lab" + or "" + + if PointsUsed > usedMax then InsertIfNew(self.controls.warnings.lines, "You have too many passive points allocated") end + if AscUsed > ascMax then InsertIfNew(self.controls.warnings.lines, "You have too many ascendancy points allocated") end + if SecondaryAscUsed > secondaryAscMax then InsertIfNew(self.controls.warnings.lines, "You have too many secondary ascendancy points allocated") end + self.Act = level < 90 and act <= 10 and act or "Endgame" + + self.controls.pointDisplay.str = string.format("%s%3d / %3d %s%d / %d", + PointsUsed > usedMax and colorCodes.NEGATIVE or "^7", + PointsUsed, usedMax, + AscUsed > ascMax and colorCodes.NEGATIVE or "^7", + AscUsed, ascMax + ) + self.controls.pointDisplay.req = string.format( + "Required Level: %d\nEstimated Progress:\nAct: %s\nQuestpoints: %d\nExtra Skillpoints: %d%s", + level, self.Act, acts[act].questPoints, actExtra(act, extra), labSuggest + ) end - - -- Ascendancy points for lab - -- this is a recommendation for beginners who are using Path of Building for the first time and trying to map out progress in PoB - local labSuggest = level < 33 and "" - or level < 55 and "\nLabyrinth: Normal Lab" - or level < 68 and "\nLabyrinth: Cruel Lab" - or level < 75 and "\nLabyrinth: Merciless Lab" - or level < 90 and "\nLabyrinth: Uber Lab" - or "" - - if PointsUsed > usedMax then InsertIfNew(self.controls.warnings.lines, "You have too many passive points allocated") end - if AscUsed > ascMax then InsertIfNew(self.controls.warnings.lines, "You have too many ascendancy points allocated") end - if SecondaryAscUsed > secondaryAscMax then InsertIfNew(self.controls.warnings.lines, "You have too many secondary ascendancy points allocated") end - self.Act = level < 90 and act <= 10 and act or "Endgame" - - return string.format("%s%3d / %3d %s%d / %d", PointsUsed > usedMax and colorCodes.NEGATIVE or "^7", PointsUsed, usedMax, AscUsed > ascMax and colorCodes.NEGATIVE or "^7", AscUsed, ascMax), - "Required Level: "..level.."\nEstimated Progress:\nAct: "..self.Act.."\nQuestpoints: "..acts[act].questPoints.."\nExtra Skillpoints: "..actExtra(act, extra)..labSuggest end function buildMode:CanExit(mode) diff --git a/src/Modules/Build.lua.rej b/src/Modules/Build.lua.rej deleted file mode 100644 index 1cba69d5a90..00000000000 --- a/src/Modules/Build.lua.rej +++ /dev/null @@ -1,151 +0,0 @@ -diff a/src/Modules/Build.lua b/src/Modules/Build.lua (rejected hunks) -@@ -831,78 +830,80 @@ function buildMode:SyncLoadouts() - end - - function buildMode:EstimatePlayerProgress() -- local PointsUsed, AscUsed, SecondaryAscUsed, socketsUsed, weaponSet1Used, weaponSet2Used = self.spec:CountAllocNodes() -- local extra = self.calcsTab.mainOutput and self.calcsTab.mainOutput.ExtraPoints or 0 -- local maxWeaponSets = self.maxWeaponSets -- local extraWeaponSets = self.calcsTab.mainOutput and self.calcsTab.mainOutput.PassivePointsToWeaponSetPoints or 0 -- local usedMax, ascMax, secondaryAscMax, level, act = 99 + maxWeaponSets + extra, 8, 8, 1, 0 -- -- repeat -- act = act + 1 -- level = m_min(m_max(PointsUsed + 1 - self.acts[act].questPoints - extra - m_min(weaponSet1Used, weaponSet2Used), self.acts[act].level), 100) -- until act == self.maxActs or level <= self.acts[act + 1].level -- -- if self.characterLevelAutoMode and self.characterLevel ~= level then -- self.characterLevel = level -- self.controls.characterLevel:SetText(self.characterLevel) -- self.configTab:BuildModList() -- end -- -- -- Ascendancy points for lab -- -- this is a recommendation for beginners who are using Path of Building for the first time and trying to map out progress in PoB -- local labSuggest = level < 33 and "" -- or level < 55 and "\nLabyrinth: Normal Lab" -- or level < 68 and "\nLabyrinth: Cruel Lab" -- or level < 75 and "\nLabyrinth: Merciless Lab" -- or level < 90 and "\nLabyrinth: Uber Lab" -- or "" -- -- local normalPassives = PointsUsed - m_min(weaponSet1Used, weaponSet2Used) -- if normalPassives > usedMax then InsertIfNew(self.controls.warnings.lines, "You have too many passive points allocated") end -- if AscUsed > ascMax then InsertIfNew(self.controls.warnings.lines, "You have too many ascendancy points allocated") end -- if SecondaryAscUsed > secondaryAscMax then InsertIfNew(self.controls.warnings.lines, "You have too many secondary ascendancy points allocated") end -- -- -- if you are using more than maxWeaponSets + extraWeaponSets, you are using too many weapon sets -- local warningsWeaponSet = false -- if weaponSet1Used > (maxWeaponSets + extraWeaponSets) then -- warningsWeaponSet = true -- InsertIfNew(self.controls.warnings.lines, string.format( -- "You have allocated %d too many weapon set 1 passives", -- math.abs((maxWeaponSets + extraWeaponSets) - weaponSet1Used) -- )) -- end -- if weaponSet2Used > (maxWeaponSets + extraWeaponSets) then -- warningsWeaponSet = true -- InsertIfNew(self.controls.warnings.lines, string.format( -- "You have allocated %d too many weapon set 2 passives", -- math.abs((maxWeaponSets + extraWeaponSets) - weaponSet2Used) -- )) -- end -- -- if not warningsWeaponSet and weaponSet1Used ~= weaponSet2Used then -- InsertIfNew(self.controls.warnings.lines, string.format( -- "You have %d Weapon set 2 passives available", -- math.abs(weaponSet2Used - weaponSet1Used) -- )) -- end -- -- self.Act = act == self.maxActs and "Endgame" or "Act " .. act -- -- return string.format( -- "%s%3d / %3d %s%2d / %2d %s%2d / %2d %s%d / %d", -- normalPassives > usedMax and colorCodes.NEGATIVE or "^7", -- normalPassives, usedMax, -- colorCodes.NEGATIVE, -- weaponSet1Used, maxWeaponSets + extraWeaponSets, -- colorCodes.POSITIVE, -- weaponSet2Used, maxWeaponSets + extraWeaponSets, -- AscUsed > ascMax and colorCodes.NEGATIVE or "^7", -- AscUsed, ascMax -- ), -- string.format( -+ if self.spec then -+ local PointsUsed, AscUsed, SecondaryAscUsed, socketsUsed, weaponSet1Used, weaponSet2Used = self.spec:CountAllocNodes() -+ local extra = self.calcsTab.mainOutput and self.calcsTab.mainOutput.ExtraPoints or 0 -+ local maxWeaponSets = self.maxWeaponSets -+ local extraWeaponSets = self.calcsTab.mainOutput and self.calcsTab.mainOutput.PassivePointsToWeaponSetPoints or 0 -+ local usedMax, ascMax, secondaryAscMax, level, act = 99 + maxWeaponSets + extra, 8, 8, 1, 0 -+ -+ repeat -+ act = act + 1 -+ level = m_min(m_max(PointsUsed + 1 - self.acts[act].questPoints - extra - m_min(weaponSet1Used, weaponSet2Used), self.acts[act].level), 100) -+ until act == self.maxActs or level <= self.acts[act + 1].level -+ -+ if self.characterLevelAutoMode and self.characterLevel ~= level then -+ self.characterLevel = level -+ self.controls.characterLevel:SetText(self.characterLevel) -+ self.configTab:BuildModList() -+ end -+ -+ -- Ascendancy points for lab -+ -- this is a recommendation for beginners who are using Path of Building for the first time and trying to map out progress in PoB -+ local labSuggest = level < 33 and "" -+ or level < 55 and "\nLabyrinth: Normal Lab" -+ or level < 68 and "\nLabyrinth: Cruel Lab" -+ or level < 75 and "\nLabyrinth: Merciless Lab" -+ or level < 90 and "\nLabyrinth: Uber Lab" -+ or "" -+ -+ local normalPassives = PointsUsed - m_min(weaponSet1Used, weaponSet2Used) -+ if normalPassives > usedMax then InsertIfNew(self.controls.warnings.lines, "You have too many passive points allocated") end -+ if AscUsed > ascMax then InsertIfNew(self.controls.warnings.lines, "You have too many ascendancy points allocated") end -+ if SecondaryAscUsed > secondaryAscMax then InsertIfNew(self.controls.warnings.lines, "You have too many secondary ascendancy points allocated") end -+ -+ -- if you are using more than maxWeaponSets + extraWeaponSets, you are using too many weapon sets -+ local warningsWeaponSet = false -+ if weaponSet1Used > (maxWeaponSets + extraWeaponSets) then -+ warningsWeaponSet = true -+ InsertIfNew(self.controls.warnings.lines, string.format( -+ "You have allocated %d too many weapon set 1 passives", -+ math.abs((maxWeaponSets + extraWeaponSets) - weaponSet1Used) -+ )) -+ end -+ if weaponSet2Used > (maxWeaponSets + extraWeaponSets) then -+ warningsWeaponSet = true -+ InsertIfNew(self.controls.warnings.lines, string.format( -+ "You have allocated %d too many weapon set 2 passives", -+ math.abs((maxWeaponSets + extraWeaponSets) - weaponSet2Used) -+ )) -+ end -+ -+ if not warningsWeaponSet and weaponSet1Used ~= weaponSet2Used then -+ InsertIfNew(self.controls.warnings.lines, string.format( -+ "You have %d Weapon set 2 passives available", -+ math.abs(weaponSet2Used - weaponSet1Used) -+ )) -+ end -+ -+ self.Act = act == self.maxActs and "Endgame" or "Act " .. act -+ -+ self.controls.pointDisplay.str = string.format( -+ "%s%3d / %3d %s%2d / %2d %s%2d / %2d %s%d / %d", -+ normalPassives > usedMax and colorCodes.NEGATIVE or "^7", -+ normalPassives, usedMax, -+ colorCodes.NEGATIVE, -+ weaponSet1Used, maxWeaponSets + extraWeaponSets, -+ colorCodes.POSITIVE, -+ weaponSet2Used, maxWeaponSets + extraWeaponSets, -+ AscUsed > ascMax and colorCodes.NEGATIVE or "^7", -+ AscUsed, ascMax -+ ) -+ self.controls.pointDisplay.req = string.format( - "Required Level: %d\nEstimated Progress:\nAct: %s\nExtra Skillpoints: %d%s", - level, self.Act, extra, labSuggest - ) -+ end - end - - function buildMode:CanExit(mode) From bd5c72faa7782b2ef8bc65a5ec54438c2981ddea Mon Sep 17 00:00:00 2001 From: LocalIdentity Date: Thu, 23 Jul 2026 08:55:32 +1000 Subject: [PATCH 3/3] Fix test --- spec/System/TestRadiusJewelStatDiff_spec.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/System/TestRadiusJewelStatDiff_spec.lua b/spec/System/TestRadiusJewelStatDiff_spec.lua index 008fa01e547..e9045b37953 100644 --- a/spec/System/TestRadiusJewelStatDiff_spec.lua +++ b/spec/System/TestRadiusJewelStatDiff_spec.lua @@ -362,6 +362,9 @@ describe("TestRadiusJewelStatDiff", function() local conqueredNode = nodesInRadius[1] local origNode = spec.tree.nodes[conqueredNode.id] simulateKaruiConquest(conqueredNode) + -- The simulation happens after setup's calculation pass, so refresh the + -- cached misc calculator before taking the conquered-state snapshot. + build.calcsTab:BuildOutput() -- Snapshot the state including the simulated conquest, then revert -- the conquered node back to the original tree node via override.