本文整理汇总了C++中IPlayerProfile::CreateAttributeEnumerator方法的典型用法代码示例。如果您正苦于以下问题:C++ IPlayerProfile::CreateAttributeEnumerator方法的具体用法?C++ IPlayerProfile::CreateAttributeEnumerator怎么用?C++ IPlayerProfile::CreateAttributeEnumerator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPlayerProfile
的用法示例。
在下文中一共展示了IPlayerProfile::CreateAttributeEnumerator方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitProfileOptions
void COptionsManager::InitProfileOptions(bool switchProfiles)
{
if(!m_pPlayerProfileManager)
return;
if(g_pGameCVars->g_useProfile==0) return;
if(g_pGameCVars->g_startFirstTime==1)
{
ICVar *pCVar = gEnv->pConsole->GetCVar("g_startFirstTime");
if(pCVar && pCVar->GetIVal()==1)
{
pCVar->Set(0);
m_firstStart = true;
}
switchProfiles=true;
}
const char* user = m_pPlayerProfileManager->GetCurrentUser();
IPlayerProfile *pProfile = m_pPlayerProfileManager->GetCurrentProfile(user);
if(!pProfile)
return;
IAttributeEnumeratorPtr attribEnum = pProfile->CreateAttributeEnumerator();
IAttributeEnumerator::SAttributeDescription attrib;
m_profileOptions.clear();
while(attribEnum->Next(attrib))
{
bool bWriteToCfg = false;
const char* attribCVar = "";
const bool bIsOption = IsOption(attrib.name, attribCVar, bWriteToCfg);
if (bIsOption)
{
SOptionEntry entry (attrib.name, bWriteToCfg);
m_profileOptions[attribCVar] = entry;
if(!bWriteToCfg || switchProfiles)
{
string value;
if(!strcmp(attribCVar, "pb_client"))
{
GetProfileValue(attrib.name, value);
if(atoi(value)==0)
{
m_pbEnabled = false;
gEnv->pConsole->ExecuteString("net_pb_cl_enable false");
}
else
{
m_pbEnabled = true;
gEnv->pConsole->ExecuteString("net_pb_cl_enable true");
}
continue;
}
else if(!strcmp(attribCVar, "fsaa_mode"))
{
GetProfileValue(attrib.name, value);
SetAntiAliasingMode(value.c_str());
}
else if(!strcmp(attribCVar, "g_difficultyLevel"))
{
GetProfileValue(attrib.name, value);
SetDifficulty(value);
}
ICVar *pCVar = gEnv->pConsole->GetCVar(attribCVar);
if(pCVar && GetProfileValue(attrib.name, value))
{
if(stricmp(pCVar->GetString(), value.c_str()))
{
//CryLogAlways("Inited, loaded and changed: %s = %s (was %s)", attrib.name, value, pCVar->GetString());
pCVar->Set(value.c_str());
}
else
{
//CryLogAlways("Inited, loaded, but not changed: %s = %s", attrib.name, value);
}
if(!stricmp(attrib.name,"Option.hud_colorLine"))
{
SetCrysisProfileColor(value.c_str());
}
}
}
}
}
WriteGameCfg();
}