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