diff --git a/stepmania/src/ScreenOptionsMaster.cpp b/stepmania/src/ScreenOptionsMaster.cpp index b9c3d5cc2c..6f309bd8f5 100644 --- a/stepmania/src/ScreenOptionsMaster.cpp +++ b/stepmania/src/ScreenOptionsMaster.cpp @@ -34,26 +34,6 @@ #define PREV_SCREEN THEME->GetMetric (m_sName,"PrevScreen") // #define PREV_SCREEN( play_mode ) THEME->GetMetric (m_sName,"PrevScreen"+Capitalize(PlayModeToString(play_mode))) -#define BEGINNER_DESCRIPTION THEME->GetMetric ("ScreenOptionsMaster","Beginner") -#define EASY_DESCRIPTION THEME->GetMetric ("ScreenOptionsMaster","Easy") -#define MEDIUM_DESCRIPTION THEME->GetMetric ("ScreenOptionsMaster","Medium") -#define HARD_DESCRIPTION THEME->GetMetric ("ScreenOptionsMaster","Hard") -#define CHALLENGE_DESCRIPTION THEME->GetMetric ("ScreenOptionsMaster","Challenge") - - -CString ScreenOptionsMaster::ConvertParamToThemeDifficulty( const CString &in ) const -{ - switch( StringToDifficulty(in) ) - { - case DIFFICULTY_BEGINNER: return BEGINNER_DESCRIPTION; - case DIFFICULTY_EASY: return EASY_DESCRIPTION; - case DIFFICULTY_MEDIUM: return MEDIUM_DESCRIPTION; - case DIFFICULTY_HARD: return HARD_DESCRIPTION; - case DIFFICULTY_CHALLENGE: return CHALLENGE_DESCRIPTION; - default: return in; // something else - } -} - /* Add the list named "ListName" to the given row/handler. */ void ScreenOptionsMaster::SetList( OptionRow &row, OptionRowHandler &hand, CString ListName, CString &TitleOut ) { @@ -134,7 +114,7 @@ void ScreenOptionsMaster::SetStep( OptionRow &row, OptionRowHandler &hand ) s.MakeUpper(); // convert to theme-defined values - s = ConvertParamToThemeDifficulty(s); + s = SONGMAN->GetDifficultyThemeName(s); row.choices.push_back( s ); } diff --git a/stepmania/src/ScreenOptionsMaster.h b/stepmania/src/ScreenOptionsMaster.h index 557c8488e9..2a19d491a8 100644 --- a/stepmania/src/ScreenOptionsMaster.h +++ b/stepmania/src/ScreenOptionsMaster.h @@ -42,7 +42,6 @@ private: vector OptionRowHandlers; OptionRow *m_OptionRowAlloc; - CString ConvertParamToThemeDifficulty( const CString &in ) const; int ExportOption( const OptionRow &row, const OptionRowHandler &hand, int pn, int sel ); int ImportOption( const OptionRow &row, const OptionRowHandler &hand, int pn, int rowno ); void SetList( OptionRow &row, OptionRowHandler &hand, CString param, CString &TitleOut ); diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index 7ebacea934..2f3331947d 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -864,7 +864,13 @@ RageColor SongManager::GetSongColor( const Song* pSong ) return GetGroupColor( pSong->m_sGroupName ); } -RageColor SongManager::GetDifficultyColor( Difficulty dc ) +#define BEGINNER_DESCRIPTION THEME->GetMetric ("Common","Beginner") +#define EASY_DESCRIPTION THEME->GetMetric ("Common","Easy") +#define MEDIUM_DESCRIPTION THEME->GetMetric ("Common","Medium") +#define HARD_DESCRIPTION THEME->GetMetric ("Common","Hard") +#define CHALLENGE_DESCRIPTION THEME->GetMetric ("Common","Challenge") + +RageColor SongManager::GetDifficultyColor( Difficulty dc ) const { switch( dc ) { @@ -877,6 +883,19 @@ RageColor SongManager::GetDifficultyColor( Difficulty dc ) } } +CString SongManager::GetDifficultyThemeName( const CString &in ) const +{ + switch( StringToDifficulty(in) ) + { + case DIFFICULTY_BEGINNER: return BEGINNER_DESCRIPTION; + case DIFFICULTY_EASY: return EASY_DESCRIPTION; + case DIFFICULTY_MEDIUM: return MEDIUM_DESCRIPTION; + case DIFFICULTY_HARD: return HARD_DESCRIPTION; + case DIFFICULTY_CHALLENGE: return CHALLENGE_DESCRIPTION; + default: return in; // something else + } +} + void SongManager::GetSongs( vector &AddTo, CString sGroupName, int iMaxStages ) const { AddTo.clear(); diff --git a/stepmania/src/SongManager.h b/stepmania/src/SongManager.h index 7e093223e8..bd13f67747 100644 --- a/stepmania/src/SongManager.h +++ b/stepmania/src/SongManager.h @@ -50,7 +50,8 @@ public: RageColor GetGroupColor( const CString &sGroupName ); RageColor GetSongColor( const Song* pSong ); - RageColor GetDifficultyColor( Difficulty dc ); + RageColor GetDifficultyColor( Difficulty dc ) const; + CString GetDifficultyThemeName( const CString &in ) const; static CString ShortenGroupName( CString sLongGroupName ); static int GetNumStagesForSong( const Song* pSong ); // LongVer songs take 2 stages, MarathonVer take 3