diff --git a/stepmania/src/Profile.cpp b/stepmania/src/Profile.cpp index c06bb273eb..9504352eda 100644 --- a/stepmania/src/Profile.cpp +++ b/stepmania/src/Profile.cpp @@ -944,8 +944,10 @@ bool Profile::SaveAllToDir( RString sDir, bool bSignData ) const SaveStatsWebPageToDir( sDir ); // Empty directories if none exist. - FILEMAN->CreateDir( sDir + EDIT_STEPS_SUBDIR ); - FILEMAN->CreateDir( sDir + EDIT_COURSES_SUBDIR ); + if( ProfileManager::m_bProfileStepEdits ) + FILEMAN->CreateDir( sDir + EDIT_STEPS_SUBDIR ); + if( ProfileManager::m_bProfileCourseEdits ) + FILEMAN->CreateDir( sDir + EDIT_COURSES_SUBDIR ); FILEMAN->CreateDir( sDir + SCREENSHOTS_SUBDIR ); FILEMAN->FlushDirCache( sDir ); diff --git a/stepmania/src/ProfileManager.cpp b/stepmania/src/ProfileManager.cpp index d4219bef19..5b32ecc6da 100644 --- a/stepmania/src/ProfileManager.cpp +++ b/stepmania/src/ProfileManager.cpp @@ -33,6 +33,8 @@ static void DefaultLocalProfileIDInit( size_t /*PlayerNumber*/ i, RString &sName defaultValueOut = ""; } +Preference ProfileManager::m_bProfileStepEdits( "ProfileStepEdits", true ); +Preference ProfileManager::m_bProfileCourseEdits( "ProfileCourseEdits", true ); Preference1D ProfileManager::m_sDefaultLocalProfileID( DefaultLocalProfileIDInit, NUM_PLAYERS ); const RString NEW_MEM_CARD_NAME = ""; @@ -260,7 +262,10 @@ bool ProfileManager::LoadProfileFromMemoryCard( PlayerNumber pn, bool bLoadEdits const RString &sSubdir = asDirsToTry[i]; RString sDir = MEM_CARD_MOUNT_POINT[pn] + sSubdir + "/"; - SONGMAN->LoadAllFromProfileDir( sDir, (ProfileSlot) pn ); + if( m_bProfileStepEdits ) + SONGMAN->LoadStepEditsFromProfileDir( sDir, (ProfileSlot) pn ); + if( m_bProfileCourseEdits ) + SONGMAN->LoadCourseEditsFromProfileDir( sDir, (ProfileSlot) pn ); } } @@ -329,7 +334,7 @@ bool ProfileManager::SaveProfile( PlayerNumber pn ) const bool ProfileManager::SaveLocalProfile( RString sProfileID ) { - Profile *pProfile = GetLocalProfile( sProfileID ); + const Profile *pProfile = GetLocalProfile( sProfileID ); ASSERT( pProfile != NULL ); RString sDir = LocalProfileIDToDir( sProfileID ); bool b = pProfile->SaveAllToDir( sDir, PREFSMAN->m_bSignProfileData ); @@ -534,7 +539,8 @@ void ProfileManager::LoadMachineProfile() m_pMachineProfile->m_sDisplayName = PREFSMAN->m_sMachineName; SONGMAN->FreeAllLoadedFromProfile( ProfileSlot_Machine ); - SONGMAN->LoadAllFromProfileDir( MACHINE_PROFILE_DIR, ProfileSlot_Machine ); + SONGMAN->LoadStepEditsFromProfileDir( MACHINE_PROFILE_DIR, ProfileSlot_Machine ); + SONGMAN->LoadCourseEditsFromProfileDir( MACHINE_PROFILE_DIR, ProfileSlot_Machine ); } bool ProfileManager::ProfileWasLoadedFromMemoryCard( PlayerNumber pn ) const diff --git a/stepmania/src/ProfileManager.h b/stepmania/src/ProfileManager.h index bf5b2d3cf8..2680a570c2 100644 --- a/stepmania/src/ProfileManager.h +++ b/stepmania/src/ProfileManager.h @@ -113,6 +113,8 @@ public: // Lua void PushSelf( lua_State *L ); + static Preference m_bProfileStepEdits; + static Preference m_bProfileCourseEdits; static Preference1D m_sDefaultLocalProfileID; private: diff --git a/stepmania/src/ScreenOptionsManageEditSteps.cpp b/stepmania/src/ScreenOptionsManageEditSteps.cpp index 3a04925c92..cac555f4bf 100644 --- a/stepmania/src/ScreenOptionsManageEditSteps.cpp +++ b/stepmania/src/ScreenOptionsManageEditSteps.cpp @@ -58,7 +58,8 @@ void ScreenOptionsManageEditSteps::BeginScreen() { // Reload so that we're consistent with the disk in case the user has been dinking around with their edits. SONGMAN->FreeAllLoadedFromProfile( ProfileSlot_Machine ); - SONGMAN->LoadAllFromProfileDir( PROFILEMAN->GetProfileDir(ProfileSlot_Machine), ProfileSlot_Machine ); + SONGMAN->LoadStepEditsFromProfileDir( PROFILEMAN->GetProfileDir(ProfileSlot_Machine), ProfileSlot_Machine ); + SONGMAN->LoadCourseEditsFromProfileDir( PROFILEMAN->GetProfileDir(ProfileSlot_Machine), ProfileSlot_Machine ); GAMESTATE->m_pCurSong.Set( NULL ); GAMESTATE->m_pCurSteps[PLAYER_1].Set( NULL ); diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index bfaabdab4e..37df305d88 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -1490,7 +1490,7 @@ void SongManager::RefreshCourseGroupInfo() } } -void SongManager::LoadAllFromProfileDir( const RString &sProfileDir, ProfileSlot slot ) +void SongManager::LoadStepEditsFromProfileDir( const RString &sProfileDir, ProfileSlot slot ) { { // @@ -1511,7 +1511,10 @@ void SongManager::LoadAllFromProfileDir( const RString &sProfileDir, ProfileSlot SMLoader::LoadEditFromFile( fn, slot, true ); } } +} +void SongManager::LoadCourseEditsFromProfileDir( const RString &sProfileDir, ProfileSlot slot ) +{ { // // Load all edit courses diff --git a/stepmania/src/SongManager.h b/stepmania/src/SongManager.h index 0b20e717c8..30413db4e8 100644 --- a/stepmania/src/SongManager.h +++ b/stepmania/src/SongManager.h @@ -39,7 +39,8 @@ public: void RegenerateNonFixedCourses(); void SetPreferences(); - void LoadAllFromProfileDir( const RString &sProfileDir, ProfileSlot slot ); + void LoadStepEditsFromProfileDir( const RString &sProfileDir, ProfileSlot slot ); + void LoadCourseEditsFromProfileDir( const RString &sProfileDir, ProfileSlot slot ); int GetNumStepsLoadedFromProfile(); void FreeAllLoadedFromProfile( ProfileSlot slot = ProfileSlot_Invalid );