simplify
set NumTimesPlayed
This commit is contained in:
@@ -272,7 +272,8 @@ void MusicWheelItem::LoadFromWheelItemData( const WheelItemBaseData *pWIBD, int
|
|||||||
this->HandleMessage( msg );
|
this->HandleMessage( msg );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#include "Style.h"
|
||||||
|
#include "Profile.h"
|
||||||
void MusicWheelItem::RefreshGrades()
|
void MusicWheelItem::RefreshGrades()
|
||||||
{
|
{
|
||||||
if( data == NULL )
|
if( data == NULL )
|
||||||
@@ -301,14 +302,34 @@ void MusicWheelItem::RefreshGrades()
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
m_pGradeDisplay[p]->SetVisible( true );
|
m_pGradeDisplay[p]->SetVisible( true );
|
||||||
Grade g;
|
|
||||||
|
|
||||||
|
Profile *pProfile = PROFILEMAN->GetProfile(ps);
|
||||||
|
|
||||||
|
HighScoreList *pHSL = NULL;
|
||||||
|
if( PROFILEMAN->IsPersistentProfile(ps) )
|
||||||
|
{
|
||||||
if( data->m_pSong )
|
if( data->m_pSong )
|
||||||
g = PROFILEMAN->GetGradeForSteps( data->m_pSong, GAMESTATE->GetCurrentStyle(), ps, dc );
|
{
|
||||||
else
|
const Steps* pSteps = SongUtil::GetStepsByDifficulty( data->m_pSong, GAMESTATE->GetCurrentStyle()->m_StepsType, dc );
|
||||||
g = PROFILEMAN->GetGradeForTrail( data->m_pCourse, GAMESTATE->GetCurrentStyle(), ps, 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" );
|
Message msg( "SetGrade" );
|
||||||
msg.SetParam( "PlayerNumber", p );
|
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 );
|
m_pGradeDisplay[p]->HandleMessage( msg );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -678,24 +678,6 @@ void ProfileManager::IncrementStepsPlayCount( const Song* pSong, const Steps* pS
|
|||||||
GetMachineProfile()->IncrementStepsPlayCount( pSong, pSteps );
|
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
|
// Course stats
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -94,14 +94,13 @@ public:
|
|||||||
bool IsSongNew( const Song* pSong ) const { return GetSongNumTimesPlayed(pSong,ProfileSlot_Machine)==0; }
|
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 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 );
|
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
|
// Course stats
|
||||||
//
|
//
|
||||||
void AddCourseScore( const Course* pCourse, const Trail* pTrail, PlayerNumber pn, const HighScore &hs, int &iPersonalIndexOut, int &iMachineIndexOut );
|
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 );
|
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
|
// Category stats
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user