diff --git a/stepmania/src/ScreenServiceAction.cpp b/stepmania/src/ScreenServiceAction.cpp index e814cf7a50..98bbfb9e9b 100644 --- a/stepmania/src/ScreenServiceAction.cpp +++ b/stepmania/src/ScreenServiceAction.cpp @@ -14,6 +14,7 @@ #include "GameState.h" #include "PlayerState.h" #include "LocalizedString.h" +#include "StepMania.h" static LocalizedString BOOKKEEPING_DATA_CLEARED( "ScreenServiceAction", "Bookkeeping data cleared." ); static RString ClearBookkeepingData() @@ -174,15 +175,15 @@ static RString TransferStatsMemoryCardToMachine() return s; } -static void CopyEdits( const RString &sFrom, const RString &sTo, int &iNumAttempted, int &iNumSuccessful, int &iNumOverwritten ) +static void CopyEdits( const RString &sFromProfileDir, const RString &sToProfileDir, int &iNumAttempted, int &iNumSuccessful, int &iNumOverwritten ) { iNumAttempted = 0; iNumSuccessful = 0; iNumOverwritten = 0; { - RString sFromDir = sFrom + EDIT_STEPS_SUBDIR; - RString sToDir = sTo + EDIT_STEPS_SUBDIR; + RString sFromDir = sFromProfileDir + EDIT_STEPS_SUBDIR; + RString sToDir = sToProfileDir + EDIT_STEPS_SUBDIR; vector vsFiles; GetDirListing( sFromDir+"*.edit", vsFiles, false, false ); @@ -195,11 +196,13 @@ static void CopyEdits( const RString &sFrom, const RString &sTo, int &iNumAttemp if( bSuccess ) iNumSuccessful++; } + + FILEMAN->FlushDirCache( sToDir ); } { - RString sFromDir = sFrom + EDIT_COURSES_SUBDIR; - RString sToDir = sTo + EDIT_COURSES_SUBDIR; + RString sFromDir = sFromProfileDir + EDIT_COURSES_SUBDIR; + RString sToDir = sToProfileDir + EDIT_COURSES_SUBDIR; vector vsFiles; GetDirListing( sFromDir+"*.crs", vsFiles, false, false ); @@ -212,7 +215,10 @@ static void CopyEdits( const RString &sFrom, const RString &sTo, int &iNumAttemp if( bSuccess ) iNumSuccessful++; } + + FILEMAN->FlushDirCache( sToDir ); } + } static void SyncFiles( const RString &sFromDir, const RString &sToDir, const RString &sMask, int &iNumAdded, int &iNumDeleted, int &iNumOverwritten, int &iNumFailed ) @@ -254,6 +260,8 @@ static void SyncFiles( const RString &sFromDir, const RString &sToDir, const RSt else ++iNumFailed; } + + FILEMAN->FlushDirCache( sToDir ); } static void SyncEdits( const RString &sFromDir, const RString &sToDir, int &iNumAdded, int &iNumDeleted, int &iNumOverwritten, int &iNumFailed ) @@ -362,7 +370,7 @@ static RString CopyEditsMemoryCardToMachine() static LocalizedString PREFERENCES_RESET( "ScreenServiceAction", "Preferences reset." ); static RString ResetPreferences() { - PREFSMAN->ResetToFactoryDefaults(); + StepMania::ResetPreferences(); return PREFERENCES_RESET.GetValue(); } diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index ab8d49beac..27f30874c1 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -225,6 +225,16 @@ void StepMania::ApplyGraphicOptions() INPUTMAN->WindowReset(); } +bool CheckVideoDefaultSettings(); + +void StepMania::ResetPreferences() +{ + PREFSMAN->ResetToFactoryDefaults(); + SOUNDMAN->SetMixVolume( PREFSMAN->GetSoundVolume() ); + CheckVideoDefaultSettings(); + ApplyGraphicOptions(); +} + /* Shutdown all global singletons. Note that this may be called partway through * initialization, due to an object failing to initialize, in which case some of * these may still be NULL. */ diff --git a/stepmania/src/StepMania.h b/stepmania/src/StepMania.h index 2b21e8b20b..eb45fc8afc 100644 --- a/stepmania/src/StepMania.h +++ b/stepmania/src/StepMania.h @@ -10,6 +10,7 @@ int main( int argc, char* argv[] ); namespace StepMania { void ApplyGraphicOptions(); + void ResetPreferences(); void ResetGame(); void ChangeCurrentGame( const Game* g );