From 5fbc11d45dacaa86d3ede009a3851d08a5151817 Mon Sep 17 00:00:00 2001 From: LocalIdentity Date: Sun, 26 Oct 2025 09:24:04 +0000 Subject: [PATCH 1/3] Apply changes from https://github.com/PathOfBuildingCommunity/PathOfBuilding-PoE2/pull/1512 --- src/Modules/Main.lua | 20 ++++++++++++++++++++ src/Modules/Main.lua.rej | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 src/Modules/Main.lua.rej diff --git a/src/Modules/Main.lua b/src/Modules/Main.lua index 87dd2744cf..ee8ba69150 100644 --- a/src/Modules/Main.lua +++ b/src/Modules/Main.lua @@ -99,6 +99,7 @@ function main:Init() self.decimalSeparator = "." self.defaultItemAffixQuality = 0.5 self.showTitlebarName = true + self.dpiScaleOverridePercent = GetDPIScaleOverridePercent and GetDPIScaleOverridePercent() or 0 self.showWarnings = true self.slotOnlyTooltips = true self.notSupportedModTooltips = true @@ -847,6 +848,24 @@ function main:OpenOptionsPopup() controls.proxyURL:SetText(url) end + nextRow() + controls.dpiScaleOverride = new("DropDownControl", { "TOPLEFT", nil, "TOPLEFT" }, { defaultLabelPlacementX, currentY, 150, 18 }, { + { label = "Use system default", percent = 0 }, + { label = "100%", percent = 100 }, + { label = "125%", percent = 125 }, + { label = "150%", percent = 150 }, + { label = "175%", percent = 175 }, + { label = "200%", percent = 200 }, + { label = "225%", percent = 225 }, + { label = "250%", percent = 250 }, + }, function(index, value) + self.dpiScaleOverridePercent = value.percent + SetDPIScaleOverridePercent(value.percent) + end) + controls.dpiScaleOverrideLabel = new("LabelControl", { "RIGHT", controls.dpiScaleOverride, "LEFT" }, { defaultLabelSpacingPx, 0, 0, 16 }, "^7UI scaling override:") + controls.dpiScaleOverride.tooltipText = "Overrides Windows DPI scaling inside Path of Building.\nChoose a percentage between 100% and 250% or revert to the system default." + controls.dpiScaleOverride:SelByValue(self.dpiScaleOverridePercent, "percent") + nextRow() controls.buildPath = new("EditControl", { "TOPLEFT", nil, "TOPLEFT" }, { defaultLabelPlacementX, currentY, 290, 18 }) controls.buildPathLabel = new("LabelControl", { "RIGHT", controls.buildPath, "LEFT" }, { defaultLabelSpacingPx, 0, 0, 16 }, "^7Build save path:") @@ -1051,6 +1070,7 @@ function main:OpenOptionsPopup() if not launch.devMode then main:SetManifestBranch(self.betaTest and "beta" or "master") end + SetDPIScaleOverridePercent(self.dpiScaleOverridePercent) main:ClosePopup() main:SaveSettings() end) diff --git a/src/Modules/Main.lua.rej b/src/Modules/Main.lua.rej new file mode 100644 index 0000000000..f21a39a1c0 --- /dev/null +++ b/src/Modules/Main.lua.rej @@ -0,0 +1,39 @@ +diff a/src/Modules/Main.lua b/src/Modules/Main.lua (rejected hunks) +@@ -633,6 +634,10 @@ function main:LoadSettings(ignoreBuild) + if node.attrib.showFlavourText then + self.showFlavourText = node.attrib.showFlavourText == "true" + end ++ if node.attrib.dpiScaleOverridePercent then ++ self.dpiScaleOverridePercent = tonumber(node.attrib.dpiScaleOverridePercent) or 0 ++ SetDPIScaleOverridePercent(self.dpiScaleOverridePercent) ++ end + end + end + end +@@ -745,7 +750,8 @@ function main:SaveSettings() + invertSliderScrollDirection = tostring(self.invertSliderScrollDirection), + disableDevAutoSave = tostring(self.disableDevAutoSave), + --showPublicBuilds = tostring(self.showPublicBuilds), +- showFlavourText = tostring(self.showFlavourText) ++ showFlavourText = tostring(self.showFlavourText), ++ dpiScaleOverridePercent = tostring(self.dpiScaleOverridePercent) + } }) + local res, errMsg = common.xml.SaveXMLFile(setXML, self.userPath.."Settings.xml") + if not res then +@@ -1039,6 +1063,7 @@ function main:OpenOptionsPopup() + local initialDisableDevAutoSave = self.disableDevAutoSave + --local initialShowPublicBuilds = self.showPublicBuilds + local initialShowFlavourText = self.showFlavourText ++ local initialDpiScaleOverridePercent = self.dpiScaleOverridePercent + + -- last line with buttons has more spacing + nextRow(1.5) +@@ -1091,6 +1117,8 @@ function main:OpenOptionsPopup() + self.disableDevAutoSave = initialDisableDevAutoSave + self.showPublicBuilds = initialShowPublicBuilds + self.showFlavourText = initialShowFlavourText ++ self.dpiScaleOverridePercent = initialDpiScaleOverridePercent ++ SetDPIScaleOverridePercent(self.dpiScaleOverridePercent) + main:ClosePopup() + end) + nextRow(1.5) From e46d241eff7065bcb8eec81839d3731efdce95c1 Mon Sep 17 00:00:00 2001 From: LocalIdentity Date: Fri, 31 Oct 2025 00:32:19 +1100 Subject: [PATCH 2/3] Fix merge issues --- src/Modules/Main.lua | 8 ++++++++ src/Modules/Main.lua.rej | 39 --------------------------------------- 2 files changed, 8 insertions(+), 39 deletions(-) delete mode 100644 src/Modules/Main.lua.rej diff --git a/src/Modules/Main.lua b/src/Modules/Main.lua index ee8ba69150..7b5f90ef3b 100644 --- a/src/Modules/Main.lua +++ b/src/Modules/Main.lua @@ -629,6 +629,10 @@ function main:LoadSettings(ignoreBuild) if node.attrib.showPublicBuilds then self.showPublicBuilds = node.attrib.showPublicBuilds == "true" end + if node.attrib.dpiScaleOverridePercent then + self.dpiScaleOverridePercent = tonumber(node.attrib.dpiScaleOverridePercent) or 0 + SetDPIScaleOverridePercent(self.dpiScaleOverridePercent) + end end end end @@ -741,6 +745,7 @@ function main:SaveSettings() invertSliderScrollDirection = tostring(self.invertSliderScrollDirection), disableDevAutoSave = tostring(self.disableDevAutoSave), showPublicBuilds = tostring(self.showPublicBuilds) + dpiScaleOverridePercent = tostring(self.dpiScaleOverridePercent) } }) local res, errMsg = common.xml.SaveXMLFile(setXML, self.userPath.."Settings.xml") if not res then @@ -1045,6 +1050,7 @@ function main:OpenOptionsPopup() local initialInvertSliderScrollDirection = self.invertSliderScrollDirection local initialDisableDevAutoSave = self.disableDevAutoSave local initialShowPublicBuilds = self.showPublicBuilds + local initialDpiScaleOverridePercent = self.dpiScaleOverridePercent -- last line with buttons has more spacing nextRow(1.5) @@ -1097,6 +1103,8 @@ function main:OpenOptionsPopup() self.invertSliderScrollDirection = initialInvertSliderScrollDirection self.disableDevAutoSave = initialDisableDevAutoSave self.showPublicBuilds = initialShowPublicBuilds + self.dpiScaleOverridePercent = initialDpiScaleOverridePercent ++ SetDPIScaleOverridePercent(self.dpiScaleOverridePercent) main:ClosePopup() end) nextRow(1.5) diff --git a/src/Modules/Main.lua.rej b/src/Modules/Main.lua.rej deleted file mode 100644 index f21a39a1c0..0000000000 --- a/src/Modules/Main.lua.rej +++ /dev/null @@ -1,39 +0,0 @@ -diff a/src/Modules/Main.lua b/src/Modules/Main.lua (rejected hunks) -@@ -633,6 +634,10 @@ function main:LoadSettings(ignoreBuild) - if node.attrib.showFlavourText then - self.showFlavourText = node.attrib.showFlavourText == "true" - end -+ if node.attrib.dpiScaleOverridePercent then -+ self.dpiScaleOverridePercent = tonumber(node.attrib.dpiScaleOverridePercent) or 0 -+ SetDPIScaleOverridePercent(self.dpiScaleOverridePercent) -+ end - end - end - end -@@ -745,7 +750,8 @@ function main:SaveSettings() - invertSliderScrollDirection = tostring(self.invertSliderScrollDirection), - disableDevAutoSave = tostring(self.disableDevAutoSave), - --showPublicBuilds = tostring(self.showPublicBuilds), -- showFlavourText = tostring(self.showFlavourText) -+ showFlavourText = tostring(self.showFlavourText), -+ dpiScaleOverridePercent = tostring(self.dpiScaleOverridePercent) - } }) - local res, errMsg = common.xml.SaveXMLFile(setXML, self.userPath.."Settings.xml") - if not res then -@@ -1039,6 +1063,7 @@ function main:OpenOptionsPopup() - local initialDisableDevAutoSave = self.disableDevAutoSave - --local initialShowPublicBuilds = self.showPublicBuilds - local initialShowFlavourText = self.showFlavourText -+ local initialDpiScaleOverridePercent = self.dpiScaleOverridePercent - - -- last line with buttons has more spacing - nextRow(1.5) -@@ -1091,6 +1117,8 @@ function main:OpenOptionsPopup() - self.disableDevAutoSave = initialDisableDevAutoSave - self.showPublicBuilds = initialShowPublicBuilds - self.showFlavourText = initialShowFlavourText -+ self.dpiScaleOverridePercent = initialDpiScaleOverridePercent -+ SetDPIScaleOverridePercent(self.dpiScaleOverridePercent) - main:ClosePopup() - end) - nextRow(1.5) From 03b3a952964568bb69a40801a56538a96f736134 Mon Sep 17 00:00:00 2001 From: LocalIdentity Date: Fri, 31 Oct 2025 00:35:33 +1100 Subject: [PATCH 3/3] Fix missing commas --- src/Modules/Main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Modules/Main.lua b/src/Modules/Main.lua index 6d4308700b..c26c996373 100644 --- a/src/Modules/Main.lua +++ b/src/Modules/Main.lua @@ -759,8 +759,8 @@ function main:SaveSettings() POESESSID = self.POESESSID, invertSliderScrollDirection = tostring(self.invertSliderScrollDirection), disableDevAutoSave = tostring(self.disableDevAutoSave), - showPublicBuilds = tostring(self.showPublicBuilds) - dpiScaleOverridePercent = tostring(self.dpiScaleOverridePercent) + showPublicBuilds = tostring(self.showPublicBuilds), + dpiScaleOverridePercent = tostring(self.dpiScaleOverridePercent), } }) local res, errMsg = common.xml.SaveXMLFile(setXML, self.userPath.."Settings.xml") if not res then