Profile::ClearStats
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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 );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user