mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 14:51:51 +00:00
- Renamed CVAR_NOSEND to CVAR_IGNORE to better reflect its intent.
- Separated CVAR_MODARCHIVE into CVAR_MOD|CVAR_ARCHIVE so that mod-defined cvars can still be identified when they aren't meant to be archived. SVN r4281 (trunk)
This commit is contained in:
parent
787b84ef91
commit
4fa198244c
6 changed files with 21 additions and 25 deletions
|
@ -135,7 +135,7 @@ FBaseCVar::~FBaseCVar ()
|
|||
void FBaseCVar::ForceSet (UCVarValue value, ECVarType type)
|
||||
{
|
||||
DoSet (value, type);
|
||||
if ((Flags & CVAR_USERINFO) && !(Flags & CVAR_NOSEND))
|
||||
if ((Flags & CVAR_USERINFO) && !(Flags & CVAR_IGNORE))
|
||||
D_UserInfoChanged (this);
|
||||
if (m_UseCallback)
|
||||
Callback ();
|
||||
|
@ -1275,7 +1275,7 @@ void FilterCompactCVars (TArray<FBaseCVar *> &cvars, DWORD filter)
|
|||
// Accumulate all cvars that match the filter flags.
|
||||
for (FBaseCVar *cvar = CVars; cvar != NULL; cvar = cvar->m_Next)
|
||||
{
|
||||
if ((cvar->Flags & filter) && !(cvar->Flags & CVAR_NOSEND))
|
||||
if ((cvar->Flags & filter) && !(cvar->Flags & CVAR_IGNORE))
|
||||
cvars.Push(cvar);
|
||||
}
|
||||
// Now sort them, so they're in a deterministic order and not whatever
|
||||
|
@ -1314,7 +1314,7 @@ FString C_GetMassCVarString (DWORD filter, bool compact)
|
|||
{
|
||||
for (cvar = CVars; cvar != NULL; cvar = cvar->m_Next)
|
||||
{
|
||||
if ((cvar->Flags & filter) && !(cvar->Flags & (CVAR_NOSAVE|CVAR_NOSEND)))
|
||||
if ((cvar->Flags & filter) && !(cvar->Flags & (CVAR_NOSAVE|CVAR_IGNORE)))
|
||||
{
|
||||
UCVarValue val = cvar->GetGenericRep(CVAR_String);
|
||||
dump << '\\' << cvar->GetName() << '\\' << val.String;
|
||||
|
@ -1539,7 +1539,7 @@ void C_ArchiveCVars (FConfigFile *f, uint32 filter)
|
|||
while (cvar)
|
||||
{
|
||||
if ((cvar->Flags &
|
||||
(CVAR_GLOBALCONFIG|CVAR_ARCHIVE|CVAR_MODARCHIVE|CVAR_AUTO|CVAR_USERINFO|CVAR_SERVERINFO|CVAR_NOSAVE))
|
||||
(CVAR_GLOBALCONFIG|CVAR_ARCHIVE|CVAR_MOD|CVAR_AUTO|CVAR_USERINFO|CVAR_SERVERINFO|CVAR_NOSAVE))
|
||||
== filter)
|
||||
{
|
||||
UCVarValue val;
|
||||
|
@ -1670,16 +1670,16 @@ void FBaseCVar::ListVars (const char *filter, bool plain)
|
|||
else
|
||||
{
|
||||
++count;
|
||||
Printf ("%c%c%c%c %s = %s\n",
|
||||
flags & CVAR_ARCHIVE ? 'A' :
|
||||
flags & CVAR_MODARCHIVE ? 'M' : ' ',
|
||||
Printf ("%c%c%c%c%c %s = %s\n",
|
||||
flags & CVAR_ARCHIVE ? 'A' : ' ',
|
||||
flags & CVAR_USERINFO ? 'U' :
|
||||
flags & CVAR_SERVERINFO ? 'S' :
|
||||
flags & CVAR_AUTO ? 'C' : ' ',
|
||||
flags & CVAR_NOSET ? '-' :
|
||||
flags & CVAR_LATCH ? 'L' :
|
||||
flags & CVAR_UNSETTABLE ? '*' : ' ',
|
||||
flags & CVAR_NOSEND ? 'X' : ' ',
|
||||
flags & CVAR_MOD ? 'M' : ' ',
|
||||
flags & CVAR_IGNORE ? 'X' : ' ',
|
||||
var->GetName(),
|
||||
var->GetGenericRep (CVAR_String).String);
|
||||
}
|
||||
|
|
|
@ -61,8 +61,8 @@ enum
|
|||
CVAR_GLOBALCONFIG = 1024, // cvar is saved to global config section
|
||||
CVAR_VIDEOCONFIG = 2048, // cvar is saved to video config section (not implemented)
|
||||
CVAR_NOSAVE = 4096, // when used with CVAR_SERVERINFO, do not save var to savegame
|
||||
CVAR_MODARCHIVE = 8192, // cvar will be saved to a mod-specific section of the ini
|
||||
CVAR_NOSEND = 16384,// do not send cvar across the network (dummy mod cvar)
|
||||
CVAR_MOD = 8192, // cvar was defined by a mod
|
||||
CVAR_IGNORE = 16384,// do not send cvar across the network/inaccesible from ACS (dummy mod cvar)
|
||||
};
|
||||
|
||||
union UCVarValue
|
||||
|
|
|
@ -1379,7 +1379,7 @@ void ParseCVarInfo()
|
|||
FString cvarname;
|
||||
char *cvardefault = NULL;
|
||||
ECVarType cvartype = CVAR_Dummy;
|
||||
int cvarflags = CVAR_MODARCHIVE;
|
||||
int cvarflags = CVAR_MOD|CVAR_ARCHIVE;
|
||||
FBaseCVar *cvar;
|
||||
|
||||
// Check for flag tokens.
|
||||
|
@ -1395,7 +1395,7 @@ void ParseCVarInfo()
|
|||
}
|
||||
else if (stricmp(sc.String, "noarchive") == 0)
|
||||
{
|
||||
cvarflags &= ~CVAR_MODARCHIVE;
|
||||
cvarflags &= ~CVAR_ARCHIVE;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -378,7 +378,7 @@ void D_SetupUserInfo ()
|
|||
|
||||
for (FBaseCVar *cvar = CVars; cvar != NULL; cvar = cvar->GetNext())
|
||||
{
|
||||
if ((cvar->GetFlags() & (CVAR_USERINFO|CVAR_NOSEND)) == CVAR_USERINFO)
|
||||
if ((cvar->GetFlags() & (CVAR_USERINFO|CVAR_IGNORE)) == CVAR_USERINFO)
|
||||
{
|
||||
FBaseCVar **newcvar;
|
||||
FName cvarname(cvar->GetName());
|
||||
|
@ -416,7 +416,7 @@ void userinfo_t::Reset()
|
|||
// Create userinfo vars for this player, initialized to their defaults.
|
||||
for (FBaseCVar *cvar = CVars; cvar != NULL; cvar = cvar->GetNext())
|
||||
{
|
||||
if ((cvar->GetFlags() & (CVAR_USERINFO|CVAR_NOSEND)) == CVAR_USERINFO)
|
||||
if ((cvar->GetFlags() & (CVAR_USERINFO|CVAR_IGNORE)) == CVAR_USERINFO)
|
||||
{
|
||||
ECVarType type;
|
||||
FName cvarname(cvar->GetName());
|
||||
|
|
|
@ -453,12 +453,12 @@ void FGameConfigFile::DoModSetup(const char *gamename)
|
|||
mysnprintf(section, countof(section), "%s.Player.Mod", gamename);
|
||||
if (SetSection(section))
|
||||
{
|
||||
ReadCVars(CVAR_MODARCHIVE|CVAR_USERINFO|CVAR_NOSEND);
|
||||
ReadCVars(CVAR_MOD|CVAR_USERINFO|CVAR_IGNORE);
|
||||
}
|
||||
mysnprintf(section, countof(section), "%s.LocalServerInfo.Mod", gamename);
|
||||
if (SetSection (section))
|
||||
{
|
||||
ReadCVars (CVAR_MODARCHIVE|CVAR_SERVERINFO|CVAR_NOSEND);
|
||||
ReadCVars (CVAR_MOD|CVAR_SERVERINFO|CVAR_IGNORE);
|
||||
}
|
||||
// Signal that these sections should be rewritten when saving the config.
|
||||
bModSetup = true;
|
||||
|
@ -476,7 +476,7 @@ void FGameConfigFile::ReadNetVars ()
|
|||
mysnprintf(subsection, sublen, "NetServerInfo.Mod");
|
||||
if (SetSection(section))
|
||||
{
|
||||
ReadCVars(CVAR_MODARCHIVE|CVAR_SERVERINFO|CVAR_NOSEND);
|
||||
ReadCVars(CVAR_MOD|CVAR_SERVERINFO|CVAR_IGNORE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -489,11 +489,7 @@ void FGameConfigFile::ReadCVars (DWORD flags)
|
|||
FBaseCVar *cvar;
|
||||
UCVarValue val;
|
||||
|
||||
if (!(flags & CVAR_MODARCHIVE))
|
||||
{
|
||||
flags |= CVAR_ARCHIVE|CVAR_UNSETTABLE;
|
||||
}
|
||||
flags |= CVAR_AUTO;
|
||||
flags |= CVAR_ARCHIVE|CVAR_UNSETTABLE|CVAR_AUTO;
|
||||
while (NextInSection (key, value))
|
||||
{
|
||||
cvar = FindCVar (key, NULL);
|
||||
|
@ -523,7 +519,7 @@ void FGameConfigFile::ArchiveGameData (const char *gamename)
|
|||
strncpy (subsection + 6, ".Mod", sublen - 6);
|
||||
SetSection (section, true);
|
||||
ClearCurrentSection ();
|
||||
C_ArchiveCVars (this, CVAR_MODARCHIVE|CVAR_AUTO|CVAR_USERINFO);
|
||||
C_ArchiveCVars (this, CVAR_MOD|CVAR_ARCHIVE|CVAR_AUTO|CVAR_USERINFO);
|
||||
}
|
||||
|
||||
strncpy (subsection, "ConsoleVariables", sublen);
|
||||
|
@ -545,7 +541,7 @@ void FGameConfigFile::ArchiveGameData (const char *gamename)
|
|||
strncpy (subsection, netgame ? "NetServerInfo.Mod" : "LocalServerInfo.Mod", sublen);
|
||||
SetSection (section, true);
|
||||
ClearCurrentSection ();
|
||||
C_ArchiveCVars (this, CVAR_MODARCHIVE|CVAR_AUTO|CVAR_SERVERINFO);
|
||||
C_ArchiveCVars (this, CVAR_MOD|CVAR_ARCHIVE|CVAR_AUTO|CVAR_SERVERINFO);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6886,7 +6886,7 @@ scriptwait:
|
|||
{
|
||||
FBaseCVar *cvar = FindCVar (FBehavior::StaticLookupString (STACK(1)), NULL);
|
||||
// Either the cvar doesn't exist, or it's for a mod that isn't loaded, so return 0.
|
||||
if (cvar == NULL || (cvar->GetFlags() & CVAR_NOSEND))
|
||||
if (cvar == NULL || (cvar->GetFlags() & CVAR_IGNORE))
|
||||
{
|
||||
STACK(1) = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue