mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-03 04:00:02 +00:00
hdgraphic: run on boot and merge pixelperfect
This commit is contained in:
@@ -25,6 +25,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("global", nil, "language", GetLocale())
|
||||
pfUI:UpdateConfig("global", nil, "profile", "default")
|
||||
pfUI:UpdateConfig("global", nil, "pixelperfect", "0")
|
||||
pfUI:UpdateConfig("global", nil, "hdgraphic", "0")
|
||||
pfUI:UpdateConfig("global", nil, "offscreen", "0")
|
||||
|
||||
pfUI:UpdateConfig("global", nil, "font_default", "Interface\\AddOns\\pfUI\\fonts\\Myriad-Pro.ttf")
|
||||
|
||||
+2
-1
@@ -517,7 +517,8 @@ pfUI:RegisterModule("gui", function ()
|
||||
CreateConfig(this, T["Unit Frame Text Font"], C.global, "font_unit", "dropdown", pfUI.gui.dropdowns.fonts)
|
||||
CreateConfig(this, T["Unit Frame Text Size"], C.global, "font_unit_size")
|
||||
CreateConfig(this, T["Scrolling Combat Text Font"], C.global, "font_combat", "dropdown", pfUI.gui.dropdowns.fonts)
|
||||
CreateConfig(this, T["Enable Pixel Perfect (Native Resolution)"], C.global, "pixelperfect", "checkbox")
|
||||
CreateConfig(this, T["Enable Native UI-Scale"], C.global, "pixelperfect", "checkbox")
|
||||
CreateConfig(this, T["Enable Maximum Graphic Details"], C.global, "hdgraphic", "checkbox")
|
||||
CreateConfig(this, T["Enable Offscreen Frame Positions"], C.global, "offscreen", "checkbox")
|
||||
CreateConfig(this, T["Enable Single Line UIErrors"], C.global, "errors_limit", "checkbox")
|
||||
CreateConfig(this, T["Disable All UIErrors"], C.global, "errors_hide", "checkbox")
|
||||
|
||||
+22
-5
@@ -1,5 +1,25 @@
|
||||
pfUI:RegisterModule("hdgraphic", function ()
|
||||
local function HDGraphicSettings()
|
||||
|
||||
-- pixelperfect: native UIScale
|
||||
if C.global.pixelperfect == "1" then
|
||||
local f = CreateFrame("Frame")
|
||||
f:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||
f:SetScript("OnEvent", function()
|
||||
local resolution = GetCVar("gxResolution")
|
||||
|
||||
for screenwidth, screenheight in string.gfind(resolution, "(.+)x(.+)") do
|
||||
local screenheight = tonumber(screenheight) < 2160 and tonumber(screenheight) or tonumber(screenheight) / 2
|
||||
local scale = 768/screenheight
|
||||
UIParent:SetScale(scale)
|
||||
UIParent:SetWidth(screenwidth)
|
||||
UIParent:SetHeight(screenheight)
|
||||
UIParent:SetPoint("CENTER",0,0)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
-- hdgraphic: use maximum graphic details
|
||||
if C.global.hdgraphic == "1" then
|
||||
ConsoleExec("anisotropic 16")
|
||||
ConsoleExec("detailDoodadAlpha 100")
|
||||
ConsoleExec("farclip 777")
|
||||
@@ -61,14 +81,11 @@ pfUI:RegisterModule("hdgraphic", function ()
|
||||
ConsoleExec("M2UseShaders 1")
|
||||
ConsoleExec("M2BatchDoodads 1")
|
||||
ConsoleExec("bspcache 1")
|
||||
|
||||
ConsoleExec("gxrestart")
|
||||
local cur, max = GetCurrentResolution(), table.getn({GetScreenResolutions()})
|
||||
if cur ~= max then
|
||||
SetScreenResolution(max)
|
||||
ConsoleExec("gxrestart")
|
||||
ReloadUI()
|
||||
end
|
||||
end
|
||||
local txt = T["|cff33ffccBlizzard: \"Graphic Settings\"|r\n\nDo you want me to setup your game to the maximum graphic details?"]
|
||||
pfUI.firstrun:AddStep("hdgraphic", HDGraphicSettings, nil, txt)
|
||||
end)
|
||||
|
||||
@@ -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)
|
||||
Reference in New Issue
Block a user