From b12ea1745861ede9e96e987fd1bd98918fbe1bc1 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 22 Feb 2004 03:44:04 +0000 Subject: [PATCH] fix local profile loading --- stepmania/src/Profile.cpp | 5 +++-- stepmania/src/ProfileManager.cpp | 20 ++++++++++---------- stepmania/src/ProfileManager.h | 2 +- stepmania/src/Screen.cpp | 3 +-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/stepmania/src/Profile.cpp b/stepmania/src/Profile.cpp index f79fe74847..48f867cc72 100644 --- a/stepmania/src/Profile.cpp +++ b/stepmania/src/Profile.cpp @@ -124,8 +124,9 @@ int Profile::GetTotalNumSongsPlayed() CString Profile::GetProfileDisplayNameFromDir( CString sDir ) { - // FIXME! - return ""; + Profile profile; + profile.LoadEditableDataFromDir( sDir ); + return profile.GetDisplayName(); } int Profile::GetSongNumTimesPlayed( const Song* pSong ) const diff --git a/stepmania/src/ProfileManager.cpp b/stepmania/src/ProfileManager.cpp index 9c1903c941..6fbe0ad95a 100644 --- a/stepmania/src/ProfileManager.cpp +++ b/stepmania/src/ProfileManager.cpp @@ -191,16 +191,16 @@ bool ProfileManager::CreateMemoryCardProfile( PlayerNumber pn ) return CreateProfile( sDir, NEW_MEM_CARD_NAME ); } -//bool ProfileManager::LoadFirstAvailableProfile( PlayerNumber pn ) -//{ -// if( LoadProfileFromMemoryCard(pn) ) -// return true; -// -// if( LoadDefaultProfileFromMachine(pn) ) -// return true; -// -// return false; -//} +bool ProfileManager::LoadFirstAvailableProfile( PlayerNumber pn ) +{ + if( LoadProfileFromMemoryCard(pn) ) + return true; + + if( LoadDefaultProfileFromMachine(pn) ) + return true; + + return false; +} bool ProfileManager::SaveProfile( PlayerNumber pn ) const { diff --git a/stepmania/src/ProfileManager.h b/stepmania/src/ProfileManager.h index a195764870..7f46eae895 100644 --- a/stepmania/src/ProfileManager.h +++ b/stepmania/src/ProfileManager.h @@ -33,8 +33,8 @@ public: void GetLocalProfileIDs( vector &asProfileIDsOut ) const; void GetLocalProfileNames( vector &asNamesOut ) const; + bool LoadFirstAvailableProfile( PlayerNumber pn ); // memory card or local profile bool LoadProfileFromMemoryCard( PlayerNumber pn ); -// bool LoadFirstAvailableProfile( PlayerNumber pn ); // memory card or local profile bool SaveProfile( PlayerNumber pn ) const; void UnloadProfile( PlayerNumber pn ); diff --git a/stepmania/src/Screen.cpp b/stepmania/src/Screen.cpp index 49e296520f..e1675e194f 100644 --- a/stepmania/src/Screen.cpp +++ b/stepmania/src/Screen.cpp @@ -195,8 +195,7 @@ bool Screen::JoinInput( const DeviceInput& DeviceI, const InputEventType type, c if( GAMESTATE->m_MasterPlayerNumber == PLAYER_INVALID ) GAMESTATE->m_MasterPlayerNumber = MenuI.player; - for( int p=0; pLoadProfileFromMemoryCard( (PlayerNumber)p ); + PROFILEMAN->LoadFirstAvailableProfile( MenuI.player ); SCREENMAN->RefreshCreditsMessages(); SOUND->PlayOnce( THEME->GetPathToS("Common start") );