本文整理汇总了C++中IPlayerProfile::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ IPlayerProfile::GetName方法的具体用法?C++ IPlayerProfile::GetName怎么用?C++ IPlayerProfile::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPlayerProfile
的用法示例。
在下文中一共展示了IPlayerProfile::GetName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetProfileName
const char* COptionsManager::GetProfileName()
{
if(!m_pPlayerProfileManager)
return "Nomad";
const char* user = m_pPlayerProfileManager->GetCurrentUser();
if(!user)
return "Nomad";
IPlayerProfile* profile = m_pPlayerProfileManager->GetCurrentProfile(user);
if(!profile)
return "Nomad";
if(!stricmp(profile->GetName(),"default"))
return "Nomad";
return profile->GetName();
}
示例2: SelectProfile
void CFlashMenuObject::SelectProfile(const char *profileName, bool silent, bool keepOldSettings)
{
if(m_pPlayerProfileManager)
{
const char *userName = m_pPlayerProfileManager->GetCurrentUser();
IPlayerProfile *oldProfile = m_pPlayerProfileManager->GetCurrentProfile(userName);
if(oldProfile)
SwitchProfiles(oldProfile->GetName(), profileName);
else
SwitchProfiles(NULL, profileName);
g_pGame->GetIGameFramework()->GetILevelSystem()->LoadRotation();
UpdateProfiles();
if(keepOldSettings)
g_pGame->GetOptions()->UpdateToProfile();
g_pGame->GetOptions()->InitProfileOptions(true);
g_pGame->GetOptions()->UpdateFlashOptions();
g_pGame->GetOptions()->WriteGameCfg();
UpdateMenuColor();
if(m_apFlashMenuScreens[MENUSCREEN_FRONTENDSTART])
{
if(!silent)
{
m_apFlashMenuScreens[MENUSCREEN_FRONTENDSTART]->Invoke("Root.MainMenu.Profile.gotoProfileMenu");
ShowMenuMessage("@ui_menu_PROFILELOADED");
}
}
}
}
示例3: UpdateProfiles
void CFlashMenuObject::UpdateProfiles()
{
IPlayerProfileManager *pProfileMan = g_pGame->GetOptions()->GetProfileManager();
if(!pProfileMan)
return;
m_pPlayerProfileManager = pProfileMan;
IPlayerProfileManager::EProfileOperationResult result;
m_pPlayerProfileManager->SaveProfile(m_pPlayerProfileManager->GetCurrentUser(), result);
if(m_apFlashMenuScreens[MENUSCREEN_FRONTENDSTART])
{
m_apFlashMenuScreens[MENUSCREEN_FRONTENDSTART]->Invoke("Root.MainMenu.Profile.resetProfiles");
const char *userName = m_pPlayerProfileManager->GetCurrentUser();
for(int i = 0; i < m_pPlayerProfileManager->GetProfileCount(userName); ++i )
{
IPlayerProfileManager::SProfileDescription profDesc;
pProfileMan->GetProfileInfo(userName, i, profDesc);
const IPlayerProfile *pProfile = m_pPlayerProfileManager->PreviewProfile(userName, profDesc.name);
string buffer;
if(pProfile && pProfile->GetAttribute("Singleplayer.LastSavedGame", buffer))
{
int pos = buffer.rfind('/');
if(pos)
buffer = buffer.substr(pos+1, buffer.length());
}
SFlashVarValue args[3] = {profDesc.name, buffer.c_str(), GetMappedProfileName(profDesc.name) };
m_apFlashMenuScreens[MENUSCREEN_FRONTENDSTART]->Invoke("Root.MainMenu.Profile.addProfileToList", args, 3);
}
m_pPlayerProfileManager->PreviewProfile(userName, NULL);
IPlayerProfile *pProfile = pProfileMan->GetCurrentProfile(userName);
if(pProfile)
m_apFlashMenuScreens[MENUSCREEN_FRONTENDSTART]->Invoke("setActiveProfile", GetMappedProfileName(pProfile->GetName()));
}
}