diff --git a/stepmania/src/PrefsManager.cpp b/stepmania/src/PrefsManager.cpp index 52818ec1a5..eee9c98043 100644 --- a/stepmania/src/PrefsManager.cpp +++ b/stepmania/src/PrefsManager.cpp @@ -231,6 +231,9 @@ void PrefsManager::Init() m_bAnisotropicFiltering = false; g_bAutoRestart = false; m_bSignProfileData = false; + /* Most people use local profiles, so writing profile stats is redundant. */ + m_bWriteMachineStatsHtml = true; + m_bWriteProfileStatsHtml = false; m_bEditorShowBGChangesPlay = false; @@ -529,6 +532,8 @@ void PrefsManager::ReadPrefsFromFile( CString sIni ) ini.GetValue( "Options", "AnisotropicFiltering", m_bAnisotropicFiltering ); ini.GetValue( "Options", "AutoRestart", g_bAutoRestart ); ini.GetValue( "Options", "SignProfileData", m_bSignProfileData ); + ini.GetValue( "Options", "WriteMachineStatsHtml", m_bWriteMachineStatsHtml ); + ini.GetValue( "Options", "WriteProfileStatsHtml", m_bWriteProfileStatsHtml ); ini.GetValue( "Editor", "ShowBGChangesPlay", m_bEditorShowBGChangesPlay ); @@ -753,6 +758,8 @@ void PrefsManager::SaveGlobalPrefsToDisk() const ini.SetValue( "Options", "AnisotropicFiltering", m_bAnisotropicFiltering ); ini.SetValue( "Options", "AutoRestart", g_bAutoRestart ); ini.SetValue( "Options", "SignProfileData", m_bSignProfileData ); + ini.SetValue( "Options", "WriteMachineStatsHtml", m_bWriteMachineStatsHtml ); + ini.SetValue( "Options", "WriteProfileStatsHtml", m_bWriteProfileStatsHtml ); ini.SetValue( "Options", "SoundWriteAhead", m_iSoundWriteAhead ); diff --git a/stepmania/src/PrefsManager.h b/stepmania/src/PrefsManager.h index 7f214d6601..97917fbcde 100644 --- a/stepmania/src/PrefsManager.h +++ b/stepmania/src/PrefsManager.h @@ -211,7 +211,8 @@ public: // and verified when reading profile data. Leave this false if // you want to use a profile on different machines that don't // have the same key, or else the profile's data will be discarded. - bool m_bSignProfileData; + bool m_bSignProfileData; + bool m_bWriteMachineStatsHtml, m_bWriteProfileStatsHtml; /* Editor prefs: */ bool m_bEditorShowBGChangesPlay; diff --git a/stepmania/src/Profile.cpp b/stepmania/src/Profile.cpp index 766aa2b0dc..b214f7610a 100644 --- a/stepmania/src/Profile.cpp +++ b/stepmania/src/Profile.cpp @@ -700,7 +700,10 @@ bool Profile::SaveAllToDir( CString sDir, bool bSignData ) const DeleteCategoryScoresFromDirSM390a12( sDir ); } - SaveStatsWebPageToDir( sDir ); + const bool bThisIsMachineProfile = (this == PROFILEMAN->GetMachineProfile()); // XXX + if( (bThisIsMachineProfile && PREFSMAN->m_bWriteMachineStatsHtml) || + (!bThisIsMachineProfile && PREFSMAN->m_bWriteProfileStatsHtml) ) + SaveStatsWebPageToDir( sDir ); // // create edits dir diff --git a/stepmania/src/ScreenDownloadMachineStats.cpp b/stepmania/src/ScreenDownloadMachineStats.cpp index 3c24c5033c..20908b3090 100644 --- a/stepmania/src/ScreenDownloadMachineStats.cpp +++ b/stepmania/src/ScreenDownloadMachineStats.cpp @@ -18,7 +18,13 @@ static void SaveMachineStatsToFirstMemCard() CString sDir = MEM_CARD_MOUNT_POINT[pn]; sDir += "MachineProfile/"; + + bool bOldVal = PREFSMAN->m_bWriteMachineStatsHtml; + PREFSMAN->m_bWriteMachineStatsHtml = true; + PROFILEMAN->GetMachineProfile()->SaveAllToDir( sDir, PREFSMAN->m_bSignProfileData ); + + PREFSMAN->m_bWriteMachineStatsHtml = bOldVal; SCREENMAN->SystemMessage( ssprintf("Machine stats saved to P%d card.",pn+1) ); return; }