Implement TopGradesGrouped sort order. Compiles fine, but untested.
authorCameron Ball <cameron@getapproved.com.au>
Thu, 7 Aug 2014 05:47:55 +0000 (13:47 +0800)
committerCameron Ball <cameron@getapproved.com.au>
Thu, 7 Aug 2014 05:47:55 +0000 (13:47 +0800)
src/GameConstantsAndTypes.cpp
src/GameConstantsAndTypes.h
src/SongUtil.cpp

index 0604c0a..7ad3596 100644 (file)
@@ -148,6 +148,7 @@ static const CString SortOrderNames[] = {
        "Bpm",
        "Popularity",
        "TopGrades",
+       "TopGradesGrouped"
        "Artist",
        "Genre",
        "SongLength",
index efe6728..cd8f141 100644 (file)
@@ -100,6 +100,7 @@ enum SortOrder {
        SORT_BPM, 
        SORT_POPULARITY, 
        SORT_TOP_GRADES,
+       SORT_TOP_GRADES_GROUPED,
        SORT_ARTIST,
        SORT_GENRE,
        SORT_SONG_LENGTH,
index 5a66e59..d66315e 100644 (file)
@@ -281,6 +281,19 @@ CString SongUtil::GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so
                        }
                        return GradeToThemedString( GRADE_NO_DATA );
                }
+       case SORT_TOP_GRADES_GROUPED:
+               {
+                       int iCounts[NUM_GRADES];
+                       PROFILEMAN->GetMachineProfile()->GetGrades( pSong, GAMESTATE->GetCurrentStyle()->m_StepsType, iCounts );
+
+                       for( int i=GRADE_TIER01; i<NUM_GRADES; ++i )
+                       {
+                               Grade g = (Grade)i;
+                               if( iCounts[i] > 0 )
+                                       return ssprintf( "%4s", GradeToThemedString(g).c_str());
+                       }
+                       return GradeToThemedString( GRADE_NO_DATA );
+               }
        case SORT_EASY_METER:
                {
                        Steps* pSteps = pSong->GetStepsByDifficulty(GAMESTATE->GetCurrentStyle()->m_StepsType,DIFFICULTY_EASY);