From 3723f6d0b1b921c44d167c68808f0a38ff0742d9 Mon Sep 17 00:00:00 2001 From: praxis <889+praxis@noreply.octowow.st> Date: Sun, 13 Sep 2026 09:51:46 +0000 Subject: [PATCH] Add modules/hdgraphic.lua --- modules/hdgraphic.lua | 46 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 modules/hdgraphic.lua diff --git a/modules/hdgraphic.lua b/modules/hdgraphic.lua new file mode 100644 index 0000000..9147513 --- /dev/null +++ b/modules/hdgraphic.lua @@ -0,0 +1,46 @@ +pfUI:RegisterModule("hdgraphic", "vanilla", function () + -- inject video settings to provide advanced slider values (deferred until frame is shown) + local origOptionsFrame_OnShow = OptionsFrame_OnShow + function OptionsFrame_OnShow() + if origOptionsFrame_OnShow then origOptionsFrame_OnShow() end + if _G.OptionsFrameSliders and _G.OptionsFrameSliders[3] then + _G.OptionsFrameSliders[3].maxValue = 15 + end + end + local HookSetWorldDetail = SetWorldDetail + function _G.SetWorldDetail(arg) + HookSetWorldDetail((arg > 2 and 2 or arg)) + + if arg > 2 then + ConsoleExec("frillDensity " .. (arg+1)*16) + ConsoleExec("lodDist " .. 100+arg*10) + ConsoleExec("nearClip " .. arg*2/100) + ConsoleExec("maxLOD " .. arg) + ConsoleExec("footstepBias " .. arg/15) + ConsoleExec("DistCull " .. 500+arg*25.92) + + -- static triggers + ConsoleExec("SkyCloudLOD 1") + ConsoleExec("mapObjLightLOD 2") + ConsoleExec("texLodBias -1") + else + -- defaults + ConsoleExec("frillDensity 24") + ConsoleExec("lodDist 100") + ConsoleExec("nearClip 0.1") + ConsoleExec("maxLOD 0") + ConsoleExec("footstepBias 0.125") + ConsoleExec("DistCull 500") + + ConsoleExec("SkyCloudLOD 0") + ConsoleExec("mapObjLightLOD 0") + ConsoleExec("texLodBias 0") + end + end + + local HookGetWorldDetail = GetWorldDetail + function _G.GetWorldDetail(arg) + local frill = tonumber(GetCVar("frillDensity")) + return frill > 48 and frill/16-1 or HookGetWorldDetail() + end +end) \ No newline at end of file