From afa17b7894f7c35d3a6c12d1c2ec863520f3a478 Mon Sep 17 00:00:00 2001 From: Peechey Date: Tue, 26 May 2026 07:49:36 +0000 Subject: [PATCH] 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)