don't hard-code course colors
This commit is contained in:
@@ -4656,3 +4656,12 @@ FooterLink=http://www.stepmania.com
|
|||||||
[RadarValues]
|
[RadarValues]
|
||||||
WriteComplexValues=1
|
WriteComplexValues=1
|
||||||
WriteSimpleValues=1
|
WriteSimpleValues=1
|
||||||
|
|
||||||
|
[Course]
|
||||||
|
SortLevel1Color=1,0,0,1
|
||||||
|
SortLevel2Color=1,1,0,1
|
||||||
|
SortLevel3Color=1,0.5,0,1
|
||||||
|
SortLevel4Color=1,1,0,1
|
||||||
|
SortLevel5Color=0,1,0,1
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+24
-34
@@ -26,6 +26,12 @@ const int COURSE_DIFFICULTY_CLASS_CHANGE[NUM_DIFFICULTIES] = { -1, -1, 0, 1, 1 }
|
|||||||
/* Maximum lower value of ranges when difficult: */
|
/* Maximum lower value of ranges when difficult: */
|
||||||
const int MAX_BOTTOM_RANGE = 10;
|
const int MAX_BOTTOM_RANGE = 10;
|
||||||
|
|
||||||
|
#define SORT_LEVEL1_COLOR THEME->GetMetricC("Course","SortLevel1Color")
|
||||||
|
#define SORT_LEVEL2_COLOR THEME->GetMetricC("Course","SortLevel2Color")
|
||||||
|
#define SORT_LEVEL3_COLOR THEME->GetMetricC("Course","SortLevel3Color")
|
||||||
|
#define SORT_LEVEL4_COLOR THEME->GetMetricC("Course","SortLevel4Color")
|
||||||
|
#define SORT_LEVEL5_COLOR THEME->GetMetricC("Course","SortLevel5Color")
|
||||||
|
|
||||||
|
|
||||||
Course::Course()
|
Course::Course()
|
||||||
{
|
{
|
||||||
@@ -972,51 +978,35 @@ void Course::RegenerateNonFixedTrails()
|
|||||||
|
|
||||||
RageColor Course::GetColor() const
|
RageColor Course::GetColor() const
|
||||||
{
|
{
|
||||||
// FIXME: These colors shouldn't be hard-coded
|
// FIXME: Calculate the meter.
|
||||||
int iMeter = 5;
|
int iMeter = 5;
|
||||||
|
|
||||||
switch (PREFSMAN->m_iCourseSortOrder)
|
switch (PREFSMAN->m_iCourseSortOrder)
|
||||||
{
|
{
|
||||||
case PrefsManager::COURSE_SORT_SONGS:
|
case PrefsManager::COURSE_SORT_SONGS:
|
||||||
if( m_entries.size() >= 7 )
|
if( m_entries.size() >= 7 ) return SORT_LEVEL2_COLOR;
|
||||||
return RageColor(1,0,0,1); // red
|
else if( m_entries.size() >= 4 ) return SORT_LEVEL4_COLOR;
|
||||||
else if( m_entries.size() >= 4 )
|
else return SORT_LEVEL5_COLOR;
|
||||||
return RageColor(1,1,0,1); // yellow
|
|
||||||
else
|
|
||||||
return RageColor(0,1,0,1); // green
|
|
||||||
// never should get here
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PrefsManager::COURSE_SORT_METER:
|
case PrefsManager::COURSE_SORT_METER:
|
||||||
if ( !IsFixed() )
|
if ( !IsFixed() ) return SORT_LEVEL1_COLOR;
|
||||||
return RageColor(0,0,1,1); // blue
|
else if (iMeter > 9) return SORT_LEVEL2_COLOR;
|
||||||
if (iMeter > 8.5)
|
else if (iMeter >= 7) return SORT_LEVEL3_COLOR;
|
||||||
return RageColor(1,0,0,1); // red
|
else if (iMeter >= 5) return SORT_LEVEL4_COLOR;
|
||||||
if (iMeter >= 7)
|
else return SORT_LEVEL5_COLOR;
|
||||||
return RageColor(1,0.5f,0,1); // orange
|
|
||||||
if (iMeter >= 5)
|
|
||||||
return RageColor(1,1,0,1); // yellow
|
|
||||||
return RageColor(0,1,0,1); // green
|
|
||||||
|
|
||||||
case PrefsManager::COURSE_SORT_METER_SUM:
|
case PrefsManager::COURSE_SORT_METER_SUM:
|
||||||
if ( !IsFixed() )
|
if ( !IsFixed() ) return SORT_LEVEL1_COLOR;
|
||||||
return RageColor(0,0,1,1); // blue
|
if (m_SortOrder_TotalDifficulty >= 40) return SORT_LEVEL2_COLOR;
|
||||||
if (m_SortOrder_TotalDifficulty >= 40)
|
if (m_SortOrder_TotalDifficulty >= 30) return SORT_LEVEL3_COLOR;
|
||||||
return RageColor(1,0,0,1); // red
|
if (m_SortOrder_TotalDifficulty >= 20) return SORT_LEVEL4_COLOR;
|
||||||
if (m_SortOrder_TotalDifficulty >= 30)
|
else return SORT_LEVEL5_COLOR;
|
||||||
return RageColor(1,0.5f,0,1); // orange
|
|
||||||
if (m_SortOrder_TotalDifficulty >= 20)
|
|
||||||
return RageColor(1,1,0,1); // yellow
|
|
||||||
return RageColor(0,1,0,1); // green
|
|
||||||
|
|
||||||
case PrefsManager::COURSE_SORT_RANK:
|
case PrefsManager::COURSE_SORT_RANK:
|
||||||
if (m_SortOrder_Ranking == 3)
|
if (m_SortOrder_Ranking == 3) return SORT_LEVEL1_COLOR;
|
||||||
return RageColor(0,0,1,1); // blue
|
else if (m_SortOrder_Ranking == 2) return SORT_LEVEL3_COLOR;
|
||||||
if (m_SortOrder_Ranking == 2)
|
else if (m_SortOrder_Ranking == 1) return SORT_LEVEL5_COLOR;
|
||||||
return RageColor(1,0.5f,0,1); // orange
|
else return SORT_LEVEL4_COLOR;
|
||||||
if (m_SortOrder_Ranking == 1)
|
|
||||||
return RageColor(0,1,0,1); // green
|
|
||||||
return RageColor(1,1,0,1); // yellow, never should get here
|
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
ASSERT(0);
|
||||||
return RageColor(1,1,1,1); // white, never should reach here
|
return RageColor(1,1,1,1); // white, never should reach here
|
||||||
|
|||||||
Reference in New Issue
Block a user