metrics cleaup: Remove duplicated "ToShow" and "ToHide" parsing logic

don't show hidden StepsTypes in EditMenu
This commit is contained in:
Chris Danford
2005-03-24 21:44:03 +00:00
parent e1ab8c5b77
commit 5d8456e3ea
12 changed files with 313 additions and 350 deletions
+1 -32
View File
@@ -9,6 +9,7 @@ DefaultCpuModifiers=
JoinPauseSeconds=0.8
DifficultiesToShow=beginner,easy,medium,hard,challenge
CourseDifficultiesToShow=easy,regular,difficult
StepsTypesToHide=dance-couple,dance-solo,pump-halfdouble,lights-cabinet
ScreenWidth=640
ScreenHeight=480
OverlayScreens=ScreenSystemLayer
@@ -3323,7 +3324,6 @@ Class=ScreenRanking
Fallback=ScreenAttract
NextScreen=ScreenUnlock
TimerSeconds=-1
StepsTypesToHide=dance-couple,dance-solo,pump-halfdouble
ShowCategories=1
CoursesToShow=Courses/DDRMAX/NaokiStandard.crs,Courses/DDRMAX/ParanoiaBrothers.crs,Courses/Samples/PlayersBest1-4.crs
@@ -4237,34 +4237,6 @@ ShowStyleDouble=1
ShowStyleCouple=1
ShowStyleSolo=1
ShowStyleReal=1
ShowStepsTypeDance-single=1
ShowStepsTypeDance-double=1
ShowStepsTypeDance-couple=1
ShowStepsTypeDance-solo=1
ShowStepsTypePump-single=1
ShowStepsTypePump-halfdouble=1
ShowStepsTypePump-double=1
ShowStepsTypePump-couple=1
ShowStepsTypeEz2-single=1
ShowStepsTypeEz2-double=1
ShowStepsTypeEz2-real=1
ShowStepsTypePara-single=1
ShowStepsTypePara-versus=1
ShowStepsTypeDs3ddx-single=1
ShowStepsTypeBm-single5=1
ShowStepsTypeBm-double5=1
ShowStepsTypeBm-single7=1
ShowStepsTypeBm-double7=1
ShowStepsTypeManiax-single=1
ShowStepsTypeManiax-double=1
ShowStepsTypeTechno-single4=1
ShowStepsTypeTechno-single5=1
ShowStepsTypeTechno-single8=1
ShowStepsTypeTechno-double4=1
ShowStepsTypeTechno-double5=1
ShowStepsTypePnm-five=1
ShowStepsTypePnm-nine=1
ShowStepsTypeLights-cabinet=1
InternetRankingHomeUrl=
InternetRankingUploadUrl=
InternetRankingViewGuidUrl=
@@ -4286,9 +4258,6 @@ SortLevel5Color=0,1,0,1
[Inventory]
ItemUseRateSeconds=0
[OptionRowHandler]
StepsTypesToHide=
[ScreenMemcardSaveEditsAfterDeleteSteps]
[ScreenMemcardSaveEditsAfterSave]
+14 -29
View File
@@ -22,7 +22,6 @@
#define SHOW_PLAY_MODE(pm) THEME->GetMetricB("CatalogXml",ssprintf("ShowPlayMode%s",PlayModeToString(pm).c_str()))
#define SHOW_STYLE(ps) THEME->GetMetricB("CatalogXml",ssprintf("ShowStyle%s",Capitalize((ps)->m_szName).c_str()))
#define SHOW_STEPS_TYPE(st) THEME->GetMetricB("CatalogXml",ssprintf("ShowStepsType%s",Capitalize(GAMEMAN->StepsTypeToString(st)).c_str()))
#define INTERNET_RANKING_HOME_URL THEME->GetMetric ("CatalogXml","InternetRankingHomeUrl")
#define INTERNET_RANKING_UPLOAD_URL THEME->GetMetric ("CatalogXml","InternetRankingUploadUrl")
#define INTERNET_RANKING_VIEW_GUID_URL THEME->GetMetric ("CatalogXml","InternetRankingViewGuidUrl")
@@ -39,11 +38,9 @@ void SaveCatalogXml()
XNode xml;
xml.m_sName = "Catalog";
{
bool ShowStepsType[NUM_STEPS_TYPES];
FOREACH_StepsType( st )
ShowStepsType[st] = SHOW_STEPS_TYPE( st );
const vector<StepsType> &vStepsTypesToShow = STEPS_TYPES_TO_SHOW.GetValue();
{
XNode* pNode = xml.AppendChild( "Songs" );
vector<Song*> vpSongs = SONGMAN->GetAllSongs();
@@ -64,16 +61,11 @@ void SaveCatalogXml()
pSongNode->AppendChild( "MainTitle", pSong->GetDisplayMainTitle() );
pSongNode->AppendChild( "SubTitle", pSong->GetDisplaySubTitle() );
const set<Difficulty> &vDiffs = CommonMetrics::GetDifficultiesToShow();
FOREACH_StepsType( st )
FOREACH_CONST( StepsType, vStepsTypesToShow, st )
{
if( !ShowStepsType[st] )
continue; // skip
for( set<Difficulty>::const_iterator iter = vDiffs.begin(); iter != vDiffs.end(); iter++ )
FOREACH_CONST( Difficulty, DIFFICULTIES_TO_SHOW.GetValue(), dc )
{
Steps* pSteps = pSong->GetStepsByDifficulty( st, *iter, false ); // no autogen
Steps* pSteps = pSong->GetStepsByDifficulty( *st, *dc, false ); // no autogen
if( pSteps == NULL )
continue; // skip
@@ -111,16 +103,13 @@ void SaveCatalogXml()
pCourseNode->AppendChild( "SubTitle", pCourse->GetDisplaySubTitle() );
pCourseNode->AppendChild( "HasMods", pCourse->HasMods() );
const set<CourseDifficulty> &vDiffs = CommonMetrics::GetCourseDifficultiesToShow();
const vector<CourseDifficulty> &vDiffs = DIFFICULTIES_TO_SHOW.GetValue();
FOREACH_StepsType( st )
FOREACH_CONST( StepsType, vStepsTypesToShow, st )
{
if( !SHOW_STEPS_TYPE(st) )
continue; // skip
for( set<CourseDifficulty>::const_iterator iter = vDiffs.begin(); iter != vDiffs.end(); iter++ )
FOREACH_CONST( CourseDifficulty, vDiffs, dc )
{
Trail *pTrail = pCourse->GetTrail( st, *iter );
Trail *pTrail = pCourse->GetTrail( *st, *dc );
if( pTrail == NULL )
continue;
if( !pTrail->m_vEntries.size() )
@@ -143,8 +132,7 @@ void SaveCatalogXml()
XNode* pNode = xml.AppendChild( "Types" );
{
const set<Difficulty> &vDiffs = CommonMetrics::GetDifficultiesToShow();
FOREACHS_CONST( Difficulty, vDiffs, iter )
FOREACH_CONST( Difficulty, DIFFICULTIES_TO_SHOW.GetValue(), iter )
{
XNode* pNode2 = pNode->AppendChild( "Difficulty", DifficultyToString(*iter) );
pNode2->AppendAttr( "DisplayAs", DifficultyToThemedString(*iter) );
@@ -152,8 +140,7 @@ void SaveCatalogXml()
}
{
const set<CourseDifficulty> &vDiffs = CommonMetrics::GetCourseDifficultiesToShow();
FOREACHS_CONST( CourseDifficulty, vDiffs, iter )
FOREACH_CONST( CourseDifficulty, COURSE_DIFFICULTIES_TO_SHOW.GetValue(), iter )
{
XNode* pNode2 = pNode->AppendChild( "CourseDifficulty", CourseDifficultyToString(*iter) );
pNode2->AppendAttr( "DisplayAs", CourseDifficultyToThemedString(*iter) );
@@ -161,12 +148,10 @@ void SaveCatalogXml()
}
{
vector<StepsType> vStepsTypes;
GAMEMAN->GetStepsTypesForGame( GAMESTATE->m_pCurGame, vStepsTypes );
FOREACH_CONST( StepsType, vStepsTypes, iter )
vector<StepsType> vStepsTypesToShow;
GAMEMAN->GetStepsTypesForGame( GAMESTATE->m_pCurGame, vStepsTypesToShow );
FOREACH_CONST( StepsType, vStepsTypesToShow, iter )
{
if( !SHOW_STEPS_TYPE(*iter) )
continue;
XNode* pNode2 = pNode->AppendChild( "StepsType", GAMEMAN->StepsTypeToString(*iter) );
pNode2->AppendAttr( "DisplayAs", GAMEMAN->StepsTypeToThemedString(*iter) );
}
+87 -51
View File
@@ -2,6 +2,9 @@
#include "CommonMetrics.h"
#include "RageUtil.h"
#include "Foreach.h"
#include "GameManager.h"
#include "RageLog.h"
#include "GameState.h"
CString PLAYER_COLOR_NAME( size_t p ) { return ssprintf("ColorP%d",int(p+1)); }
@@ -16,64 +19,97 @@ ThemeMetric<CString> WINDOW_TITLE ("Common","WindowTitle");
ThemeMetric<bool> HOME_EDIT_MODE ("Common","HomeEditMode");
ThemeMetric<int> MAX_COURSE_ENTRIES_BEFORE_VARIOUS ("Common","MaxCourseEntriesBeforeShowVarious");
ThemeMetric<float> TICK_EARLY_SECONDS ("ScreenGameplay","TickEarlySeconds");
ThemeMetricDifficultiesToShow DIFFICULTIES_TO_SHOW ("Common","DifficultiesToShow");
ThemeMetricCourseDifficultiesToShow COURSE_DIFFICULTIES_TO_SHOW ("Common","CourseDifficultiesToShow");
ThemeMetricStepsTypesToShow STEPS_TYPES_TO_SHOW ("Common","StepsTypesToHide");
class ThemeMetricDifficultiesToShow : ThemeMetric<CString>
ThemeMetricDifficultiesToShow::ThemeMetricDifficultiesToShow( const CString& sGroup, const CString& sName ) :
ThemeMetric<CString>(sGroup,sName)
{
public:
set<Difficulty> m_v;
ThemeMetricDifficultiesToShow() : ThemeMetric<CString>("Common","DifficultiesToShow") {}
void Read()
{
ThemeMetric<CString>::Read();
m_v.clear();
CStringArray v;
split( GetValue(), ",", v );
ASSERT( v.size() > 0 );
FOREACH_CONST( CString, v, i )
{
Difficulty d = StringToDifficulty( *i );
if( d == DIFFICULTY_INVALID )
RageException::Throw( "Unknown difficulty \"%s\" in CourseDifficultiesToShow", i->c_str() );
m_v.insert( d );
}
}
};
ThemeMetricDifficultiesToShow DIFFICULTIES_TO_SHOW;
const set<Difficulty>& CommonMetrics::GetDifficultiesToShow() { return DIFFICULTIES_TO_SHOW.m_v; }
class ThemeMetricCourseDifficultiesToShow : ThemeMetric<CString>
ASSERT( sName.Right(6) == "ToShow" );
}
void ThemeMetricDifficultiesToShow::Read()
{
public:
set<CourseDifficulty> m_v;
ThemeMetric<CString>::Read();
ThemeMetricCourseDifficultiesToShow() : ThemeMetric<CString>("Common","CourseDifficultiesToShow") {}
void Read()
m_v.clear();
CStringArray v;
split( ThemeMetric<CString>::GetValue(), ",", v );
ASSERT( v.size() > 0 );
FOREACH_CONST( CString, v, i )
{
ThemeMetric<CString>::Read();
m_v.clear();
CStringArray v;
split( GetValue(), ",", v );
ASSERT( v.size() > 0 );
FOREACH_CONST( CString, v, i )
{
CourseDifficulty d = StringToCourseDifficulty( *i );
if( d == DIFFICULTY_INVALID )
RageException::Throw( "Unknown CourseDifficulty \"%s\" in CourseDifficultiesToShow", i->c_str() );
m_v.insert( d );
}
Difficulty d = StringToDifficulty( *i );
if( d == DIFFICULTY_INVALID )
RageException::Throw( "Unknown difficulty \"%s\" in CourseDifficultiesToShow", i->c_str() );
m_v.push_back( d );
}
};
ThemeMetricCourseDifficultiesToShow COURSE_DIFFICULTIES_TO_SHOW;
const set<CourseDifficulty>& CommonMetrics::GetCourseDifficultiesToShow() { return COURSE_DIFFICULTIES_TO_SHOW.m_v; }
}
const vector<Difficulty>& ThemeMetricDifficultiesToShow::GetValue() { return m_v; }
ThemeMetricCourseDifficultiesToShow::ThemeMetricCourseDifficultiesToShow( const CString& sGroup, const CString& sName ) :
ThemeMetric<CString>(sGroup,sName)
{
ASSERT( sName.Right(6) == "ToShow" );
}
void ThemeMetricCourseDifficultiesToShow::Read()
{
ThemeMetric<CString>::Read();
m_v.clear();
CStringArray v;
split( ThemeMetric<CString>::GetValue(), ",", v );
ASSERT( v.size() > 0 );
FOREACH_CONST( CString, v, i )
{
CourseDifficulty d = StringToCourseDifficulty( *i );
if( d == DIFFICULTY_INVALID )
RageException::Throw( "Unknown CourseDifficulty \"%s\" in CourseDifficultiesToShow", i->c_str() );
m_v.push_back( d );
}
}
const vector<CourseDifficulty>& ThemeMetricCourseDifficultiesToShow::GetValue() { return m_v; }
static void RemoveStepsTypes( vector<StepsType>& inout, CString sStepsTypesToRemove )
{
CStringArray v;
split( sStepsTypesToRemove, ",", v );
ASSERT( v.size() > 0 );
// subtract StepsTypes
FOREACH_CONST( CString, v, i )
{
StepsType st = GameManager::StringToStepsType(*i);
if( st == STEPS_TYPE_INVALID )
LOG->Warn( "Invalid StepsType value '%s' in '%s'", i->c_str(), sStepsTypesToRemove.c_str() );
const vector<StepsType>::iterator iter = find( inout.begin(), inout.end(), st );
if( iter != inout.end() )
inout.erase( iter );
}
}
ThemeMetricStepsTypesToShow::ThemeMetricStepsTypesToShow( const CString& sGroup, const CString& sName ) :
ThemeMetric<CString>(sGroup,sName)
{
ASSERT( sName.Right(6) == "ToHide" );
}
void ThemeMetricStepsTypesToShow::Read()
{
ThemeMetric<CString>::Read();
m_v.clear();
GAMEMAN->GetStepsTypesForGame( GAMESTATE->m_pCurGame, m_v );
RemoveStepsTypes( m_v, ThemeMetric<CString>::GetValue() );
}
const vector<StepsType>& ThemeMetricStepsTypesToShow::GetValue() { return m_v; }
CString THEME_OPTION_ITEM( CString s, bool bOptional )
{
+40 -5
View File
@@ -6,7 +6,44 @@
#include "ThemeMetric.h"
#include "PlayerNumber.h"
#include "Difficulty.h"
#include "GameConstantsAndTypes.h"
//
// Types
//
class ThemeMetricDifficultiesToShow : ThemeMetric<CString>
{
public:
ThemeMetricDifficultiesToShow( const CString& sGroup, const CString& sName );
void Read();
const vector<Difficulty> &GetValue();
private:
vector<Difficulty> m_v;
};
class ThemeMetricCourseDifficultiesToShow : ThemeMetric<CString>
{
public:
ThemeMetricCourseDifficultiesToShow( const CString& sGroup, const CString& sName );
void Read();
const vector<CourseDifficulty> &GetValue();
private:
vector<CourseDifficulty> m_v;
};
class ThemeMetricStepsTypesToShow : ThemeMetric<CString>
{
public:
ThemeMetricStepsTypesToShow( const CString& sGroup, const CString& sName );
void Read();
const vector<StepsType> &GetValue();
private:
vector<StepsType> m_v;
};
//
// Metrics
//
extern ThemeMetric<CString> INITIAL_SCREEN;
extern ThemeMetric<CString> FIRST_RUN_INITIAL_SCREEN;
extern ThemeMetric<CString> DEFAULT_MODIFIERS;
@@ -17,14 +54,12 @@ extern ThemeMetric<CString> WINDOW_TITLE;
extern ThemeMetric<bool> HOME_EDIT_MODE;
extern ThemeMetric<int> MAX_COURSE_ENTRIES_BEFORE_VARIOUS;
extern ThemeMetric<float> TICK_EARLY_SECONDS;
extern ThemeMetricDifficultiesToShow DIFFICULTIES_TO_SHOW;
extern ThemeMetricCourseDifficultiesToShow COURSE_DIFFICULTIES_TO_SHOW;
extern ThemeMetricStepsTypesToShow STEPS_TYPES_TO_SHOW;
CString THEME_OPTION_ITEM( CString s, bool bOptional );
namespace CommonMetrics
{
const set<Difficulty>& GetDifficultiesToShow();
const set<CourseDifficulty>& GetCourseDifficultiesToShow();
}
#endif
+1 -2
View File
@@ -286,9 +286,8 @@ void DifficultyList::SetFromGameState()
// FIXME: This clamps to between the min and the max difficulty, but
// it really should round to the nearest difficulty that's in
// DIFFICULTIES_TO_SHOW.
const set<Difficulty> &diffs = CommonMetrics::GetDifficultiesToShow();
unsigned i=0;
FOREACHS_CONST( Difficulty, diffs, d )
FOREACH_CONST( Difficulty, DIFFICULTIES_TO_SHOW.GetValue(), d )
{
m_Rows.resize( m_Rows.size()+1 );
+1 -1
View File
@@ -121,7 +121,7 @@ EditMenu::EditMenu()
// fill in data structures
SONGMAN->GetGroupNames( m_sGroups );
GAMEMAN->GetStepsTypesForGame( GAMESTATE->m_pCurGame, m_StepsTypes );
m_StepsTypes = STEPS_TYPES_TO_SHOW.GetValue();
if( HOME_EDIT_MODE )
{
m_vDifficulties.push_back( DIFFICULTY_EDIT );
+7 -6
View File
@@ -33,6 +33,7 @@
#include "CommonMetrics.h"
#include "Foreach.h"
#include "LuaReference.h"
#include "CommonMetrics.h"
#include <ctime>
#include <set>
@@ -1702,7 +1703,7 @@ bool GameState::ChangePreferredDifficulty( PlayerNumber pn, Difficulty dc )
bool GameState::ChangePreferredDifficulty( PlayerNumber pn, int dir )
{
const set<Difficulty> &asDiff = CommonMetrics::GetDifficultiesToShow();
const vector<Difficulty> &v = DIFFICULTIES_TO_SHOW.GetValue();
Difficulty d = m_PreferredDifficulty[pn];
while( 1 )
@@ -1710,7 +1711,7 @@ bool GameState::ChangePreferredDifficulty( PlayerNumber pn, int dir )
d = (Difficulty)(d+dir);
if( d < 0 || d >= NUM_DIFFICULTIES )
return false;
if( asDiff.find(d) == asDiff.end() )
if( find(v.begin(), v.end(), d) == v.end() )
continue; /* not available */
}
@@ -1734,7 +1735,7 @@ bool GameState::ChangePreferredCourseDifficulty( PlayerNumber pn, int dir )
/* If we have a course selected, only choose among difficulties available in the course. */
const Course *pCourse = this->m_pCurCourse;
const set<CourseDifficulty> &asDiff = CommonMetrics::GetCourseDifficultiesToShow();
const vector<CourseDifficulty> &v = COURSE_DIFFICULTIES_TO_SHOW.GetValue();
CourseDifficulty cd = m_PreferredCourseDifficulty[pn];
while( 1 )
@@ -1742,7 +1743,7 @@ bool GameState::ChangePreferredCourseDifficulty( PlayerNumber pn, int dir )
cd = (CourseDifficulty)(cd+dir);
if( cd < 0 || cd >= NUM_DIFFICULTIES )
return false;
if( asDiff.find(cd) == asDiff.end() )
if( find(v.begin(),v.end(),cd) == v.end() )
continue; /* not available */
if( !pCourse || pCourse->GetTrail( GAMESTATE->GetCurrentStyle()->m_StepsType, cd ) )
break;
@@ -1753,8 +1754,8 @@ bool GameState::ChangePreferredCourseDifficulty( PlayerNumber pn, int dir )
bool GameState::IsCourseDifficultyShown( CourseDifficulty cd )
{
const set<CourseDifficulty> &asDiff = CommonMetrics::GetCourseDifficultiesToShow();
return asDiff.find(cd) != asDiff.end();
const vector<CourseDifficulty> &v = COURSE_DIFFICULTIES_TO_SHOW.GetValue();
return find(v.begin(), v.end(), cd) != v.end();
}
Difficulty GameState::GetEasiestNotesDifficulty() const
+2 -20
View File
@@ -24,8 +24,6 @@
#define ENTRY_MODE(s,i) THEME->GetMetric ("ScreenOptionsMaster",ssprintf("%s,%i",(s).c_str(),(i+1)))
#define ENTRY_DEFAULT(s) THEME->GetMetric ("ScreenOptionsMaster",(s) + "Default")
#define STEPS_TYPES_TO_HIDE THEME->GetMetric ("OptionRowHandler","StepsTypesToHide")
static void SelectExactlyOne( int iSelection, vector<bool> &vbSelectedOut )
{
for( int i=0; i<(int)vbSelectedOut.size(); i++ )
@@ -429,8 +427,6 @@ public:
ASSERT( sParam.size() );
m_sName = sParam;
const set<Difficulty> &vDifficulties = CommonMetrics::GetDifficultiesToShow();
defOut.bOneChoiceForAllPlayers = true;
defOut.name = "Difficulty";
Default.m_dc = DIFFICULTY_INVALID;
@@ -443,7 +439,7 @@ public:
ListEntries.push_back( mc );
}
FOREACHS_CONST( Difficulty, vDifficulties, d )
FOREACH_CONST( Difficulty, DIFFICULTIES_TO_SHOW.GetValue(), d )
{
CString s = DifficultyToThemedString( *d );
@@ -864,21 +860,7 @@ public:
defOut.m_bAllowThemeItems = false; // we theme the text ourself
// calculate which StepsTypes to show
GAMEMAN->GetStepsTypesForGame( GAMESTATE->m_pCurGame, m_vStepsTypesToShow );
// subtract hidden StepsTypes
vector<CString> vsStepsTypesToHide;
split( STEPS_TYPES_TO_HIDE, ",", vsStepsTypesToHide, true );
for( unsigned i=0; i<vsStepsTypesToHide.size(); i++ )
{
StepsType st = GameManager::StringToStepsType(vsStepsTypesToHide[i]);
if( st != STEPS_TYPE_INVALID )
{
const vector<StepsType>::iterator iter = find( m_vStepsTypesToShow.begin(), m_vStepsTypesToShow.end(), st );
if( iter != m_vStepsTypesToShow.end() )
m_vStepsTypesToShow.erase( iter );
}
}
m_vStepsTypesToShow = STEPS_TYPES_TO_SHOW.GetValue();
FOREACH_CONST( StepsType, m_vStepsTypesToShow, st )
{
+2 -4
View File
@@ -84,8 +84,7 @@ CString GetStatsLineValue( PlayerNumber pn, EndingStatsLine line )
if( GAMESTATE->IsCourseMode() )
{
const set<CourseDifficulty> &vDiffs = CommonMetrics::GetCourseDifficultiesToShow();
FOREACHS_CONST( CourseDifficulty, vDiffs, iter )
FOREACH_CONST( CourseDifficulty, COURSE_DIFFICULTIES_TO_SHOW.GetValue(), iter )
{
fActual += pProfile->GetCoursesActual(st,*iter);
fPossible += pProfile->GetCoursesPossible(st,*iter);
@@ -93,8 +92,7 @@ CString GetStatsLineValue( PlayerNumber pn, EndingStatsLine line )
}
else
{
const set<Difficulty> &vDiffs = CommonMetrics::GetDifficultiesToShow();
FOREACHS_CONST( Difficulty, vDiffs, iter )
FOREACH_CONST( Difficulty, DIFFICULTIES_TO_SHOW.GetValue(), iter )
{
fActual += pProfile->GetSongsActual(st,*iter);
fPossible += pProfile->GetSongsPossible(st,*iter);
+6 -13
View File
@@ -18,11 +18,10 @@
#include "PlayerState.h"
#include "ProfileManager.h"
#include "StatsManager.h"
// HACK: This belongs in ScreenDemonstration
#define DIFFICULTIES_TO_SHOW THEME->GetMetric ("ScreenDemonstration","DifficultiesToShow")
#include "CommonMetrics.h"
#define SHOW_COURSE_MODIFIERS THEME->GetMetricB("ScreenJukebox","ShowCourseModifiers")
static ThemeMetricDifficultiesToShow DIFFICULTIES_TO_SHOW_HERE("ScreenDemonstration","DifficultiesToShow");
REGISTER_SCREEN_CLASS( ScreenJukebox );
@@ -41,20 +40,15 @@ bool ScreenJukebox::SetSong( bool bDemonstration )
if ( vSongs.size() == 0 )
SONGMAN->GetSongs( vSongs, GAMESTATE->m_sPreferredSongGroup );
//
// Calculate what difficulties to show
//
CStringArray asBits;
vector<Difficulty> vDifficultiesToShow;
if( bDemonstration )
{
split( DIFFICULTIES_TO_SHOW, ",", asBits );
for( unsigned i=0; i<asBits.size(); i++ )
{
Difficulty dc = StringToDifficulty( asBits[i] );
if( dc != DIFFICULTY_INVALID )
vDifficultiesToShow.push_back( dc );
}
// HACK: This belongs in ScreenDemonstration
vDifficultiesToShow = DIFFICULTIES_TO_SHOW_HERE.GetValue();
}
else
{
@@ -69,8 +63,7 @@ bool ScreenJukebox::SetSong( bool bDemonstration )
}
}
if( vDifficultiesToShow.empty() )
vDifficultiesToShow.push_back( DIFFICULTY_EASY );
ASSERT( !vDifficultiesToShow.empty() )
//
// Search for a Song and Steps to play during the demo
+144 -181
View File
@@ -51,11 +51,12 @@ CString STEPS_TYPE_COLOR_NAME( size_t i ) { return ssprintf("StepsTypeColor%d",i
REGISTER_SCREEN_CLASS( ScreenRanking );
ScreenRanking::ScreenRanking( CString sClassName ) : ScreenAttract( sClassName ),
STEPS_TYPES_TO_HIDE (m_sName,"StepsTypesToHide"),
STEPS_TYPES_TO_SHOW (m_sName,"StepsTypesToHide"),
DIFFICULTIES_TO_SHOW (m_sName,"DifficultiesToShow"),
SHOW_CATEGORIES (m_sName,"ShowCategories"),
SHOW_ALL_STEPS_SCORES (m_sName,"ShowAllStepsScores"),
SHOW_ALL_COURSE_SCORES (m_sName,"ShowAllCourseScores"),
DIFFICULTIES_TO_SHOW (m_sName,"DifficultiesToShow"),
SECONDS_PER_PAGE (m_sName,"SecondsPerPage"),
PAGE_FADE_SECONDS (m_sName,"PageFadeSeconds"),
PERCENT_DECIMAL_PLACES (m_sName,"PercentDecimalPlaces"),
@@ -164,22 +165,12 @@ void ScreenRanking::Init()
}
}
// make the list of difficulties to show
{
vector<CString> sShowDiffs;
split( DIFFICULTIES_TO_SHOW, ",", sShowDiffs, true );
for( vector<CString>::const_iterator iter = sShowDiffs.begin(); iter != sShowDiffs.end(); iter++ )
{
m_vDiffsToShow.push_back( StringToDifficulty( *iter ) );
}
}
// init Actors for all_steps
{
const vector<Difficulty> &v = DIFFICULTIES_TO_SHOW.GetValue();
FOREACH_Difficulty( d )
{
bool bShowThis = find(m_vDiffsToShow.begin(), m_vDiffsToShow.end(), d) != m_vDiffsToShow.end();
bool bShowThis = find( v.begin(), v.end(), d ) != v.end();
if( !bShowThis )
continue; // skip
@@ -273,34 +264,12 @@ void ScreenRanking::Init()
m_ListCourseRowItems.SetXY( SCREEN_CENTER_X, SCREEN_CENTER_Y );
}
// calculate which StepsTypes to show
vector<StepsType> aStepsTypesToShow;
{
GAMEMAN->GetStepsTypesForGame( GAMESTATE->m_pCurGame, aStepsTypesToShow );
// subtract hidden StepsTypes
{
vector<CString> asStepsTypesToHide;
split( STEPS_TYPES_TO_HIDE, ",", asStepsTypesToHide, true );
for( unsigned i=0; i<asStepsTypesToHide.size(); i++ )
{
StepsType st = GameManager::StringToStepsType(asStepsTypesToHide[i]);
if( st != STEPS_TYPE_INVALID )
{
const vector<StepsType>::iterator iter = find( aStepsTypesToShow.begin(), aStepsTypesToShow.end(), st );
if( iter != aStepsTypesToShow.end() )
aStepsTypesToShow.erase( iter );
}
}
}
}
//
// fill m_vPagesToShow
//
if( SHOW_CATEGORIES )
{
for( unsigned i=0; i<aStepsTypesToShow.size(); i++ )
for( unsigned i=0; i<STEPS_TYPES_TO_SHOW.GetValue().size(); i++ )
{
for( int c=0; c<NUM_RANKING_CATEGORIES; c++ )
{
@@ -308,7 +277,7 @@ void ScreenRanking::Init()
pts.type = PAGE_TYPE_CATEGORY;
pts.colorIndex = i;
pts.category = (RankingCategory)c;
pts.nt = aStepsTypesToShow[i];
pts.nt = STEPS_TYPES_TO_SHOW.GetValue()[i];
m_vPagesToShow.push_back( pts );
}
}
@@ -317,14 +286,14 @@ void ScreenRanking::Init()
{
vector<CString> asCoursePaths;
split( COURSES_TO_SHOW, ",", asCoursePaths, true );
for( unsigned i=0; i<aStepsTypesToShow.size(); i++ )
for( unsigned i=0; i<STEPS_TYPES_TO_SHOW.GetValue().size(); i++ )
{
for( unsigned c=0; c<asCoursePaths.size(); c++ )
{
PageToShow pts;
pts.type = PAGE_TYPE_TRAIL;
pts.colorIndex = i;
pts.nt = aStepsTypesToShow[i];
pts.nt = STEPS_TYPES_TO_SHOW.GetValue()[i];
pts.pCourse = SONGMAN->GetCourseFromPath( asCoursePaths[c] );
if( pts.pCourse == NULL )
continue;
@@ -343,12 +312,12 @@ void ScreenRanking::Init()
vector<Song*> vpSongs = SONGMAN->GetAllSongs();
if( !vpSongs.empty() )
{
for( unsigned i=0; i<aStepsTypesToShow.size(); i++ )
for( unsigned i=0; i<STEPS_TYPES_TO_SHOW.GetValue().size(); i++ )
{
PageToShow pts;
pts.type = PAGE_TYPE_ALL_STEPS;
pts.colorIndex = i;
pts.nt = aStepsTypesToShow[i];
pts.nt = STEPS_TYPES_TO_SHOW.GetValue()[i];
m_vPagesToShow.push_back( pts );
}
}
@@ -360,12 +329,12 @@ void ScreenRanking::Init()
SONGMAN->GetAllCourses( courses, false );
if( !courses.empty() )
{
for( unsigned i=0; i<aStepsTypesToShow.size(); i++ )
for( unsigned i=0; i<STEPS_TYPES_TO_SHOW.GetValue().size(); i++ )
{
PageToShow pts;
pts.type = PAGE_TYPE_ALL_COURSES;
pts.colorIndex = i;
pts.nt = aStepsTypesToShow[i];
pts.nt = STEPS_TYPES_TO_SHOW.GetValue()[i];
m_vPagesToShow.push_back( pts );
}
}
@@ -567,161 +536,155 @@ float ScreenRanking::SetPage( PageToShow pts )
this->AddChild( m_sprPageType );
SET_XY_AND_ON_COMMAND( m_sprPageType );
for( int l=0; l<NUM_RANKING_LINES; l++ )
{
for( int l=0; l<NUM_RANKING_LINES; l++ )
m_sprBullets[l].SetHidden( !bShowBullets );
if( bShowBullets )
{
m_sprBullets[l].SetHidden( !bShowBullets );
if( bShowBullets )
{
m_sprBullets[l].Reset();
m_sprBullets[l].StopAnimating();
m_sprBullets[l].SetState( l );
m_sprBullets[l].SetXY( BULLET_X(l), BULLET_Y(l) );
ON_COMMAND( m_sprBullets[l] );
}
m_sprBullets[l].Reset();
m_sprBullets[l].StopAnimating();
m_sprBullets[l].SetState( l );
m_sprBullets[l].SetXY( BULLET_X(l), BULLET_Y(l) );
ON_COMMAND( m_sprBullets[l] );
}
m_textNames[l].SetHidden( !bShowNames );
if( bShowNames )
{
m_textNames[l].Reset();
m_textNames[l].SetXY( NAME_X(l), NAME_Y(l) );
m_textNames[l].SetDiffuse( STEPS_TYPE_COLOR.GetValue(pts.colorIndex) );
ON_COMMAND( m_textNames[l] );
}
m_textNames[l].SetHidden( !bShowNames );
if( bShowNames )
{
m_textNames[l].Reset();
m_textNames[l].SetXY( NAME_X(l), NAME_Y(l) );
m_textNames[l].SetDiffuse( STEPS_TYPE_COLOR.GetValue(pts.colorIndex) );
ON_COMMAND( m_textNames[l] );
}
m_textScores[l].SetHidden( !bShowScores );
if( bShowScores )
{
m_textScores[l].Reset();
m_textScores[l].SetXY( SCORE_X(l), SCORE_Y(l) );
m_textScores[l].SetDiffuse( STEPS_TYPE_COLOR.GetValue(pts.colorIndex) );
ON_COMMAND( m_textScores[l] );
}
m_textScores[l].SetHidden( !bShowScores );
if( bShowScores )
{
m_textScores[l].Reset();
m_textScores[l].SetXY( SCORE_X(l), SCORE_Y(l) );
m_textScores[l].SetDiffuse( STEPS_TYPE_COLOR.GetValue(pts.colorIndex) );
ON_COMMAND( m_textScores[l] );
}
m_textPoints[l].SetHidden( !bShowPoints );
if( bShowPoints )
{
m_textPoints[l].Reset();
m_textPoints[l].SetXY( POINTS_X(l), POINTS_Y(l) );
m_textPoints[l].SetDiffuse( STEPS_TYPE_COLOR.GetValue(pts.colorIndex) );
ON_COMMAND( m_textPoints[l] );
}
m_textPoints[l].SetHidden( !bShowPoints );
if( bShowPoints )
{
m_textPoints[l].Reset();
m_textPoints[l].SetXY( POINTS_X(l), POINTS_Y(l) );
m_textPoints[l].SetDiffuse( STEPS_TYPE_COLOR.GetValue(pts.colorIndex) );
ON_COMMAND( m_textPoints[l] );
}
m_textTime[l].SetHidden( !bShowTime );
if( bShowTime )
m_textTime[l].SetHidden( !bShowTime );
if( bShowTime )
{
m_textTime[l].Reset();
m_textTime[l].SetXY( TIME_X(l), TIME_Y(l) );
m_textTime[l].SetDiffuse( STEPS_TYPE_COLOR.GetValue(pts.colorIndex) );
ON_COMMAND( m_textTime[l] );
}
}
FOREACH_CONST( Difficulty, DIFFICULTIES_TO_SHOW.GetValue(), iter )
{
m_sprDifficulty[*iter]->SetHidden( !bShowDifficulty );
if( bShowDifficulty )
{
m_sprDifficulty[*iter]->Reset();
m_sprDifficulty[*iter]->SetXY( DIFFICULTY_X(*iter), DIFFICULTY_Y );
ON_COMMAND( m_sprDifficulty[*iter] );
}
}
m_ListScoreRowItems.SetHidden( !bShowStepsScore );
if( bShowStepsScore )
{
m_ListScoreRowItems.Reset();
SET_XY_AND_ON_COMMAND( m_ListScoreRowItems );
vector<Actor*> vpActors;
for( unsigned i=0; i<m_vpStepsScoreRowItem.size(); i++ )
vpActors.push_back( m_vpStepsScoreRowItem[i] );
m_ListScoreRowItems.Load( vpActors, SONG_SCORE_ROWS_TO_SHOW, SCREEN_WIDTH, ROW_SPACING_Y, false, SONG_SCORE_SECONDS_PER_ROW, 0, false );
if( (bool)MANUAL_SCROLLING )
{
m_ListScoreRowItems.SetCurrentItem( 0 );
m_ListScoreRowItems.SetDestinationItem( 0 );
}
for( unsigned s=0; s<m_vpStepsScoreRowItem.size(); s++ )
{
StepsScoreRowItem *pStepsScoreRowItems = m_vpStepsScoreRowItem[s];
pStepsScoreRowItems->m_sprSongFrame.Reset();
pStepsScoreRowItems->m_sprSongFrame.SetXY( SONG_FRAME_OFFSET_X, SONG_FRAME_OFFSET_Y );
pStepsScoreRowItems->m_sprSongFrame.SetUseZBuffer( true );
ON_COMMAND( pStepsScoreRowItems->m_sprSongFrame );
pStepsScoreRowItems->m_textSongTitle.Reset();
pStepsScoreRowItems->m_textSongTitle.SetXY( SONG_TITLE_OFFSET_X, SONG_TITLE_OFFSET_Y );
pStepsScoreRowItems->m_textSongTitle.SetUseZBuffer( true );
ON_COMMAND( pStepsScoreRowItems->m_textSongTitle );
FOREACH_CONST( Difficulty, DIFFICULTIES_TO_SHOW.GetValue(), iter )
{
m_textTime[l].Reset();
m_textTime[l].SetXY( TIME_X(l), TIME_Y(l) );
m_textTime[l].SetDiffuse( STEPS_TYPE_COLOR.GetValue(pts.colorIndex) );
ON_COMMAND( m_textTime[l] );
pStepsScoreRowItems->m_textStepsScore[*iter].Reset();
pStepsScoreRowItems->m_textStepsScore[*iter].SetXY( STEPS_SCORE_OFFSET_X(*iter), STEPS_SCORE_OFFSET_Y );
pStepsScoreRowItems->m_textStepsScore[*iter].SetUseZBuffer( true );
pStepsScoreRowItems->m_textStepsScore[*iter].SetDiffuse( STEPS_TYPE_COLOR.GetValue(pts.colorIndex) );
ON_COMMAND( pStepsScoreRowItems->m_textStepsScore[*iter] );
}
}
}
FOREACH_ShownCourseDifficulty(d)
{
for( vector<Difficulty>::iterator dc_iter=m_vDiffsToShow.begin(); dc_iter!=m_vDiffsToShow.end(); dc_iter++ )
m_sprCourseDifficulty[d]->SetHidden( !bShowCourseDifficulty );
if( bShowCourseDifficulty )
{
m_sprDifficulty[*dc_iter]->SetHidden( !bShowDifficulty );
if( bShowDifficulty )
{
m_sprDifficulty[*dc_iter]->Reset();
m_sprDifficulty[*dc_iter]->SetXY( DIFFICULTY_X(*dc_iter), DIFFICULTY_Y );
ON_COMMAND( m_sprDifficulty[*dc_iter] );
}
}
m_ListScoreRowItems.SetHidden( !bShowStepsScore );
if( bShowStepsScore )
{
m_ListScoreRowItems.Reset();
SET_XY_AND_ON_COMMAND( m_ListScoreRowItems );
vector<Actor*> vpActors;
for( unsigned i=0; i<m_vpStepsScoreRowItem.size(); i++ )
vpActors.push_back( m_vpStepsScoreRowItem[i] );
m_ListScoreRowItems.Load( vpActors, SONG_SCORE_ROWS_TO_SHOW, SCREEN_WIDTH, ROW_SPACING_Y, false, SONG_SCORE_SECONDS_PER_ROW, 0, false );
if( (bool)MANUAL_SCROLLING )
{
m_ListScoreRowItems.SetCurrentItem( 0 );
m_ListScoreRowItems.SetDestinationItem( 0 );
}
for( unsigned s=0; s<m_vpStepsScoreRowItem.size(); s++ )
{
StepsScoreRowItem *pStepsScoreRowItems = m_vpStepsScoreRowItem[s];
pStepsScoreRowItems->m_sprSongFrame.Reset();
pStepsScoreRowItems->m_sprSongFrame.SetXY( SONG_FRAME_OFFSET_X, SONG_FRAME_OFFSET_Y );
pStepsScoreRowItems->m_sprSongFrame.SetUseZBuffer( true );
ON_COMMAND( pStepsScoreRowItems->m_sprSongFrame );
pStepsScoreRowItems->m_textSongTitle.Reset();
pStepsScoreRowItems->m_textSongTitle.SetXY( SONG_TITLE_OFFSET_X, SONG_TITLE_OFFSET_Y );
pStepsScoreRowItems->m_textSongTitle.SetUseZBuffer( true );
ON_COMMAND( pStepsScoreRowItems->m_textSongTitle );
for( vector<Difficulty>::iterator dc_iter=m_vDiffsToShow.begin(); dc_iter!=m_vDiffsToShow.end(); dc_iter++ )
{
pStepsScoreRowItems->m_textStepsScore[*dc_iter].Reset();
pStepsScoreRowItems->m_textStepsScore[*dc_iter].SetXY( STEPS_SCORE_OFFSET_X(*dc_iter), STEPS_SCORE_OFFSET_Y );
pStepsScoreRowItems->m_textStepsScore[*dc_iter].SetUseZBuffer( true );
pStepsScoreRowItems->m_textStepsScore[*dc_iter].SetDiffuse( STEPS_TYPE_COLOR.GetValue(pts.colorIndex) );
ON_COMMAND( pStepsScoreRowItems->m_textStepsScore[*dc_iter] );
}
}
m_sprCourseDifficulty[d]->Reset();
m_sprCourseDifficulty[d]->SetXY( COURSE_DIFFICULTY_X(d), COURSE_DIFFICULTY_Y );
ON_COMMAND( m_sprCourseDifficulty[d] );
}
}
m_ListCourseRowItems.SetHidden( !bShowCourseScore );
if( bShowCourseScore )
{
FOREACH_ShownCourseDifficulty(d)
m_ListCourseRowItems.Reset();
SET_XY_AND_ON_COMMAND( m_ListCourseRowItems );
vector<Actor*> vpActors;
for( unsigned i=0; i<m_vpCourseScoreRowItem.size(); i++ )
vpActors.push_back( m_vpCourseScoreRowItem[i] );
m_ListCourseRowItems.Load( vpActors, SONG_SCORE_ROWS_TO_SHOW, SCREEN_WIDTH, ROW_SPACING_Y, false, SONG_SCORE_SECONDS_PER_ROW, 0, false );
if( (bool)MANUAL_SCROLLING )
{
m_sprCourseDifficulty[d]->SetHidden( !bShowCourseDifficulty );
if( bShowCourseDifficulty )
{
m_sprCourseDifficulty[d]->Reset();
m_sprCourseDifficulty[d]->SetXY( COURSE_DIFFICULTY_X(d), COURSE_DIFFICULTY_Y );
ON_COMMAND( m_sprCourseDifficulty[d] );
}
m_ListCourseRowItems.SetCurrentItem( 0 );
m_ListCourseRowItems.SetDestinationItem( 0 );
}
m_ListCourseRowItems.SetHidden( !bShowCourseScore );
if( bShowCourseScore )
for( unsigned s=0; s<m_vpCourseScoreRowItem.size(); s++ )
{
m_ListCourseRowItems.Reset();
SET_XY_AND_ON_COMMAND( m_ListCourseRowItems );
CourseScoreRowItem *pCourseScoreRowItem = m_vpCourseScoreRowItem[s];
pCourseScoreRowItem->m_sprSongFrame.Reset();
pCourseScoreRowItem->m_sprSongFrame.SetXY( SONG_FRAME_OFFSET_X, SONG_FRAME_OFFSET_Y );
pCourseScoreRowItem->m_sprSongFrame.SetUseZBuffer( true );
ON_COMMAND( pCourseScoreRowItem->m_sprSongFrame );
vector<Actor*> vpActors;
for( unsigned i=0; i<m_vpCourseScoreRowItem.size(); i++ )
vpActors.push_back( m_vpCourseScoreRowItem[i] );
m_ListCourseRowItems.Load( vpActors, SONG_SCORE_ROWS_TO_SHOW, SCREEN_WIDTH, ROW_SPACING_Y, false, SONG_SCORE_SECONDS_PER_ROW, 0, false );
pCourseScoreRowItem->m_textSongTitle.Reset();
pCourseScoreRowItem->m_textSongTitle.SetXY( SONG_TITLE_OFFSET_X, SONG_TITLE_OFFSET_Y );
pCourseScoreRowItem->m_textSongTitle.SetUseZBuffer( true );
ON_COMMAND( pCourseScoreRowItem->m_textSongTitle );
if( (bool)MANUAL_SCROLLING )
FOREACH_ShownCourseDifficulty(d)
{
m_ListCourseRowItems.SetCurrentItem( 0 );
m_ListCourseRowItems.SetDestinationItem( 0 );
}
for( unsigned s=0; s<m_vpCourseScoreRowItem.size(); s++ )
{
CourseScoreRowItem *pCourseScoreRowItem = m_vpCourseScoreRowItem[s];
pCourseScoreRowItem->m_sprSongFrame.Reset();
pCourseScoreRowItem->m_sprSongFrame.SetXY( SONG_FRAME_OFFSET_X, SONG_FRAME_OFFSET_Y );
pCourseScoreRowItem->m_sprSongFrame.SetUseZBuffer( true );
ON_COMMAND( pCourseScoreRowItem->m_sprSongFrame );
pCourseScoreRowItem->m_textSongTitle.Reset();
pCourseScoreRowItem->m_textSongTitle.SetXY( SONG_TITLE_OFFSET_X, SONG_TITLE_OFFSET_Y );
pCourseScoreRowItem->m_textSongTitle.SetUseZBuffer( true );
ON_COMMAND( pCourseScoreRowItem->m_textSongTitle );
FOREACH_ShownCourseDifficulty(d)
{
pCourseScoreRowItem->m_textStepsScore[d].Reset();
pCourseScoreRowItem->m_textStepsScore[d].SetXY( COURSE_SCORE_OFFSET_X(d), COURSE_SCORE_OFFSET_Y );
pCourseScoreRowItem->m_textStepsScore[d].SetUseZBuffer( true );
pCourseScoreRowItem->m_textStepsScore[d].SetDiffuse( STEPS_TYPE_COLOR.GetValue(pts.colorIndex) );
ON_COMMAND( pCourseScoreRowItem->m_textStepsScore[d] );
}
pCourseScoreRowItem->m_textStepsScore[d].Reset();
pCourseScoreRowItem->m_textStepsScore[d].SetXY( COURSE_SCORE_OFFSET_X(d), COURSE_SCORE_OFFSET_Y );
pCourseScoreRowItem->m_textStepsScore[d].SetUseZBuffer( true );
pCourseScoreRowItem->m_textStepsScore[d].SetDiffuse( STEPS_TYPE_COLOR.GetValue(pts.colorIndex) );
ON_COMMAND( pCourseScoreRowItem->m_textStepsScore[d] );
}
}
}
@@ -835,10 +798,10 @@ float ScreenRanking::SetPage( PageToShow pts )
pStepsScoreRowItem->m_textSongTitle.SetText( pSong->GetFullDisplayTitle() );
for( vector<Difficulty>::iterator dc_iter = m_vDiffsToShow.begin(); dc_iter != m_vDiffsToShow.end(); dc_iter++ )
FOREACH_CONST( Difficulty, DIFFICULTIES_TO_SHOW.GetValue(), iter )
{
const Steps* pSteps = pSong->GetStepsByDifficulty( pts.nt, *dc_iter, false );
BitmapText* pTextStepsScore = &pStepsScoreRowItem->m_textStepsScore[*dc_iter];
const Steps* pSteps = pSong->GetStepsByDifficulty( pts.nt, *iter, false );
BitmapText* pTextStepsScore = &pStepsScoreRowItem->m_textStepsScore[*iter];
if( pSteps == NULL )
{
@@ -934,10 +897,10 @@ void ScreenRanking::TweenPageOffScreen()
OFF_COMMAND( m_textPoints[l] );
OFF_COMMAND( m_textTime[l] );
}
for( vector<Difficulty>::iterator dc_iter=m_vDiffsToShow.begin(); dc_iter!=m_vDiffsToShow.end(); dc_iter++ )
FOREACH_CONST( Difficulty, DIFFICULTIES_TO_SHOW.GetValue(), iter )
{
if( !m_sprDifficulty[*dc_iter]->GetHidden() )
OFF_COMMAND( m_sprDifficulty[*dc_iter] );
if( !m_sprDifficulty[*iter]->GetHidden() )
OFF_COMMAND( m_sprDifficulty[*iter] );
}
FOREACH_ShownCourseDifficulty(d)
{
+5 -3
View File
@@ -10,6 +10,7 @@
#include "ActorUtil.h"
#include "Difficulty.h"
#include "ThemeMetric.h"
#include "CommonMetrics.h"
class Course;
class Song;
@@ -102,14 +103,15 @@ protected:
ListDisplay m_ListCourseRowItems;
vector<PageToShow> m_vPagesToShow;
vector<Difficulty> m_vDiffsToShow;
// Don't use the version in CommonMetrics because we may have multiple
// ranking screens that want to show different types and difficulties.
ThemeMetricStepsTypesToShow STEPS_TYPES_TO_SHOW;
ThemeMetricDifficultiesToShow DIFFICULTIES_TO_SHOW;
ThemeMetric<CString> STEPS_TYPES_TO_HIDE;
ThemeMetric<bool> SHOW_CATEGORIES;
ThemeMetric<bool> SHOW_ALL_STEPS_SCORES;
ThemeMetric<bool> SHOW_ALL_COURSE_SCORES;
ThemeMetric<CString> DIFFICULTIES_TO_SHOW;
ThemeMetric<float> SECONDS_PER_PAGE;
ThemeMetric<float> PAGE_FADE_SECONDS;
ThemeMetric<int> PERCENT_DECIMAL_PLACES;