From 63120568e631caabd7ecce52fe1d070d03a6a802 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 25 Apr 2005 00:32:08 +0000 Subject: [PATCH] Edits are part of the profile, so it's the profile's responsibility to load and unload them. (allows implementing fallback edit loading) --- stepmania/src/GameState.cpp | 4 ---- stepmania/src/ProfileManager.cpp | 11 +++++++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index 626964ca57..60cd488d00 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -289,8 +289,6 @@ void GameState::PlayersFinalized() PROFILEMAN->LoadFirstAvailableProfile( pn ); // load full profile - SONGMAN->LoadAllFromProfile( (ProfileSlot) pn ); - MEMCARDMAN->UnmountCard( pn ); if( !PROFILEMAN->IsUsingProfile(pn) ) @@ -321,8 +319,6 @@ void GameState::PlayersFinalized() m_pPreferredCourse = pProfile->m_lastCourse.ToCourse(); } - SONGMAN->LoadAllFromProfile( PROFILE_SLOT_MACHINE ); - FOREACH_PlayerNumber( pn ) { if( !IsHumanPlayer(pn) ) diff --git a/stepmania/src/ProfileManager.cpp b/stepmania/src/ProfileManager.cpp index 857ab6903c..3961f70e2f 100644 --- a/stepmania/src/ProfileManager.cpp +++ b/stepmania/src/ProfileManager.cpp @@ -182,6 +182,15 @@ bool ProfileManager::LoadProfileFromMemoryCard( PlayerNumber pn ) * scores. */ m_sProfileDir[pn] = MEM_CARD_MOUNT_POINT[pn] + PREFSMAN->m_sMemoryCardProfileSubdir + "/"; + /* Load edits from all fallback directories, newest first. */ + for( unsigned i = 0; i < asDirsToTry.size(); ++i ) + { + const CString &sSubdir = asDirsToTry[i]; + CString sDir = MEM_CARD_MOUNT_POINT[pn] + sSubdir + "/"; + + SONGMAN->LoadEditsFromDir( sDir, (ProfileSlot) pn ); + } + return true; // If a card is inserted, we want to use the memory card to save - even if the Profile load failed. } @@ -362,6 +371,8 @@ void ProfileManager::LoadMachineProfile() // If the machine name has changed, make sure we use the new name m_MachineProfile.m_sDisplayName = PREFSMAN->m_sMachineName; + + SONGMAN->LoadEditsFromDir( MACHINE_PROFILE_DIR, PROFILE_SLOT_MACHINE ); } bool ProfileManager::ProfileWasLoadedFromMemoryCard( PlayerNumber pn ) const