add pref SubSortByNumSteps
This commit is contained in:
@@ -203,6 +203,7 @@ void PrefsManager::Init()
|
||||
// default to old sort order
|
||||
m_iCourseSortOrder = COURSE_SORT_SONGS;
|
||||
m_bMoveRandomToEnd = false;
|
||||
m_bSubSortByNumSteps = false;
|
||||
m_iScoringType = SCORING_MAX2;
|
||||
|
||||
m_iGetRankingName = RANKING_ON;
|
||||
@@ -487,6 +488,7 @@ void PrefsManager::ReadPrefsFromFile( CString sIni )
|
||||
|
||||
ini.GetValue( "Options", "CourseSortOrder", (int&)m_iCourseSortOrder );
|
||||
ini.GetValue( "Options", "MoveRandomToEnd", m_bMoveRandomToEnd );
|
||||
ini.GetValue( "Options", "SubSortByNumSteps", m_bSubSortByNumSteps );
|
||||
|
||||
ini.GetValue( "Options", "ScoringType", (int&)m_iScoringType );
|
||||
|
||||
@@ -506,7 +508,7 @@ void PrefsManager::ReadPrefsFromFile( CString sIni )
|
||||
#endif
|
||||
ini.GetValue( "Options", "CoursesToShowRanking", m_sCoursesToShowRanking );
|
||||
ini.GetValue( "Options", "GetRankingName", (int&)m_iGetRankingName);
|
||||
ini.GetValue( "Options", "SmoothLines", m_bSmoothLines );
|
||||
ini.GetValue( "Options", "SmoothLines", m_bSmoothLines );
|
||||
ini.GetValue( "Options", "GlobalOffsetSeconds", m_fGlobalOffsetSeconds );
|
||||
ini.GetValue( "Options", "ShowBeginnerHelper", m_bShowBeginnerHelper );
|
||||
ini.GetValue( "Options", "Language", m_sLanguage );
|
||||
@@ -726,11 +728,12 @@ void PrefsManager::SaveGlobalPrefsToDisk() const
|
||||
#endif
|
||||
ini.SetValue( "Options", "CoursesToShowRanking", m_sCoursesToShowRanking );
|
||||
ini.SetValue( "Options", "GetRankingName", m_iGetRankingName);
|
||||
ini.SetValue( "Options", "SmoothLines", m_bSmoothLines );
|
||||
ini.SetValue( "Options", "SmoothLines", m_bSmoothLines );
|
||||
ini.SetValue( "Options", "GlobalOffsetSeconds", m_fGlobalOffsetSeconds );
|
||||
|
||||
ini.SetValue( "Options", "CourseSortOrder", m_iCourseSortOrder );
|
||||
ini.SetValue( "Options", "MoveRandomToEnd", m_bMoveRandomToEnd );
|
||||
ini.SetValue( "Options", "SubSortByNumSteps", m_bSubSortByNumSteps );
|
||||
|
||||
ini.SetValue( "Options", "ScoringType", m_iScoringType );
|
||||
|
||||
|
||||
@@ -225,6 +225,7 @@ public:
|
||||
// course ranking
|
||||
enum CourseSortOrders { COURSE_SORT_SONGS, COURSE_SORT_METER, COURSE_SORT_METER_SUM, COURSE_SORT_RANK } m_iCourseSortOrder;
|
||||
bool m_bMoveRandomToEnd;
|
||||
bool m_bSubSortByNumSteps;
|
||||
enum GetRankingName { RANKING_OFF, RANKING_ON, RANKING_LIST } m_iGetRankingName;
|
||||
|
||||
// scoring type; SCORING_MAX2 should always be first
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "PrefsManager.h"
|
||||
#include "SongManager.h"
|
||||
#include "XmlFile.h"
|
||||
#include "PrefsManager.h"
|
||||
|
||||
|
||||
/////////////////////////////////////
|
||||
@@ -350,7 +351,10 @@ void SongUtil::SortSongPointerArrayByMeter( vector<Song*> &arraySongPointers, Di
|
||||
for(unsigned i = 0; i < arraySongPointers.size(); ++i)
|
||||
{
|
||||
Steps* pSteps = arraySongPointers[i]->GetStepsByDifficulty( GAMESTATE->GetCurrentStyleDef()->m_StepsType, dc );
|
||||
song_sort_val[arraySongPointers[i]] = ssprintf("%i", pSteps ? pSteps->GetMeter() : 0);
|
||||
CString &s = song_sort_val[arraySongPointers[i]];
|
||||
s = ssprintf("%03d", pSteps ? pSteps->GetMeter() : 0);
|
||||
if( PREFSMAN->m_bSubSortByNumSteps )
|
||||
s += ssprintf("%06.0f",pSteps ? pSteps->GetRadarValues().value[RADAR_NUM_TAPS_AND_HOLDS] : 0);
|
||||
}
|
||||
stable_sort( arraySongPointers.begin(), arraySongPointers.end(), CompareSongPointersBySortValueAscending );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user