Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion src/Modules/Main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -853,6 +859,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:")
Expand Down Expand Up @@ -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)
Expand All @@ -1064,6 +1089,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)
Expand Down Expand Up @@ -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)
Expand Down