Fix crash from MusicWheel when in BuildWheelItemData(), and under case SORT_ENDLESS_COURSES. Automatically generated courses will cause there to be no group name, and the default (preferred) sort. When this function does not return a value, and it gets assigned to c (In MusicWheel), in some cases we will get a crash.
By default, I use white in the metrics, this doesn't look "great," but it should be up to the themer.
This commit is contained in:
@@ -4365,6 +4365,7 @@ WriteSimpleValues=1
|
||||
TapsAndHolds=1
|
||||
|
||||
[Course]
|
||||
SortPreferredColor=1,1,1,1 //Preferred is both for when courses are in preferred sort, or are autogen
|
||||
SortLevel1Color=1,0,0,1
|
||||
SortLevel2Color=1,1,0,1
|
||||
SortLevel3Color=1,0.5,0,1
|
||||
|
||||
@@ -51,6 +51,7 @@ XToLocalizedString( SongSort );
|
||||
/* Maximum lower value of ranges when difficult: */
|
||||
const int MAX_BOTTOM_RANGE = 10;
|
||||
|
||||
#define SORT_PREFERRED_COLOR THEME->GetMetricC("Course","SortPreferredColor")
|
||||
#define SORT_LEVEL1_COLOR THEME->GetMetricC("Course","SortLevel1Color")
|
||||
#define SORT_LEVEL2_COLOR THEME->GetMetricC("Course","SortLevel2Color")
|
||||
#define SORT_LEVEL3_COLOR THEME->GetMetricC("Course","SortLevel3Color")
|
||||
@@ -729,7 +730,8 @@ RageColor Course::GetColor() const
|
||||
switch( PREFSMAN->m_CourseSortOrder )
|
||||
{
|
||||
case PrefsManager::COURSE_SORT_PREFERRED:
|
||||
break;
|
||||
return SORT_PREFERRED_COLOR; //This will also be used for autogen'd courses in some cases.
|
||||
|
||||
case PrefsManager::COURSE_SORT_SONGS:
|
||||
if( m_vEntries.size() >= 7 ) return SORT_LEVEL2_COLOR;
|
||||
else if( m_vEntries.size() >= 4 ) return SORT_LEVEL4_COLOR;
|
||||
|
||||
Reference in New Issue
Block a user