hdgraphic: run on boot and merge pixelperfect

This commit is contained in:
shagu
2017-12-17 18:17:28 +01:00
parent 3d9b4c17e4
commit 4613513453
5 changed files with 25 additions and 22 deletions
-15
View File
@@ -1,15 +0,0 @@
pfUI:RegisterModule("pixelperfect", function ()
if C.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)