add pref PreferredSortUsesGroups
This commit is contained in:
@@ -498,7 +498,9 @@ void MusicWheel::BuildWheelItemDatas( vector<WheelItemData> &arrayWheelItemDatas
|
||||
{
|
||||
case SORT_PREFERRED:
|
||||
case SORT_ROULETTE:
|
||||
SongUtil::SortSongPointerArrayByGroupAndDifficulty( arraySongs );
|
||||
SongUtil::SortSongPointerArrayByMeter( arraySongs, DIFFICULTY_EASY );
|
||||
if( (bool)PREFSMAN->m_bPreferredSortUsesGroups )
|
||||
stable_sort( arraySongs.begin(), arraySongs.end(), SongUtil::CompareSongPointersByGroup );
|
||||
bUseSections = false;
|
||||
break;
|
||||
case SORT_GROUP:
|
||||
|
||||
@@ -242,7 +242,8 @@ PrefsManager::PrefsManager() :
|
||||
m_iMaxRecentScoresForMachine ( Options, "MaxRecentScoresForMachine", 100 ),
|
||||
m_iMaxRecentScoresForPlayer ( Options, "MaxRecentScoresForPlayer", 20 ),
|
||||
m_bAllowMultipleHighScoreWithSameName ( Options, "AllowMultipleHighScoreWithSameName", true ),
|
||||
m_bCelShadeModels ( Options, "CelShadeModels", false ) // Work-In-Progress.. disable by default.
|
||||
m_bCelShadeModels ( Options, "CelShadeModels", false ), // Work-In-Progress.. disable by default.
|
||||
m_bPreferredSortUsesGroups ( Options, "PreferredSortUsesGroups", true )
|
||||
{
|
||||
Init();
|
||||
ReadGlobalPrefsFromDisk();
|
||||
|
||||
@@ -225,6 +225,7 @@ public:
|
||||
Preference<int> m_iMaxRecentScoresForPlayer;
|
||||
Preference<bool> m_bAllowMultipleHighScoreWithSameName;
|
||||
Preference<bool> m_bCelShadeModels;
|
||||
Preference<bool> m_bPreferredSortUsesGroups;
|
||||
|
||||
/* experimental: force a specific update rate. This prevents big
|
||||
* animation jumps on frame skips. */
|
||||
|
||||
@@ -163,17 +163,11 @@ void SongUtil::SortSongPointerArrayByGenre( vector<Song*> &vpSongsInOut )
|
||||
stable_sort( vpSongsInOut.begin(), vpSongsInOut.end(), CompareSongPointersByGenre );
|
||||
}
|
||||
|
||||
static int CompareSongPointersByGroup(const Song *pSong1, const Song *pSong2)
|
||||
int SongUtil::CompareSongPointersByGroup(const Song *pSong1, const Song *pSong2)
|
||||
{
|
||||
return pSong1->m_sGroupName < pSong2->m_sGroupName;
|
||||
}
|
||||
|
||||
void SongUtil::SortSongPointerArrayByGroupAndDifficulty( vector<Song*> &vpSongsInOut )
|
||||
{
|
||||
SortSongPointerArrayByMeter( vpSongsInOut, DIFFICULTY_EASY );
|
||||
stable_sort( vpSongsInOut.begin(), vpSongsInOut.end(), CompareSongPointersByGroup );
|
||||
}
|
||||
|
||||
int CompareSongPointersByGroupAndTitle(const Song *pSong1, const Song *pSong2)
|
||||
{
|
||||
const CString &sGroup1 = pSong1->m_sGroupName;
|
||||
|
||||
@@ -19,7 +19,6 @@ namespace SongUtil
|
||||
void SortSongPointerArrayByArtist( vector<Song*> &vpSongsInOut );
|
||||
void SortSongPointerArrayByDisplayArtist( vector<Song*> &vpSongsInOut );
|
||||
void SortSongPointerArrayByGenre( vector<Song*> &vpSongsInOut );
|
||||
void SortSongPointerArrayByGroupAndDifficulty( vector<Song*> &vpSongsInOut );
|
||||
void SortSongPointerArrayByGroupAndTitle( vector<Song*> &vpSongsInOut );
|
||||
void SortSongPointerArrayByNumPlays( vector<Song*> &vpSongsInOut, ProfileSlot slot, bool bDescending );
|
||||
void SortSongPointerArrayByNumPlays( vector<Song*> &vpSongsInOut, const Profile* pProfile, bool bDescending );
|
||||
@@ -27,6 +26,8 @@ namespace SongUtil
|
||||
CString GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so );
|
||||
void SortSongPointerArrayBySectionName( vector<Song*> &vpSongsInOut, SortOrder so );
|
||||
void SortByMostRecentlyPlayedForMachine( vector<Song*> &vpSongsInOut );
|
||||
|
||||
int CompareSongPointersByGroup(const Song *pSong1, const Song *pSong2);
|
||||
}
|
||||
|
||||
class SongID
|
||||
|
||||
Reference in New Issue
Block a user