From 7a4c29fe106c413263e5b988ad541fd8dc29e98a Mon Sep 17 00:00:00 2001 From: shagu Date: Sun, 12 Aug 2018 11:41:29 +0200 Subject: [PATCH] hdgraphic: remove maximum graphic detail option --- api/config.lua | 1 - modules/gui.lua | 3 +- modules/hdgraphic.lua | 118 --------------------------------------- modules/pixelperfect.lua | 45 +++++++++++++++ pfUI.toc | 2 +- 5 files changed, 47 insertions(+), 122 deletions(-) delete mode 100644 modules/hdgraphic.lua create mode 100644 modules/pixelperfect.lua diff --git a/api/config.lua b/api/config.lua index 1bc7d9e4..80e94083 100644 --- a/api/config.lua +++ b/api/config.lua @@ -30,7 +30,6 @@ 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") diff --git a/modules/gui.lua b/modules/gui.lua index 153f6cab..374ce5f5 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -584,8 +584,7 @@ pfUI:RegisterModule("gui", function () CreateConfig(nil, this, T["Unit Frame Text Font"], C.global, "font_unit", "dropdown", pfUI.gui.dropdowns.fonts) CreateConfig(nil, this, T["Unit Frame Text Size"], C.global, "font_unit_size") CreateConfig(nil, this, T["Scrolling Combat Text Font"], C.global, "font_combat", "dropdown", pfUI.gui.dropdowns.fonts) - CreateConfig(update["hdgraphic"], this, T["Enable UI-Scale"], C.global, "pixelperfect", "dropdown", pfUI.gui.dropdowns.scaling) - CreateConfig(update["hdgraphic"], this, T["Enable Maximum Graphic Details"], C.global, "hdgraphic", "checkbox") + CreateConfig(update["pixelperfect"], this, T["Enable UI-Scale"], C.global, "pixelperfect", "dropdown", pfUI.gui.dropdowns.scaling) CreateConfig(nil, this, T["Enable Offscreen Frame Positions"], C.global, "offscreen", "checkbox") CreateConfig(nil, this, T["Enable Single Line UIErrors"], C.global, "errors_limit", "checkbox") CreateConfig(nil, this, T["Disable All UIErrors"], C.global, "errors_hide", "checkbox") diff --git a/modules/hdgraphic.lua b/modules/hdgraphic.lua deleted file mode 100644 index 96a6a8c7..00000000 --- a/modules/hdgraphic.lua +++ /dev/null @@ -1,118 +0,0 @@ -pfUI:RegisterModule("hdgraphic", function () - -- pixel perfect - local function pixelperfect() - local conf = tonumber(C.global.pixelperfect) - if conf < 4 then - -- restore gamesettings - local scale = GetCVar("uiScale") - local use = GetCVar("useUiScale") - - if use == 1 then - UIParent:SetScale(tonumber(use)) - else - UIParent:SetScale(.9) - end - else - -- apply pixel dependent scaling - local resolution = GetCVar("gxResolution") - - for screenwidth, screenheight in string.gfind(resolution, "(.+)x(.+)") do - local screenheight = tonumber(screenheight) / 8 - local scale = 768 / ( screenheight * conf ) - - SetCVar("uiScale", scale) - SetCVar("useUiScale", 1) - - UIParent:SetScale(scale) - end - end - end - - -- best graphic - local function bestgraphic() - if C.global.hdgraphic == "1" then - ConsoleExec("anisotropic 16") - ConsoleExec("detailDoodadAlpha 100") - ConsoleExec("farclip 777") - ConsoleExec("frillDensity 256") - ConsoleExec("gxColorBits 24") - ConsoleExec("gxDepthBits 24") - ConsoleExec("gxMultisample 8") - ConsoleExec("gxMultisampleQuality 1.000000") - ConsoleExec("fullAlpha 1") - ConsoleExec("lod 0") - ConsoleExec("M2Faster 3") - ConsoleExec("Gamma 0.8") - ConsoleExec("lodDist 250") - ConsoleExec("mapObjLightLOD 2") - ConsoleExec("maxLOD 3") - ConsoleExec("nearClip 0.33") - ConsoleExec("particleDensity 1") - ConsoleExec("pixelShaders 1") - ConsoleExec("shadowLevel 0") - ConsoleExec("SmallCull 0.01") - ConsoleExec("trilinear 1") - ConsoleExec("SkyCloudLOD 1") - ConsoleExec("SkySunGlare 1") - ConsoleExec("specular 1") - ConsoleExec("textureLodDist 777") - ConsoleExec("texLodBias -1") - ConsoleExec("trilinear 1") - ConsoleExec("unitDrawDist 300") - ConsoleExec("weatherDensity 3") - ConsoleExec("waterParticulates 1") - ConsoleExec("waterRipples 1") - ConsoleExec("waterSpecular 1") - ConsoleExec("waterWaves 1") - ConsoleExec("ffxDeath 1") - ConsoleExec("ffx 1") - ConsoleExec("ffxRectangle 1") - ConsoleExec("ffxGlow 1") - ConsoleExec("spellEffectLevel 2") - ConsoleExec("occlusion 1") - ConsoleExec("footstepBias 0.125") - ConsoleExec("showfootprints 1") - ConsoleExec("horizonfarclip 2112") - ConsoleExec("baseMip 0") - ConsoleExec("waterLOD 0") - ConsoleExec("mapObjOverbright 1") - ConsoleExec("MaxLights 4") - ConsoleExec("DistCull 888") - ConsoleExec("mapShadows 1") - ConsoleExec("doodadAnim 1") - ConsoleExec("showShadow 1") - ConsoleExec("showLowDetail 0") - ConsoleExec("showSimpleDoodads 0") - ConsoleExec("gxTripleBuffer 1") - ConsoleExec("M2UsePixelShaders 1") - ConsoleExec("M2UseZFill 1") - ConsoleExec("M2UseClipPlanes 1") - ConsoleExec("M2UseThreads 1") - ConsoleExec("M2UseShaders 1") - ConsoleExec("M2BatchDoodads 1") - ConsoleExec("bspcache 1") - local cur, max = GetCurrentResolution(), table.getn({GetScreenResolutions()}) - if cur ~= max then - SetScreenResolution(max) - ConsoleExec("gxrestart") - ReloadUI() - end - end - end - - -- pixelperfect: native UIScale listener - if tonumber(C.global.pixelperfect) > 0 then - local f = CreateFrame("Frame") - f:RegisterEvent("PLAYER_ENTERING_WORLD") - f:SetScript("OnEvent", pixelperfect) - pixelperfect() - end - - pfUI.hdgraphic = {} - function pfUI.hdgraphic:UpdateConfig() - bestgraphic() - pixelperfect() - end - - pfUI.hdgraphic:UpdateConfig() -end) diff --git a/modules/pixelperfect.lua b/modules/pixelperfect.lua new file mode 100644 index 00000000..44e4483f --- /dev/null +++ b/modules/pixelperfect.lua @@ -0,0 +1,45 @@ +pfUI:RegisterModule("pixelperfect", function () + -- pixel perfect + local function pixelperfect() + local conf = tonumber(C.global.pixelperfect) + if conf < 4 then + -- restore gamesettings + local scale = GetCVar("uiScale") + local use = GetCVar("useUiScale") + + if use == 1 then + UIParent:SetScale(tonumber(use)) + else + UIParent:SetScale(.9) + end + else + -- apply pixel dependent scaling + local resolution = GetCVar("gxResolution") + + for screenwidth, screenheight in string.gfind(resolution, "(.+)x(.+)") do + local screenheight = tonumber(screenheight) / 8 + local scale = 768 / ( screenheight * conf ) + + SetCVar("uiScale", scale) + SetCVar("useUiScale", 1) + + UIParent:SetScale(scale) + end + end + end + + -- pixelperfect: native UIScale listener + if tonumber(C.global.pixelperfect) > 0 then + local f = CreateFrame("Frame") + f:RegisterEvent("PLAYER_ENTERING_WORLD") + f:SetScript("OnEvent", pixelperfect) + pixelperfect() + end + + pfUI.pixelperfect = {} + function pfUI.pixelperfect:UpdateConfig() + pixelperfect() + end + + pfUI.pixelperfect:UpdateConfig() +end) diff --git a/pfUI.toc b/pfUI.toc index 529a3ae2..a8bd946c 100644 --- a/pfUI.toc +++ b/pfUI.toc @@ -95,7 +95,7 @@ modules\gm.lua modules\mirrortimers.lua modules\socialmod.lua modules\feigndeath.lua -modules\hdgraphic.lua +modules\pixelperfect.lua modules\share.lua modules\tracking.lua modules\easteregg.lua