ProfileStepEdits, ProfileCourseEdits prefs
This commit is contained in:
@@ -944,8 +944,10 @@ bool Profile::SaveAllToDir( RString sDir, bool bSignData ) const
|
|||||||
SaveStatsWebPageToDir( sDir );
|
SaveStatsWebPageToDir( sDir );
|
||||||
|
|
||||||
// Empty directories if none exist.
|
// Empty directories if none exist.
|
||||||
FILEMAN->CreateDir( sDir + EDIT_STEPS_SUBDIR );
|
if( ProfileManager::m_bProfileStepEdits )
|
||||||
FILEMAN->CreateDir( sDir + EDIT_COURSES_SUBDIR );
|
FILEMAN->CreateDir( sDir + EDIT_STEPS_SUBDIR );
|
||||||
|
if( ProfileManager::m_bProfileCourseEdits )
|
||||||
|
FILEMAN->CreateDir( sDir + EDIT_COURSES_SUBDIR );
|
||||||
FILEMAN->CreateDir( sDir + SCREENSHOTS_SUBDIR );
|
FILEMAN->CreateDir( sDir + SCREENSHOTS_SUBDIR );
|
||||||
|
|
||||||
FILEMAN->FlushDirCache( sDir );
|
FILEMAN->FlushDirCache( sDir );
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ static void DefaultLocalProfileIDInit( size_t /*PlayerNumber*/ i, RString &sName
|
|||||||
defaultValueOut = "";
|
defaultValueOut = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Preference<bool> ProfileManager::m_bProfileStepEdits( "ProfileStepEdits", true );
|
||||||
|
Preference<bool> ProfileManager::m_bProfileCourseEdits( "ProfileCourseEdits", true );
|
||||||
Preference1D<RString> ProfileManager::m_sDefaultLocalProfileID( DefaultLocalProfileIDInit, NUM_PLAYERS );
|
Preference1D<RString> ProfileManager::m_sDefaultLocalProfileID( DefaultLocalProfileIDInit, NUM_PLAYERS );
|
||||||
|
|
||||||
const RString NEW_MEM_CARD_NAME = "";
|
const RString NEW_MEM_CARD_NAME = "";
|
||||||
@@ -260,7 +262,10 @@ bool ProfileManager::LoadProfileFromMemoryCard( PlayerNumber pn, bool bLoadEdits
|
|||||||
const RString &sSubdir = asDirsToTry[i];
|
const RString &sSubdir = asDirsToTry[i];
|
||||||
RString sDir = MEM_CARD_MOUNT_POINT[pn] + sSubdir + "/";
|
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 )
|
bool ProfileManager::SaveLocalProfile( RString sProfileID )
|
||||||
{
|
{
|
||||||
Profile *pProfile = GetLocalProfile( sProfileID );
|
const Profile *pProfile = GetLocalProfile( sProfileID );
|
||||||
ASSERT( pProfile != NULL );
|
ASSERT( pProfile != NULL );
|
||||||
RString sDir = LocalProfileIDToDir( sProfileID );
|
RString sDir = LocalProfileIDToDir( sProfileID );
|
||||||
bool b = pProfile->SaveAllToDir( sDir, PREFSMAN->m_bSignProfileData );
|
bool b = pProfile->SaveAllToDir( sDir, PREFSMAN->m_bSignProfileData );
|
||||||
@@ -534,7 +539,8 @@ void ProfileManager::LoadMachineProfile()
|
|||||||
m_pMachineProfile->m_sDisplayName = PREFSMAN->m_sMachineName;
|
m_pMachineProfile->m_sDisplayName = PREFSMAN->m_sMachineName;
|
||||||
|
|
||||||
SONGMAN->FreeAllLoadedFromProfile( ProfileSlot_Machine );
|
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
|
bool ProfileManager::ProfileWasLoadedFromMemoryCard( PlayerNumber pn ) const
|
||||||
|
|||||||
@@ -113,6 +113,8 @@ public:
|
|||||||
// Lua
|
// Lua
|
||||||
void PushSelf( lua_State *L );
|
void PushSelf( lua_State *L );
|
||||||
|
|
||||||
|
static Preference<bool> m_bProfileStepEdits;
|
||||||
|
static Preference<bool> m_bProfileCourseEdits;
|
||||||
static Preference1D<RString> m_sDefaultLocalProfileID;
|
static Preference1D<RString> m_sDefaultLocalProfileID;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -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.
|
// 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->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_pCurSong.Set( NULL );
|
||||||
GAMESTATE->m_pCurSteps[PLAYER_1].Set( NULL );
|
GAMESTATE->m_pCurSteps[PLAYER_1].Set( NULL );
|
||||||
|
|
||||||
|
|||||||
@@ -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 );
|
SMLoader::LoadEditFromFile( fn, slot, true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SongManager::LoadCourseEditsFromProfileDir( const RString &sProfileDir, ProfileSlot slot )
|
||||||
|
{
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Load all edit courses
|
// Load all edit courses
|
||||||
|
|||||||
@@ -39,7 +39,8 @@ public:
|
|||||||
void RegenerateNonFixedCourses();
|
void RegenerateNonFixedCourses();
|
||||||
void SetPreferences();
|
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();
|
int GetNumStepsLoadedFromProfile();
|
||||||
void FreeAllLoadedFromProfile( ProfileSlot slot = ProfileSlot_Invalid );
|
void FreeAllLoadedFromProfile( ProfileSlot slot = ProfileSlot_Invalid );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user