return ID of the created profile
This commit is contained in:
@@ -322,7 +322,7 @@ Profile &ProfileManager::GetLocalProfile( const CString &sProfileID )
|
||||
return *iter->second;
|
||||
}
|
||||
|
||||
bool ProfileManager::CreateLocalProfile( CString sName )
|
||||
bool ProfileManager::CreateLocalProfile( CString sName, CString &sProfileIDOut )
|
||||
{
|
||||
ASSERT( !sName.empty() );
|
||||
|
||||
@@ -343,6 +343,10 @@ bool ProfileManager::CreateLocalProfile( CString sName )
|
||||
return false;
|
||||
|
||||
bool bResult = Profile::CreateNewProfile( sProfileDir, sName );
|
||||
if( bResult )
|
||||
sProfileIDOut = sProfileID;
|
||||
else
|
||||
sProfileIDOut = "";
|
||||
RefreshLocalProfilesFromDisk();
|
||||
return bResult;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public:
|
||||
void RefreshLocalProfilesFromDisk();
|
||||
Profile &GetLocalProfile( const CString &sProfileID );
|
||||
|
||||
bool CreateLocalProfile( CString sName );
|
||||
bool CreateLocalProfile( CString sName, CString &sProfileIDOut );
|
||||
bool RenameLocalProfile( CString sProfileID, CString sNewName );
|
||||
bool DeleteLocalProfile( CString sProfileID );
|
||||
CString GetNewLocalProfileDefaultName() const;
|
||||
|
||||
@@ -87,7 +87,7 @@ void ScreenSelectProfile::HandleScreenMessage( const ScreenMessage SM )
|
||||
ASSERT( GAMESTATE->m_sLastSelectedProfileID.empty() )
|
||||
|
||||
// create
|
||||
bool bResult = PROFILEMAN->CreateLocalProfile( sNewName );
|
||||
bool bResult = PROFILEMAN->CreateLocalProfile( sNewName, GAMESTATE->m_sLastSelectedProfileID );
|
||||
if( bResult )
|
||||
SCREENMAN->SetNewScreen( NEXT_SCREEN );
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user