show overall PercentComplete on ScreenEnding
This commit is contained in:
@@ -195,7 +195,7 @@ int Profile::GetTotalNumSongsPassed() const
|
|||||||
return iTotal;
|
return iTotal;
|
||||||
}
|
}
|
||||||
|
|
||||||
float Profile::GetSongsPercentComplete( StepsType st, Difficulty dc ) const
|
float Profile::GetSongsPossible( StepsType st, Difficulty dc ) const
|
||||||
{
|
{
|
||||||
int iTotalSteps = 0;
|
int iTotalSteps = 0;
|
||||||
|
|
||||||
@@ -223,7 +223,11 @@ float Profile::GetSongsPercentComplete( StepsType st, Difficulty dc ) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return iTotalSteps;
|
||||||
|
}
|
||||||
|
|
||||||
|
float Profile::GetSongsActual( StepsType st, Difficulty dc ) const
|
||||||
|
{
|
||||||
float fTotalPercents = 0;
|
float fTotalPercents = 0;
|
||||||
|
|
||||||
// add steps high scores
|
// add steps high scores
|
||||||
@@ -269,10 +273,15 @@ float Profile::GetSongsPercentComplete( StepsType st, Difficulty dc ) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return fTotalPercents / iTotalSteps;
|
return fTotalPercents;
|
||||||
}
|
}
|
||||||
|
|
||||||
float Profile::GetCoursesPercentComplete( StepsType st, CourseDifficulty cd ) const
|
float Profile::GetSongsPercentComplete( StepsType st, Difficulty dc ) const
|
||||||
|
{
|
||||||
|
return GetSongsActual(st,dc) / GetSongsPossible(st,dc);
|
||||||
|
}
|
||||||
|
|
||||||
|
float Profile::GetCoursesPossible( StepsType st, CourseDifficulty cd ) const
|
||||||
{
|
{
|
||||||
int iTotalTrails = 0;
|
int iTotalTrails = 0;
|
||||||
|
|
||||||
@@ -294,7 +303,11 @@ float Profile::GetCoursesPercentComplete( StepsType st, CourseDifficulty cd ) co
|
|||||||
iTotalTrails++;
|
iTotalTrails++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return iTotalTrails;
|
||||||
|
}
|
||||||
|
|
||||||
|
float Profile::GetCoursesActual( StepsType st, CourseDifficulty cd ) const
|
||||||
|
{
|
||||||
float fTotalPercents = 0;
|
float fTotalPercents = 0;
|
||||||
|
|
||||||
// add course high scores
|
// add course high scores
|
||||||
@@ -341,7 +354,12 @@ float Profile::GetCoursesPercentComplete( StepsType st, CourseDifficulty cd ) co
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return fTotalPercents / iTotalTrails;
|
return fTotalPercents;
|
||||||
|
}
|
||||||
|
|
||||||
|
float Profile::GetCoursesPercentComplete( StepsType st, CourseDifficulty cd ) const
|
||||||
|
{
|
||||||
|
return GetCoursesActual(st,cd) / GetCoursesPossible(st,cd);
|
||||||
}
|
}
|
||||||
|
|
||||||
CString Profile::GetProfileDisplayNameFromDir( CString sDir )
|
CString Profile::GetProfileDisplayNameFromDir( CString sDir )
|
||||||
|
|||||||
@@ -63,6 +63,10 @@ public:
|
|||||||
CString GetDisplayTotalCaloriesBurnedToday() const;
|
CString GetDisplayTotalCaloriesBurnedToday() const;
|
||||||
int GetTotalNumSongsPlayed() const;
|
int GetTotalNumSongsPlayed() const;
|
||||||
int GetTotalNumSongsPassed() const;
|
int GetTotalNumSongsPassed() const;
|
||||||
|
float GetSongsPossible( StepsType st, Difficulty dc ) const;
|
||||||
|
float GetCoursesPossible( StepsType st, CourseDifficulty cd ) const;
|
||||||
|
float GetSongsActual( StepsType st, Difficulty dc ) const;
|
||||||
|
float GetCoursesActual( StepsType st, CourseDifficulty cd ) const;
|
||||||
float GetSongsPercentComplete( StepsType st, Difficulty dc ) const;
|
float GetSongsPercentComplete( StepsType st, Difficulty dc ) const;
|
||||||
float GetCoursesPercentComplete( StepsType st, CourseDifficulty cd ) const;
|
float GetCoursesPercentComplete( StepsType st, CourseDifficulty cd ) const;
|
||||||
static CString GetProfileDisplayNameFromDir( CString sDir );
|
static CString GetProfileDisplayNameFromDir( CString sDir );
|
||||||
|
|||||||
@@ -30,29 +30,30 @@ CString GetStatsLineTitle( PlayerNumber pn, EndingStatsLine line )
|
|||||||
{
|
{
|
||||||
case CALORIES_TODAY: return "Calories Today";
|
case CALORIES_TODAY: return "Calories Today";
|
||||||
case CURRENT_COMBO: return "Current Combo";
|
case CURRENT_COMBO: return "Current Combo";
|
||||||
|
case PERCENT_COMPLETE:
|
||||||
|
{
|
||||||
|
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
||||||
|
CString sStepsType = GAMEMAN->StepsTypeToThemedString(st);
|
||||||
|
return ssprintf( "%s %% Complete", sStepsType.c_str() );
|
||||||
|
}
|
||||||
case PERCENT_COMPLETE_EASY:
|
case PERCENT_COMPLETE_EASY:
|
||||||
case PERCENT_COMPLETE_MEDIUM:
|
case PERCENT_COMPLETE_MEDIUM:
|
||||||
case PERCENT_COMPLETE_HARD:
|
case PERCENT_COMPLETE_HARD:
|
||||||
case PERCENT_COMPLETE_CHALLENGE:
|
case PERCENT_COMPLETE_CHALLENGE:
|
||||||
// Ugly...
|
|
||||||
{
|
{
|
||||||
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
|
||||||
CString sStepsType = GAMEMAN->StepsTypeToThemedString(st);
|
|
||||||
if( GAMESTATE->IsCourseMode() )
|
if( GAMESTATE->IsCourseMode() )
|
||||||
{
|
{
|
||||||
CourseDifficulty cd = (CourseDifficulty)(DIFFICULTY_EASY+line-PERCENT_COMPLETE_EASY);
|
CourseDifficulty cd = (CourseDifficulty)(DIFFICULTY_EASY+line-PERCENT_COMPLETE_EASY);
|
||||||
ASSERT( cd >= 0 && cd < NUM_COURSE_DIFFICULTIES );
|
ASSERT( cd >= 0 && cd < NUM_COURSE_DIFFICULTIES );
|
||||||
if( !GAMESTATE->IsCourseDifficultyShown(cd) )
|
if( !GAMESTATE->IsCourseDifficultyShown(cd) )
|
||||||
return "";
|
return "";
|
||||||
CString sDifficulty = CourseDifficultyToThemedString(cd);
|
return CourseDifficultyToThemedString(cd);
|
||||||
return ssprintf( "%s %% Complete", sStepsType.c_str() );
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Difficulty dc = (Difficulty)(DIFFICULTY_EASY+line-PERCENT_COMPLETE_EASY);
|
Difficulty dc = (Difficulty)(DIFFICULTY_EASY+line-PERCENT_COMPLETE_EASY);
|
||||||
ASSERT( dc >= 0 && dc < NUM_DIFFICULTIES );
|
ASSERT( dc >= 0 && dc < NUM_DIFFICULTIES );
|
||||||
CString sDifficulty = DifficultyToThemedString(dc);
|
return DifficultyToThemedString(dc);
|
||||||
return ssprintf( "%s %% Complete", sStepsType.c_str() );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
default: ASSERT(0); return "";
|
default: ASSERT(0); return "";
|
||||||
@@ -64,18 +65,49 @@ CString GetStatsLineValue( PlayerNumber pn, EndingStatsLine line )
|
|||||||
Profile* pProfile = PROFILEMAN->GetProfile( pn );
|
Profile* pProfile = PROFILEMAN->GetProfile( pn );
|
||||||
ASSERT( pProfile );
|
ASSERT( pProfile );
|
||||||
|
|
||||||
|
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
||||||
|
|
||||||
switch( line )
|
switch( line )
|
||||||
{
|
{
|
||||||
case CALORIES_TODAY: return pProfile->GetDisplayTotalCaloriesBurned();
|
case CALORIES_TODAY: return pProfile->GetDisplayTotalCaloriesBurned();
|
||||||
case CURRENT_COMBO: return Commify( pProfile->m_iCurrentCombo );
|
case CURRENT_COMBO: return Commify( pProfile->m_iCurrentCombo );
|
||||||
|
case PERCENT_COMPLETE:
|
||||||
|
{
|
||||||
|
float fActual = 0;
|
||||||
|
float fPossible = 0;
|
||||||
|
|
||||||
|
if( GAMESTATE->IsCourseMode() )
|
||||||
|
{
|
||||||
|
set<CourseDifficulty> vDiffs;
|
||||||
|
GAMESTATE->GetCourseDifficultiesToShow( vDiffs );
|
||||||
|
for( set<CourseDifficulty>::iterator iter = vDiffs.begin(); iter != vDiffs.end(); iter++ )
|
||||||
|
{
|
||||||
|
fActual += pProfile->GetCoursesActual(st,*iter);
|
||||||
|
fPossible += pProfile->GetCoursesPossible(st,*iter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
set<Difficulty> vDiffs;
|
||||||
|
GAMESTATE->GetDifficultiesToShow( vDiffs );
|
||||||
|
for( set<Difficulty>::iterator iter = vDiffs.begin(); iter != vDiffs.end(); iter++ )
|
||||||
|
{
|
||||||
|
fActual += pProfile->GetSongsActual(st,*iter);
|
||||||
|
fPossible += pProfile->GetSongsPossible(st,*iter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ssprintf( "%05.2f%%", fActual/fPossible*100 );
|
||||||
|
}
|
||||||
case PERCENT_COMPLETE_EASY:
|
case PERCENT_COMPLETE_EASY:
|
||||||
case PERCENT_COMPLETE_MEDIUM:
|
case PERCENT_COMPLETE_MEDIUM:
|
||||||
case PERCENT_COMPLETE_HARD:
|
case PERCENT_COMPLETE_HARD:
|
||||||
case PERCENT_COMPLETE_CHALLENGE:
|
case PERCENT_COMPLETE_CHALLENGE:
|
||||||
// Ugly...
|
// Ugly...
|
||||||
{
|
{
|
||||||
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
|
||||||
CString sStepsType = GAMEMAN->StepsTypeToThemedString(st);
|
CString sStepsType = GAMEMAN->StepsTypeToThemedString(st);
|
||||||
|
float fPercent = 0;
|
||||||
|
float fPossible = 0;
|
||||||
if( GAMESTATE->IsCourseMode() )
|
if( GAMESTATE->IsCourseMode() )
|
||||||
{
|
{
|
||||||
CourseDifficulty cd = (CourseDifficulty)(DIFFICULTY_EASY+line-PERCENT_COMPLETE_EASY);
|
CourseDifficulty cd = (CourseDifficulty)(DIFFICULTY_EASY+line-PERCENT_COMPLETE_EASY);
|
||||||
@@ -83,15 +115,16 @@ CString GetStatsLineValue( PlayerNumber pn, EndingStatsLine line )
|
|||||||
if( !GAMESTATE->IsCourseDifficultyShown(cd) )
|
if( !GAMESTATE->IsCourseDifficultyShown(cd) )
|
||||||
return "";
|
return "";
|
||||||
CString sDifficulty = CourseDifficultyToThemedString(cd);
|
CString sDifficulty = CourseDifficultyToThemedString(cd);
|
||||||
return ssprintf( "%06.3f%%", pProfile->GetCoursesPercentComplete(st,cd)*100 );
|
fPercent = pProfile->GetCoursesPercentComplete(st,cd);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Difficulty dc = (Difficulty)(DIFFICULTY_EASY+line-PERCENT_COMPLETE_EASY);
|
Difficulty dc = (Difficulty)(DIFFICULTY_EASY+line-PERCENT_COMPLETE_EASY);
|
||||||
ASSERT( dc >= 0 && dc < NUM_DIFFICULTIES );
|
ASSERT( dc >= 0 && dc < NUM_DIFFICULTIES );
|
||||||
CString sDifficulty = DifficultyToThemedString(dc);
|
CString sDifficulty = DifficultyToThemedString(dc);
|
||||||
return ssprintf( "%06.3f%%", pProfile->GetSongsPercentComplete(st,dc)*100 );
|
fPercent = pProfile->GetSongsPercentComplete(st,dc);
|
||||||
}
|
}
|
||||||
|
return ssprintf( "%05.2f%%", fPercent*100 );
|
||||||
}
|
}
|
||||||
default: ASSERT(0); return "";
|
default: ASSERT(0); return "";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ enum EndingStatsLine
|
|||||||
{
|
{
|
||||||
CALORIES_TODAY,
|
CALORIES_TODAY,
|
||||||
CURRENT_COMBO,
|
CURRENT_COMBO,
|
||||||
|
PERCENT_COMPLETE,
|
||||||
PERCENT_COMPLETE_EASY,
|
PERCENT_COMPLETE_EASY,
|
||||||
PERCENT_COMPLETE_MEDIUM,
|
PERCENT_COMPLETE_MEDIUM,
|
||||||
PERCENT_COMPLETE_HARD,
|
PERCENT_COMPLETE_HARD,
|
||||||
|
|||||||
Reference in New Issue
Block a user