Fixed Grade display on MusicWheel not corresponding to top score
This commit is contained in:
@@ -185,10 +185,17 @@ void WheelItemDisplay::RefreshGrades()
|
||||
|
||||
if( m_pSong ) // this is a song display
|
||||
{
|
||||
const Difficulty dc = GAMESTATE->m_PreferredDifficulty[p];
|
||||
const Grade grade = m_pSong->GetGradeForDifficulty( GAMESTATE->GetCurrentStyleDef(), p, dc );
|
||||
m_GradeDisplay[p].SetGrade( (PlayerNumber)p, grade );
|
||||
//m_GradeDisplay[p].SetDiffuse( PlayerToColor((PlayerNumber)p) );
|
||||
if( m_pSong == GAMESTATE->m_pCurSong )
|
||||
{
|
||||
Notes* pNotes = GAMESTATE->m_pCurNotes[p];
|
||||
m_GradeDisplay[p].SetGrade( (PlayerNumber)p, pNotes->m_TopGrade );
|
||||
}
|
||||
else
|
||||
{
|
||||
const Difficulty dc = GAMESTATE->m_PreferredDifficulty[p];
|
||||
const Grade grade = m_pSong->GetGradeForDifficulty( GAMESTATE->GetCurrentStyleDef(), p, dc );
|
||||
m_GradeDisplay[p].SetGrade( (PlayerNumber)p, grade );
|
||||
}
|
||||
}
|
||||
else // this is a section display
|
||||
{
|
||||
|
||||
@@ -187,12 +187,19 @@ bool NotesWriterDWI::WriteDWINotesTag( FILE* fp, const Notes &out )
|
||||
default: return false; // not a type supported by DWI
|
||||
}
|
||||
|
||||
switch( out.m_Difficulty )
|
||||
if( 0==out.m_sDescription.CompareNoCase("challenge") )
|
||||
fprintf( fp, "SMANIAC:" );
|
||||
else if( 0==out.m_sDescription.CompareNoCase("smaniac") )
|
||||
fprintf( fp, "SMANIAC:" );
|
||||
else
|
||||
{
|
||||
case DIFFICULTY_EASY: fprintf( fp, "BASIC:" ); break;
|
||||
case DIFFICULTY_MEDIUM: fprintf( fp, "ANOTHER:" ); break;
|
||||
case DIFFICULTY_HARD: fprintf( fp, "MANIAC:" ); break;
|
||||
default: ASSERT(0); return false;
|
||||
switch( out.m_Difficulty )
|
||||
{
|
||||
case DIFFICULTY_EASY: fprintf( fp, "BASIC:" ); break;
|
||||
case DIFFICULTY_MEDIUM: fprintf( fp, "ANOTHER:" ); break;
|
||||
case DIFFICULTY_HARD: fprintf( fp, "MANIAC:" ); break;
|
||||
default: ASSERT(0); return false;
|
||||
}
|
||||
}
|
||||
|
||||
fprintf( fp, "%d:\n", out.m_iMeter );
|
||||
|
||||
@@ -799,17 +799,20 @@ void Song::AddAutoGenNotes()
|
||||
|
||||
Grade Song::GetGradeForDifficulty( const StyleDef *st, int p, Difficulty dc ) const
|
||||
{
|
||||
// return max grade of notes in difficulty class
|
||||
CArray<Notes*, Notes*> aNotes;
|
||||
this->GetNotesThatMatch( st, p, aNotes );
|
||||
SortNotesArrayByDifficulty( aNotes );
|
||||
|
||||
Grade grade = GRADE_NO_DATA;
|
||||
|
||||
for( int i=0; i<aNotes.GetSize(); i++ )
|
||||
{
|
||||
const Notes* pNotes = aNotes[i];
|
||||
if( pNotes->m_Difficulty == dc )
|
||||
return pNotes->m_TopGrade;
|
||||
grade = max( grade, pNotes->m_TopGrade );
|
||||
}
|
||||
return GRADE_NO_DATA;
|
||||
return grade;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user