本文整理汇总了C++中FBaseCVar::GetFlags方法的典型用法代码示例。如果您正苦于以下问题:C++ FBaseCVar::GetFlags方法的具体用法?C++ FBaseCVar::GetFlags怎么用?C++ FBaseCVar::GetFlags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FBaseCVar
的用法示例。
在下文中一共展示了FBaseCVar::GetFlags方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Reset
void userinfo_t::Reset()
{
// Clear this player's userinfo.
TMapIterator<FName, FBaseCVar *> it(*this);
TMap<FName, FBaseCVar *>::Pair *pair;
while (it.NextPair(pair))
{
delete pair->Value;
}
Clear();
// 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_IGNORE)) == CVAR_USERINFO)
{
ECVarType type;
FName cvarname(cvar->GetName());
FBaseCVar *newcvar;
// Some cvars have different types for their shadow copies.
switch (cvarname.GetIndex())
{
case NAME_Skin: type = CVAR_Int; break;
case NAME_Gender: type = CVAR_Int; break;
case NAME_PlayerClass: type = CVAR_Int; break;
default: type = cvar->GetRealType(); break;
}
newcvar = C_CreateCVar(NULL, type, cvar->GetFlags() & CVAR_MOD);
newcvar->SetGenericRepDefault(cvar->GetGenericRepDefault(CVAR_String), CVAR_String);
Insert(cvarname, newcvar);
}
}
}
示例2: GetUserCVar
FBaseCVar *GetCVar(AActor *activator, const char *cvarname)
{
FBaseCVar *cvar = FindCVar(cvarname, nullptr);
// Either the cvar doesn't exist, or it's for a mod that isn't loaded, so return nullptr.
if (cvar == nullptr || (cvar->GetFlags() & CVAR_IGNORE))
{
return nullptr;
}
else
{
// For userinfo cvars, redirect to GetUserCVar
if (cvar->GetFlags() & CVAR_USERINFO)
{
if (activator == nullptr || activator->player == nullptr)
{
return nullptr;
}
return GetUserCVar(int(activator->player - players), cvarname);
}
return cvar;
}
}
示例3:
FBaseCVar *GetUserCVar(int playernum, const char *cvarname)
{
if ((unsigned)playernum >= MAXPLAYERS || !playeringame[playernum])
{
return nullptr;
}
FBaseCVar **cvar_p = players[playernum].userinfo.CheckKey(FName(cvarname, true));
FBaseCVar *cvar;
if (cvar_p == nullptr || (cvar = *cvar_p) == nullptr || (cvar->GetFlags() & CVAR_IGNORE))
{
return nullptr;
}
return cvar;
}
示例4: D_SetupUserInfo
void D_SetupUserInfo ()
{
int i;
userinfo_t *coninfo;
// Reset everybody's userinfo to a default state.
for (i = 0; i < MAXPLAYERS; i++)
{
players[i].userinfo.Reset();
}
// Initialize the console player's user info
coninfo = &players[consoleplayer].userinfo;
for (FBaseCVar *cvar = CVars; cvar != NULL; cvar = cvar->GetNext())
{
if ((cvar->GetFlags() & (CVAR_USERINFO|CVAR_IGNORE)) == CVAR_USERINFO)
{
FBaseCVar **newcvar;
FName cvarname(cvar->GetName());
switch (cvarname.GetIndex())
{
// Some cvars don't copy their original value directly.
case NAME_Team:
coninfo->TeamChanged(team);
break;
case NAME_Skin:
coninfo->SkinChanged(skin, players[consoleplayer].CurrentPlayerClass);
break;
case NAME_Gender:
coninfo->GenderChanged(gender);
break;
case NAME_PlayerClass:
coninfo->PlayerClassChanged(playerclass);
break;
// The rest do.
default:
newcvar = coninfo->CheckKey(cvarname);
(*newcvar)->SetGenericRep(cvar->GetGenericRep(CVAR_String), CVAR_String);
break;
}
}
}
R_BuildPlayerTranslation(consoleplayer);
}
示例5: ListVars
void FBaseCVar::ListVars (const char *filter, bool plain)
{
FBaseCVar *var = CVars;
int count = 0;
while (var)
{
if (CheckWildcards (filter, var->GetName()))
{
DWORD flags = var->GetFlags();
UCVarValue val;
val = var->GetGenericRep (CVAR_String);
if (plain)
{ // plain formatting does not include user-defined cvars
if (!(flags & CVAR_UNSETTABLE))
{
++count;
Printf ("%s : %s\n", var->GetName(), var->GetGenericRep(CVAR_String).String);
}
}
else
{
++count;
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_MOD ? 'M' : ' ',
flags & CVAR_IGNORE ? 'X' : ' ',
var->GetName(),
var->GetGenericRep (CVAR_String).String);
}
}
var = var->m_Next;
}
Printf ("%d cvars\n", count);
}