diff --git a/stepmania/src/ProfileManager.cpp b/stepmania/src/ProfileManager.cpp index 1bf97a7a7f..7732249109 100644 --- a/stepmania/src/ProfileManager.cpp +++ b/stepmania/src/ProfileManager.cpp @@ -43,8 +43,8 @@ ProfileManager* PROFILEMAN = NULL; // global and accessable from anywhere in our #define COURSE_SCORES_FILE "CourseScores.dat" #define STATS_HTML_FILE "stats.html" #define STYLE_CSS_FILE "style.css" -#define NEW_MEM_CARD_NAME "NewCard" -#define NEW_PROFILE_NAME "NewProfile" +#define NEW_MEM_CARD_NAME "" +#define NEW_PROFILE_NAME "" #define SM_300_STATISTICS_FILE "statistics.ini" @@ -64,6 +64,34 @@ static const char *MEM_CARD_DIR[NUM_PLAYERS] = "@mc2/", }; + +CString Profile::GetDisplayName() +{ + if( !m_sName.empty() ) + return m_sName; + else if( !m_sLastUsedHighScoreName.empty() ) + return m_sLastUsedHighScoreName; + else + return "NO NAME"; +} + +CString Profile::GetDisplayCaloriesBurned() +{ + if( m_fWeightPounds == 0 ) // weight not entered + return "N/A"; + else + return ssprintf("%f.3Cal",m_fCaloriesBurned); +} + +int Profile::GetTotalNumSongsPlayed() +{ + int iTotal = 0; + for( int i=0; iGetMetric("Common","InitialScreen") -ScreenAttract::ScreenAttract( CString sClassName ) : Screen( sClassName ) +ScreenAttract::ScreenAttract( CString sClassName, bool bResetGameState ) : Screen( sClassName ) { LOG->Trace( "ScreenAttract::ScreenAttract(%s)", sClassName.c_str() ); @@ -38,7 +38,8 @@ ScreenAttract::ScreenAttract( CString sClassName ) : Screen( sClassName ) if( sClassName == INITIAL_SCREEN ) GAMESTATE->m_iNumTimesThroughAttract++; - GAMESTATE->Reset(); + if( bResetGameState ) + GAMESTATE->Reset(); // We have to do initialization in the first update because this->GetElementName() won't // work until the object has been fully constructed. diff --git a/stepmania/src/ScreenAttract.h b/stepmania/src/ScreenAttract.h index d1650d075b..bc0e36f14f 100644 --- a/stepmania/src/ScreenAttract.h +++ b/stepmania/src/ScreenAttract.h @@ -21,7 +21,7 @@ class ScreenAttract : public Screen { public: - ScreenAttract( CString sClassName ); + ScreenAttract( CString sClassName, bool bResetGameState=true ); virtual ~ScreenAttract(); virtual void Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI ); diff --git a/stepmania/src/ScreenManager.cpp b/stepmania/src/ScreenManager.cpp index 380af61507..3965108db8 100644 --- a/stepmania/src/ScreenManager.cpp +++ b/stepmania/src/ScreenManager.cpp @@ -176,10 +176,7 @@ void ScreenSystemLayer::RefreshCreditsMessages() Profile* pProfile = PROFILEMAN->GetProfile( (PlayerNumber)p ); if( pProfile ) { - if( !pProfile->m_sLastUsedHighScoreName.empty() ) - sCredits = pProfile->m_sLastUsedHighScoreName; - else - sCredits = pProfile->m_sName; + sCredits = pProfile->GetDisplayName(); } else {