set NumTimesPlayed
This commit is contained in:
Glenn Maynard
2007-06-08 17:11:49 +00:00
parent dc156cc971
commit 7532b19031
3 changed files with 29 additions and 27 deletions
+28 -7
View File
@@ -272,7 +272,8 @@ void MusicWheelItem::LoadFromWheelItemData( const WheelItemBaseData *pWIBD, int
this->HandleMessage( msg );
}
}
#include "Style.h"
#include "Profile.h"
void MusicWheelItem::RefreshGrades()
{
if( data == NULL )
@@ -301,14 +302,34 @@ void MusicWheelItem::RefreshGrades()
continue;
m_pGradeDisplay[p]->SetVisible( true );
Grade g;
if( data->m_pSong )
g = PROFILEMAN->GetGradeForSteps( data->m_pSong, GAMESTATE->GetCurrentStyle(), ps, dc );
else
g = PROFILEMAN->GetGradeForTrail( data->m_pCourse, GAMESTATE->GetCurrentStyle(), ps, dc );
Profile *pProfile = PROFILEMAN->GetProfile(ps);
HighScoreList *pHSL = NULL;
if( PROFILEMAN->IsPersistentProfile(ps) )
{
if( data->m_pSong )
{
const Steps* pSteps = SongUtil::GetStepsByDifficulty( data->m_pSong, GAMESTATE->GetCurrentStyle()->m_StepsType, dc );
if( pSteps != NULL )
pHSL = &pProfile->GetStepsHighScoreList(data->m_pSong, pSteps);
}
else if( data->m_pCourse )
{
const Trail *pTrail = data->m_pCourse->GetTrail( GAMESTATE->GetCurrentStyle()->m_StepsType, dc );
if( pTrail != NULL )
pHSL = &pProfile->GetCourseHighScoreList( data->m_pCourse, pTrail );
}
}
Message msg( "SetGrade" );
msg.SetParam( "PlayerNumber", p );
msg.SetParam( "Grade", g );
if( pHSL )
{
msg.SetParam( "Grade", pHSL->HighGrade );
msg.SetParam( "NumTimesPlayed", pHSL->GetNumTimesPlayed() );
}
m_pGradeDisplay[p]->HandleMessage( msg );
}
}
-18
View File
@@ -678,24 +678,6 @@ void ProfileManager::IncrementStepsPlayCount( const Song* pSong, const Steps* pS
GetMachineProfile()->IncrementStepsPlayCount( pSong, pSteps );
}
Grade ProfileManager::GetGradeForSteps( const Song *pSong, const Style *st, ProfileSlot slot, Difficulty dc ) const
{
const Steps* pSteps = SongUtil::GetStepsByDifficulty( pSong, st->m_StepsType, dc );
if( pSteps == NULL || !IsPersistentProfile(slot) )
return Grade_NoData;
return GetProfile(slot)->GetStepsHighScoreList(pSong, pSteps).HighGrade;
}
Grade ProfileManager::GetGradeForTrail( const Course *pCourse, const Style *st, ProfileSlot slot, Difficulty dc ) const
{
const Trail *pTrail = pCourse->GetTrail( st->m_StepsType, dc );
if( pTrail == NULL || !IsPersistentProfile(slot) )
return Grade_NoData;
return GetProfile( slot )->GetCourseHighScoreList( pCourse, pTrail ).HighGrade;
}
//
// Course stats
//
+1 -2
View File
@@ -94,14 +94,13 @@ public:
bool IsSongNew( const Song* pSong ) const { return GetSongNumTimesPlayed(pSong,ProfileSlot_Machine)==0; }
void AddStepsScore( const Song* pSong, const Steps* pSteps , PlayerNumber pn, const HighScore &hs, int &iPersonalIndexOut, int &iMachineIndexOut );
void IncrementStepsPlayCount( const Song* pSong, const Steps* pSteps, PlayerNumber pn );
Grade GetGradeForSteps( const Song *s, const Style *st, ProfileSlot slot, Difficulty dc ) const;
//
// Course stats
//
void AddCourseScore( const Course* pCourse, const Trail* pTrail, PlayerNumber pn, const HighScore &hs, int &iPersonalIndexOut, int &iMachineIndexOut );
void IncrementCoursePlayCount( const Course* pCourse, const Trail* pTrail, PlayerNumber pn );
Grade GetGradeForTrail( const Course *pCourse, const Style *st, ProfileSlot slot, Difficulty dc ) const;
//
// Category stats
//