Skip to content

Commit 14a6bed

Browse files
author
Sam Feeney
committed
music wheel displays highest grade of any difficulty (more to do on this)
1 parent 778ea05 commit 14a6bed

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

src/MusicWheelItem.cpp

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -345,15 +345,26 @@ void MusicWheelItem::RefreshGrades()
345345

346346
Profile *pProfile = PROFILEMAN->GetProfile(ps);
347347

348-
HighScoreList *pHSL = NULL;
348+
HighScoreList *pHSL = NULL;
349+
/* quick hack to make the highest grade for any difficulty show up,
350+
should make optional later, also should make it descend through the
351+
difficulties and stop once a valid grade has been hit - Mina*/
352+
Grade agP;
349353
if( PROFILEMAN->IsPersistentProfile(ps) && dc != Difficulty_Invalid )
350354
{
351-
if( pWID->m_pSong )
355+
if (pWID->m_pSong)
352356
{
353-
const Steps* pSteps = SongUtil::GetStepsByDifficulty( pWID->m_pSong, st, dc );
354-
if( pSteps != NULL )
355-
pHSL = &pProfile->GetStepsHighScoreList(pWID->m_pSong, pSteps);
357+
FOREACH_ENUM(Difficulty, i) {
358+
Steps* pSteps = SongUtil::GetStepsByDifficulty(pWID->m_pSong, st, i);
359+
if (pSteps != NULL) {
360+
pHSL = &pProfile->GetStepsHighScoreList(pWID->m_pSong, pSteps);
361+
Grade ag = pHSL->HighGrade;
362+
agP = min(ag,agP);
363+
}
364+
}
356365
}
366+
367+
357368
else if( pWID->m_pCourse )
358369
{
359370
const Trail *pTrail = pWID->m_pCourse->GetTrail( st, dc );
@@ -366,7 +377,7 @@ void MusicWheelItem::RefreshGrades()
366377
msg.SetParam( "PlayerNumber", p );
367378
if( pHSL )
368379
{
369-
msg.SetParam( "Grade", pHSL->HighGrade );
380+
msg.SetParam( "Grade", agP );
370381
msg.SetParam( "NumTimesPlayed", pHSL->GetNumTimesPlayed() );
371382
}
372383
m_pGradeDisplay[p]->HandleMessage( msg );

0 commit comments

Comments
 (0)