Code: Select all
AddOptionMenu "OptionsMenu"
{
Submenu "CRT Shader", "CRT Options"
}
OptionValue "Smoothing"
{
0, "Squared"
1, "Cubed"
}
OptionValue "CurveOptions"
{
0, "Off"
1, "On"
2, "Visor"
}
OptionMenu "CRT Options"
{
StaticText "CRT Stuff"
Option "Screen Curve", "gl_retro_crt_enablecurve", "CurveOPtions"
Slider "Curve Amount X", "gl_retro_crt_curveamntx", 0, 6, 0.01, 2
Slider "Curve Amount Y", "gl_retro_crt_curveamnty", 0, 6, 0.01, 2
Option "Smoothing", "gl_retro_crt_cubed", "Smoothing"
Option "Scan Lines", "gl_retro_crt_enablescanlines", YesNo
Slider "Scan Line Multiplier", "gl_retro_crt_scanlinemult", 100, 10000, 0.1, 1
}
Code: Select all
version "2.5"
class CrtHandler : EventHandler
{
override void UiTick()
{
PlayerInfo p = players[consoleplayer];
if (Cvar.GetCVar("gl_retro", p).GetInt() > 0 && Cvar.GetCVar("gl_retro_crt_enablescanlines", p).GetInt() + Cvar.GetCVar("gl_retro_crt_enablecurve", p).GetInt() > 0)
{
if (Cvar.GetCVar("gl_retro_crt_enablecurve", p).GetInt() == 2)
{
Shader.SetEnabled(p, "CrtShader", false);
Shader.SetUniform1f(p, "CrtShaderVisor", "EnableScanLines", Cvar.GetCVar("gl_retro_crt_enablescanlines", p).GetInt());
Shader.SetUniform1f(p, "CrtShaderVisor", "ScanLineMult", Cvar.GetCVar("gl_retro_crt_scanlinemult", p).GetFloat());
Shader.SetUniform1f(p, "CrtShaderVisor", "EnableCurve", Cvar.GetCVar("gl_retro_crt_enablecurve", p).GetInt());
Shader.SetUniform1f(p, "CrtShaderVisor", "CrtCurveAmntX", 0.0 - Cvar.GetCVar("gl_retro_crt_curveamntx", p).GetFloat());
Shader.SetUniform1f(p, "CrtShaderVisor", "CrtCurveAmntY", 0.0 - Cvar.GetCVar("gl_retro_crt_curveamnty", p).GetFloat());
Shader.SetUniform1f(p, "CrtShaderVisor", "Cubed", Cvar.GetCVar("gl_retro_crt_cubed", p).GetInt());
Shader.SetEnabled(p, "CrtShaderVisor", true);
}
else
{
Shader.SetEnabled(p, "CrtShaderVisor", false);
Shader.SetUniform1f(p, "CrtShader", "EnableScanLines", Cvar.GetCVar("gl_retro_crt_enablescanlines", p).GetInt());
Shader.SetUniform1f(p, "CrtShader", "ScanLineMult", Cvar.GetCVar("gl_retro_crt_scanlinemult", p).GetFloat());
Shader.SetUniform1f(p, "CrtShader", "EnableCurve", Cvar.GetCVar("gl_retro_crt_enablecurve", p).GetInt());
Shader.SetUniform1f(p, "CrtShader", "CrtCurveAmntX", Cvar.GetCVar("gl_retro_crt_curveamntx", p).GetFloat());
Shader.SetUniform1f(p, "CrtShader", "CrtCurveAmntY", Cvar.GetCVar("gl_retro_crt_curveamnty", p).GetFloat());
Shader.SetUniform1f(p, "CrtShader", "Cubed", Cvar.GetCVar("gl_retro_crt_cubed", p).GetInt());
Shader.SetEnabled(p, "CrtShader", true);
}
}
else
{
Shader.SetEnabled(p, "CrtShader", false);
Shader.SetEnabled(p, "CrtShaderVisor", false);
}
}
}