Add Top Grades sort per profile. This allows each player to see their top grades based on the currently used profile.

The present implementation adds 2 new sorts for this, TOP_P1_Grades and TOP_P2_GRADES following the naming convention of TOP_GRADES which returns the machine grades.

I named the sort TopP1Grades rather than TopGradesP1 to prevent the "conflicting" banner error.

Eventually, I'd like to condense this to be 1 sort fed a playernumber or profile parameter in the future.

(cherry picked from commit 731ae501d8a14a196984bf7578afaa9351c22c5c)
This commit is contained in:
Crash Cringle
2024-02-25 09:36:11 -08:00
committed by teejusb
parent ec33a08ca5
commit 24876804ef
9 changed files with 89 additions and 3 deletions
+19 -1
View File
@@ -544,6 +544,8 @@ void MusicWheel::BuildWheelItemDatas( std::vector<MusicWheelItemData *> &arrayWh
case SORT_BPM:
case SORT_POPULARITY:
case SORT_TOP_GRADES:
case SORT_TOP_GRADES_P1:
case SORT_TOP_GRADES_P2:
case SORT_ARTIST:
case SORT_GENRE:
case SORT_BEGINNER_METER:
@@ -600,7 +602,21 @@ void MusicWheel::BuildWheelItemDatas( std::vector<MusicWheelItemData *> &arrayWh
bUseSections = false;
break;
case SORT_TOP_GRADES:
SongUtil::SortSongPointerArrayByGrades( arraySongs, true );
SongUtil::SortSongPointerArrayByGrades( arraySongs, true );
break;
case SORT_TOP_GRADES_P1:
// Check if master player profile is persistent
if( PROFILEMAN->IsPersistentProfile(PLAYER_1) )
SongUtil::SortSongPointerArrayByProfileGrades( arraySongs, true, PLAYER_1);
else
SongUtil::SortSongPointerArrayByGrades( arraySongs, true );
break;
case SORT_TOP_GRADES_P2:
if( PROFILEMAN->IsPersistentProfile(PLAYER_2) )
SongUtil::SortSongPointerArrayByProfileGrades( arraySongs, true, PLAYER_2);
else
SongUtil::SortSongPointerArrayByGrades( arraySongs, true );
break;
case SORT_ARTIST:
SongUtil::SortSongPointerArrayByArtist( arraySongs );
@@ -665,6 +681,8 @@ void MusicWheel::BuildWheelItemDatas( std::vector<MusicWheelItemData *> &arrayWh
{
case SORT_PREFERRED:
case SORT_TOP_GRADES:
case SORT_TOP_GRADES_P1:
case SORT_TOP_GRADES_P2:
case SORT_BPM:
case SORT_LENGTH:
break; // don't sort by section