本文整理汇总了C++中IPlayerProfile::SetAttribute方法的典型用法代码示例。如果您正苦于以下问题:C++ IPlayerProfile::SetAttribute方法的具体用法?C++ IPlayerProfile::SetAttribute怎么用?C++ IPlayerProfile::SetAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPlayerProfile
的用法示例。
在下文中一共展示了IPlayerProfile::SetAttribute方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SaveCVarToProfile
void COptionsManager::SaveCVarToProfile(const char* key, const string& value)
{
if(!m_pPlayerProfileManager)
return;
IPlayerProfile *pProfile = m_pPlayerProfileManager->GetCurrentProfile(m_pPlayerProfileManager->GetCurrentUser());
if(!pProfile)
return;
pProfile->SetAttribute(key, value);
IPlayerProfileManager::EProfileOperationResult result;
m_pPlayerProfileManager->SaveProfile(m_pPlayerProfileManager->GetCurrentUser(), result);
}
示例2: SaveValueToProfile
void COptionsManager::SaveValueToProfile(const char* key, float value)
{
if(!m_pPlayerProfileManager)
return;
IPlayerProfile *pProfile = m_pPlayerProfileManager->GetCurrentProfile(m_pPlayerProfileManager->GetCurrentUser());
if(!pProfile)
return;
pProfile->SetAttribute(key, value);
SaveProfile();
}
示例3: ProcessEvent
virtual void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
{
switch(event)
{
case eFE_Activate:
{
if (IsPortActive(pActInfo, eIP_Get))
{
IPlayerProfile* pProfile = NULL;
if (IPlayerProfileManager *pProfileMan = gEnv->pGame->GetIGameFramework()->GetIPlayerProfileManager())
{
const char* user = pProfileMan->GetCurrentUser();
pProfile = pProfileMan->GetCurrentProfile(user);
TFlowInputData data;
if (!pProfile || pProfile->GetAttribute(GetPortString(pActInfo, eIP_Name), data))
{
ActivateOutput(pActInfo, eOP_Value, data);
}
else
{
ActivateOutput(pActInfo, eOP_Error, 1);
}
}
}
if (IsPortActive(pActInfo, eIP_Set))
{
IPlayerProfile* pProfile = NULL;
if (IPlayerProfileManager *pProfileMan = gEnv->pGame->GetIGameFramework()->GetIPlayerProfileManager())
{
const char *user = pProfileMan->GetCurrentUser();
pProfile = pProfileMan->GetCurrentProfile( user );
if(!pProfile || !pProfile->SetAttribute(GetPortString(pActInfo, eIP_Name), GetPortAny(pActInfo, eIP_Set)))
{
ActivateOutput(pActInfo, eOP_Error, 1);
}
}
}
}
break;
}
}
示例4: StartSingleplayerGame
void CFlashMenuObject::StartSingleplayerGame(const char *strDifficulty)
{
int iDifficulty = 0;
if(!strcmp(strDifficulty,"Easy"))
{
iDifficulty = 1;
}
else if(!strcmp(strDifficulty,"Normal"))
{
iDifficulty = 2;
}
else if(!strcmp(strDifficulty,"Realistic"))
{
iDifficulty = 3;
}
else if(!strcmp(strDifficulty,"Delta"))
{
iDifficulty = 4;
}
// load configuration from disk
if (iDifficulty != 0)
LoadDifficultyConfig(iDifficulty);
if(m_pPlayerProfileManager)
{
IPlayerProfile *pProfile = m_pPlayerProfileManager->GetCurrentProfile(m_pPlayerProfileManager->GetCurrentUser());
if(pProfile)
{
pProfile->SetAttribute("Singleplayer.LastSelectedDifficulty",(TFlowInputData)iDifficulty);
IPlayerProfileManager::EProfileOperationResult result;
m_pPlayerProfileManager->SaveProfile(m_pPlayerProfileManager->GetCurrentUser(), result);
}
}
StopVideo();
m_bDestroyStartMenuPending = true;
m_stateEntryMovies = eEMS_GameStart;
if(m_pMusicSystem)
m_pMusicSystem->EndTheme(EThemeFade_StopAtOnce, 0, true);
PlaySound(ESound_MenuAmbience,false);
}