Edits are part of the profile, so it's the profile's responsibility to load and unload them. (allows implementing fallback edit loading)

This commit is contained in:
Glenn Maynard
2005-04-25 00:32:08 +00:00
parent b37894ca6e
commit 63120568e6
2 changed files with 11 additions and 4 deletions
+11
View File
@@ -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