Skip to content

Commit 5fbc11d

Browse files
1 parent d837d9b commit 5fbc11d

2 files changed

Lines changed: 59 additions & 0 deletions

File tree

src/Modules/Main.lua

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ function main:Init()
9999
self.decimalSeparator = "."
100100
self.defaultItemAffixQuality = 0.5
101101
self.showTitlebarName = true
102+
self.dpiScaleOverridePercent = GetDPIScaleOverridePercent and GetDPIScaleOverridePercent() or 0
102103
self.showWarnings = true
103104
self.slotOnlyTooltips = true
104105
self.notSupportedModTooltips = true
@@ -847,6 +848,24 @@ function main:OpenOptionsPopup()
847848
controls.proxyURL:SetText(url)
848849
end
849850

851+
nextRow()
852+
controls.dpiScaleOverride = new("DropDownControl", { "TOPLEFT", nil, "TOPLEFT" }, { defaultLabelPlacementX, currentY, 150, 18 }, {
853+
{ label = "Use system default", percent = 0 },
854+
{ label = "100%", percent = 100 },
855+
{ label = "125%", percent = 125 },
856+
{ label = "150%", percent = 150 },
857+
{ label = "175%", percent = 175 },
858+
{ label = "200%", percent = 200 },
859+
{ label = "225%", percent = 225 },
860+
{ label = "250%", percent = 250 },
861+
}, function(index, value)
862+
self.dpiScaleOverridePercent = value.percent
863+
SetDPIScaleOverridePercent(value.percent)
864+
end)
865+
controls.dpiScaleOverrideLabel = new("LabelControl", { "RIGHT", controls.dpiScaleOverride, "LEFT" }, { defaultLabelSpacingPx, 0, 0, 16 }, "^7UI scaling override:")
866+
controls.dpiScaleOverride.tooltipText = "Overrides Windows DPI scaling inside Path of Building.\nChoose a percentage between 100% and 250% or revert to the system default."
867+
controls.dpiScaleOverride:SelByValue(self.dpiScaleOverridePercent, "percent")
868+
850869
nextRow()
851870
controls.buildPath = new("EditControl", { "TOPLEFT", nil, "TOPLEFT" }, { defaultLabelPlacementX, currentY, 290, 18 })
852871
controls.buildPathLabel = new("LabelControl", { "RIGHT", controls.buildPath, "LEFT" }, { defaultLabelSpacingPx, 0, 0, 16 }, "^7Build save path:")
@@ -1051,6 +1070,7 @@ function main:OpenOptionsPopup()
10511070
if not launch.devMode then
10521071
main:SetManifestBranch(self.betaTest and "beta" or "master")
10531072
end
1073+
SetDPIScaleOverridePercent(self.dpiScaleOverridePercent)
10541074
main:ClosePopup()
10551075
main:SaveSettings()
10561076
end)

src/Modules/Main.lua.rej

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
diff a/src/Modules/Main.lua b/src/Modules/Main.lua (rejected hunks)
2+
@@ -633,6 +634,10 @@ function main:LoadSettings(ignoreBuild)
3+
if node.attrib.showFlavourText then
4+
self.showFlavourText = node.attrib.showFlavourText == "true"
5+
end
6+
+ if node.attrib.dpiScaleOverridePercent then
7+
+ self.dpiScaleOverridePercent = tonumber(node.attrib.dpiScaleOverridePercent) or 0
8+
+ SetDPIScaleOverridePercent(self.dpiScaleOverridePercent)
9+
+ end
10+
end
11+
end
12+
end
13+
@@ -745,7 +750,8 @@ function main:SaveSettings()
14+
invertSliderScrollDirection = tostring(self.invertSliderScrollDirection),
15+
disableDevAutoSave = tostring(self.disableDevAutoSave),
16+
--showPublicBuilds = tostring(self.showPublicBuilds),
17+
- showFlavourText = tostring(self.showFlavourText)
18+
+ showFlavourText = tostring(self.showFlavourText),
19+
+ dpiScaleOverridePercent = tostring(self.dpiScaleOverridePercent)
20+
} })
21+
local res, errMsg = common.xml.SaveXMLFile(setXML, self.userPath.."Settings.xml")
22+
if not res then
23+
@@ -1039,6 +1063,7 @@ function main:OpenOptionsPopup()
24+
local initialDisableDevAutoSave = self.disableDevAutoSave
25+
--local initialShowPublicBuilds = self.showPublicBuilds
26+
local initialShowFlavourText = self.showFlavourText
27+
+ local initialDpiScaleOverridePercent = self.dpiScaleOverridePercent
28+
29+
-- last line with buttons has more spacing
30+
nextRow(1.5)
31+
@@ -1091,6 +1117,8 @@ function main:OpenOptionsPopup()
32+
self.disableDevAutoSave = initialDisableDevAutoSave
33+
self.showPublicBuilds = initialShowPublicBuilds
34+
self.showFlavourText = initialShowFlavourText
35+
+ self.dpiScaleOverridePercent = initialDpiScaleOverridePercent
36+
+ SetDPIScaleOverridePercent(self.dpiScaleOverridePercent)
37+
main:ClosePopup()
38+
end)
39+
nextRow(1.5)

0 commit comments

Comments
 (0)