move GetDifficultyThemeName into SongManager

This commit is contained in:
Glenn Maynard
2003-11-16 19:07:52 +00:00
parent 1b7a2717d5
commit 6353d9a007
4 changed files with 23 additions and 24 deletions
+1 -21
View File
@@ -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 );
}
-1
View File
@@ -42,7 +42,6 @@ private:
vector<OptionRowHandler> 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 );
+20 -1
View File
@@ -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<Song*> &AddTo, CString sGroupName, int iMaxStages ) const
{
AddTo.clear();
+2 -1
View File
@@ -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