Profile::ClearStats

This commit is contained in:
Glenn Maynard
2007-05-06 05:13:58 +00:00
parent 837f29e0f9
commit 6b60a97092
5 changed files with 12 additions and 9 deletions
+8
View File
@@ -87,6 +87,14 @@ void Profile::InitEditableData()
m_iWeightPounds = 0; m_iWeightPounds = 0;
} }
void Profile::ClearStats()
{
// don't reset the Guid
RString sGuid = m_sGuid;
InitAll();
m_sGuid = sGuid;
}
RString Profile::MakeGuid() RString Profile::MakeGuid()
{ {
RString s; RString s;
+1
View File
@@ -296,6 +296,7 @@ public:
void InitCalorieData(); void InitCalorieData();
void InitRecentSongScores(); void InitRecentSongScores();
void InitRecentCourseScores(); void InitRecentCourseScores();
void ClearStats();
// //
// Loading and saving // Loading and saving
+2 -3
View File
@@ -25,7 +25,6 @@
#include "Profile.h" #include "Profile.h"
#include "SongManager.h" #include "SongManager.h"
#include "GameLoop.h" #include "GameLoop.h"
#include "ScreenServiceAction.h"
#include "song.h" #include "song.h"
static bool g_bIsDisplayed = false; static bool g_bIsDisplayed = false;
@@ -711,8 +710,8 @@ class DebugLineClearMachineStats : public IDebugLine
virtual RString GetPageName() const { return "Profiles"; } virtual RString GetPageName() const { return "Profiles"; }
virtual void DoAndMakeSystemMessage( RString &sMessageOut ) virtual void DoAndMakeSystemMessage( RString &sMessageOut )
{ {
GameCommand gc; Profile* pProfile = PROFILEMAN->GetMachineProfile();
ClearMachineStats(); pProfile->ClearStats();
IDebugLine::DoAndMakeSystemMessage( sMessageOut ); IDebugLine::DoAndMakeSystemMessage( sMessageOut );
} }
}; };
+1 -4
View File
@@ -29,10 +29,7 @@ static LocalizedString MACHINE_STATS_CLEARED( "ScreenServiceAction", "Machine st
RString ClearMachineStats() RString ClearMachineStats()
{ {
Profile* pProfile = PROFILEMAN->GetMachineProfile(); Profile* pProfile = PROFILEMAN->GetMachineProfile();
// don't reset the Guid pProfile->ClearStats();
RString sGuid = pProfile->m_sGuid;
pProfile->InitAll();
pProfile->m_sGuid = sGuid;
PROFILEMAN->SaveMachineProfile(); PROFILEMAN->SaveMachineProfile();
return MACHINE_STATS_CLEARED.GetValue(); return MACHINE_STATS_CLEARED.GetValue();
} }
-2
View File
@@ -8,8 +8,6 @@
#undef FAILED #undef FAILED
#endif #endif
RString ClearMachineStats();
#include "ScreenPrompt.h" #include "ScreenPrompt.h"
class ScreenServiceAction : public ScreenPrompt class ScreenServiceAction : public ScreenPrompt