ZScript Custom CVars -- ONLY WORKS FROM THE CONSOLE
This commit is contained in:
parent
8dbe0ae353
commit
c8f3aa3fd1
4 changed files with 382 additions and 1 deletions
|
|
@ -1593,6 +1593,8 @@ void ParseCVarInfo()
|
|||
ECVarType cvartype = CVAR_Dummy;
|
||||
int cvarflags = CVAR_MOD|CVAR_ARCHIVE;
|
||||
FBaseCVar *cvar;
|
||||
bool customCVar = false;
|
||||
FName customCVarClassName;
|
||||
|
||||
// Check for flag tokens.
|
||||
while (sc.TokenType == TK_Identifier)
|
||||
|
|
@ -1621,6 +1623,14 @@ void ParseCVarInfo()
|
|||
{
|
||||
cvarflags |= CVAR_CONFIG_ONLY;
|
||||
}
|
||||
else if (stricmp(sc.String, "handlerClass") == 0)
|
||||
{
|
||||
sc.MustGetStringName("(");
|
||||
sc.MustGetString();
|
||||
customCVar = true;
|
||||
customCVarClassName = sc.String;
|
||||
sc.MustGetStringName(")");
|
||||
}
|
||||
else
|
||||
{
|
||||
sc.ScriptError("Unknown cvar attribute '%s'", sc.String);
|
||||
|
|
@ -1703,7 +1713,7 @@ void ParseCVarInfo()
|
|||
}
|
||||
}
|
||||
// Now create the cvar.
|
||||
cvar = C_CreateCVar(cvarname, cvartype, cvarflags);
|
||||
cvar = customCVar ? C_CreateZSCustomCVar(cvarname, cvartype, cvarflags, customCVarClassName) : C_CreateCVar(cvarname, cvartype, cvarflags);
|
||||
if (cvardefault != NULL)
|
||||
{
|
||||
UCVarValue val;
|
||||
|
|
@ -3261,6 +3271,8 @@ static int D_InitGame(const FIWADInfo* iwad_info, TArray<FString>& allwads, TArr
|
|||
|
||||
R_ParseTrnslate();
|
||||
PClassActor::StaticInit ();
|
||||
FBaseCVar::InitZSCallbacks ();
|
||||
|
||||
Job_Init();
|
||||
|
||||
// [GRB] Initialize player class list
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue