pixelperfect: enable native scaling (disabled)

This commit is contained in:
shagu
2016-12-10 15:16:10 +01:00
parent 703d9b1471
commit 47bb751341
4 changed files with 18 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
pfUI:RegisterModule("pixelperfect", function ()
if pfUI_config.global.pixelperfect == "1" then
local resolution = GetCVar("gxResolution")
for screenwidth, screenheight in string.gfind(resolution, "(.+)x(.+)") do
local scale = (min(2, max(.64, 768/screenheight)))
SetCVar("UseUIScale", 1)
SetCVar("UIScale", scale)
-- scale UIParent to native screensize
UIParent:SetWidth(screenwidth)
UIParent:SetHeight(screenheight)
UIParent:SetPoint("CENTER",0,0)
end
end
end)