- enable cvar blacklisting for defcvars for certain platform variables
This commit is contained in:
parent
42d948f2fe
commit
f56ad02716
2 changed files with 54 additions and 2 deletions
|
|
@ -34,6 +34,8 @@
|
|||
#include "c_console.h"
|
||||
#include "d_main.h"
|
||||
#include "version.h"
|
||||
#include "d_defcvars.h"
|
||||
|
||||
|
||||
void D_GrabCVarDefaults()
|
||||
{
|
||||
|
|
@ -104,9 +106,30 @@ void D_GrabCVarDefaults()
|
|||
break;
|
||||
}
|
||||
|
||||
bool blacklisted = false;
|
||||
SHOULD_BLACKLIST(disablecrashlog)
|
||||
SHOULD_BLACKLIST(gl_control_tear)
|
||||
SHOULD_BLACKLIST(in_mouse)
|
||||
SHOULD_BLACKLIST(joy_dinput)
|
||||
SHOULD_BLACKLIST(joy_ps2raw)
|
||||
SHOULD_BLACKLIST(joy_xinput)
|
||||
SHOULD_BLACKLIST(k_allowfullscreentoggle)
|
||||
SHOULD_BLACKLIST(k_mergekeys)
|
||||
SHOULD_BLACKLIST(m_swapbuttons)
|
||||
SHOULD_BLACKLIST(queryiwad_key)
|
||||
SHOULD_BLACKLIST(vid_gpuswitch)
|
||||
SHOULD_BLACKLIST(vr_enable_quadbuffered)
|
||||
|
||||
var = FindCVar(CurrentFindCVar, NULL);
|
||||
if (var != NULL)
|
||||
|
||||
if (blacklisted)
|
||||
{
|
||||
sc.ScriptMessage("Cannot set cvar default for blacklisted cvar '%s'", sc.String);
|
||||
sc.MustGetString(); // to ignore the value of the cvar
|
||||
}
|
||||
else if (var != NULL)
|
||||
{
|
||||
|
||||
if (var->GetFlags() & CVAR_ARCHIVE)
|
||||
{
|
||||
UCVarValue val;
|
||||
|
|
@ -115,14 +138,16 @@ void D_GrabCVarDefaults()
|
|||
val.String = const_cast<char*>(sc.String);
|
||||
var->SetGenericRepDefault(val, CVAR_String);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
sc.ScriptMessage("Cannot set cvar default for non-config cvar '%s'", sc.String);
|
||||
sc.MustGetString(); // to ignore the value of the cvar
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sc.ScriptMessage("Unknown cvar '%s' in defcvars", sc.String);
|
||||
sc.MustGetString(); // to ignore the value of the cvar
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue