clean up Difficulty name theming

theme CourseDifficulty on options screen
This commit is contained in:
Chris Danford
2004-03-25 06:21:58 +00:00
parent cb91aa5f36
commit afa880cbac
8 changed files with 41 additions and 46 deletions
+1 -1
View File
@@ -311,7 +311,7 @@ void DifficultyList::SetFromGameState()
if( row.m_Steps->GetDifficulty() == DIFFICULTY_EDIT ) if( row.m_Steps->GetDifficulty() == DIFFICULTY_EDIT )
s = row.m_Steps->GetDescription(); s = row.m_Steps->GetDescription();
else else
s = SONGMAN->GetDifficultyThemeName(dc); s = DifficultyToThemedString(dc);
m_Descriptions[i].SetMaxWidth( DESCRIPTION_MAX_WIDTH ); m_Descriptions[i].SetMaxWidth( DESCRIPTION_MAX_WIDTH );
m_Descriptions[i].SetText( s ); m_Descriptions[i].SetText( s );
/* Don't mess with alpha; it might be fading on. */ /* Don't mess with alpha; it might be fading on. */
+26 -24
View File
@@ -46,29 +46,30 @@ static const CString EMPTY_STRING;
static const CString RadarCategoryNames[NUM_RADAR_CATEGORIES] = { static const CString RadarCategoryNames[NUM_RADAR_CATEGORIES] = {
"stream", "Stream",
"voltage", "Voltage",
"air", "Air",
"freeze", "Freeze",
"chaos", "Chaos",
"taps", "Taps",
"jumps", "Jumps",
"holds", "Holds",
"mines", "Mines",
"hands", "Hands",
}; };
XToString( RadarCategory ); XToString( RadarCategory );
static const CString DifficultyNames[NUM_RADAR_CATEGORIES] = { static const CString DifficultyNames[NUM_RADAR_CATEGORIES] = {
"beginner", "Beginner",
"easy", "Easy",
"medium", "Medium",
"hard", "Hard",
"challenge", "Challenge",
"edit", "Edit",
}; };
XToString( Difficulty ); XToString( Difficulty );
XToThemedString( Difficulty );
/* We prefer the above names; recognize a number of others, too. (They'l /* We prefer the above names; recognize a number of others, too. (They'l
* get normalized when written to SMs, etc.) */ * get normalized when written to SMs, etc.) */
@@ -99,20 +100,21 @@ Difficulty StringToDifficulty( const CString& sDC )
static const CString CourseDifficultyNames[NUM_COURSE_DIFFICULTIES] = { static const CString CourseDifficultyNames[NUM_COURSE_DIFFICULTIES] = {
"regular", "Regular",
"difficult", "Difficult",
}; };
XToString( CourseDifficulty ); XToString( CourseDifficulty );
XToThemedString( CourseDifficulty );
StringToX( CourseDifficulty ); StringToX( CourseDifficulty );
static const CString PlayModeNames[NUM_PLAY_MODES] = { static const CString PlayModeNames[NUM_PLAY_MODES] = {
"arcade", "Arcade",
"nonstop", "Nonstop",
"oni", "Oni",
"endless", "Endless",
"battle", "Battle",
"rave", "Rave",
}; };
XToString( PlayMode ); XToString( PlayMode );
StringToX( PlayMode ); StringToX( PlayMode );
+2
View File
@@ -98,6 +98,7 @@ enum Difficulty
#define FOREACH_Difficulty( dc ) FOREACH_ENUM( Difficulty, NUM_DIFFICULTIES, dc ) #define FOREACH_Difficulty( dc ) FOREACH_ENUM( Difficulty, NUM_DIFFICULTIES, dc )
const CString& DifficultyToString( Difficulty dc ); const CString& DifficultyToString( Difficulty dc );
CString DifficultyToThemedString( Difficulty dc );
Difficulty StringToDifficulty( const CString& sDC ); Difficulty StringToDifficulty( const CString& sDC );
@@ -111,6 +112,7 @@ enum CourseDifficulty
#define FOREACH_CourseDifficulty( cd ) FOREACH_ENUM( CourseDifficulty, NUM_COURSE_DIFFICULTIES, cd ) #define FOREACH_CourseDifficulty( cd ) FOREACH_ENUM( CourseDifficulty, NUM_COURSE_DIFFICULTIES, cd )
const CString& CourseDifficultyToString( CourseDifficulty dc ); const CString& CourseDifficultyToString( CourseDifficulty dc );
CString CourseDifficultyToThemedString( CourseDifficulty dc );
CourseDifficulty StringToCourseDifficulty( const CString& sDC ); CourseDifficulty StringToCourseDifficulty( const CString& sDC );
+1 -1
View File
@@ -47,7 +47,7 @@ ScreenAward::ScreenAward( CString sName ) : Screen( sName )
sAward = PerDifficultyAwardToString( pda ); sAward = PerDifficultyAwardToString( pda );
sDescription = sDescription =
PerDifficultyAwardToThemedString( pda ) + "\n" + PerDifficultyAwardToThemedString( pda ) + "\n" +
SONGMAN->GetDifficultyThemeName( GAMESTATE->m_pCurNotes[p]->GetDifficulty() ); DifficultyToThemedString( GAMESTATE->m_pCurNotes[p]->GetDifficulty() );
} }
else if( !GAMESTATE->m_vLastPeakComboAwards[p].empty() ) else if( !GAMESTATE->m_vLastPeakComboAwards[p].empty() )
{ {
+9 -11
View File
@@ -114,15 +114,14 @@ void ScreenOptionsMaster::SetStep( OptionRowData &row, OptionRowHandler &hand )
for( int d=0; d<NUM_COURSE_DIFFICULTIES; d++ ) for( int d=0; d<NUM_COURSE_DIFFICULTIES; d++ )
{ {
CourseDifficulty cd = (CourseDifficulty)d; CourseDifficulty cd = (CourseDifficulty)d;
if( pCourse->HasCourseDifficulty(st,cd) ) if( !pCourse->HasCourseDifficulty(st,cd) )
{ continue; // skip
CString sDifficulty = CourseDifficultyToString( cd );
sDifficulty = Capitalize( sDifficulty ); CString s = CourseDifficultyToThemedString( cd );
row.choices.push_back( ENTRY_NAME(sDifficulty+"Courses") ); row.choices.push_back( s );
ModeChoice mc; ModeChoice mc;
mc.m_CourseDifficulty = cd; mc.m_CourseDifficulty = cd;
hand.ListEntries.push_back( mc ); hand.ListEntries.push_back( mc );
}
} }
} }
else // !GAMESTATE->IsCourseMode(), playing a song else // !GAMESTATE->IsCourseMode(), playing a song
@@ -135,11 +134,10 @@ void ScreenOptionsMaster::SetStep( OptionRowData &row, OptionRowHandler &hand )
Steps* pSteps = vSteps[i]; Steps* pSteps = vSteps[i];
CString s; CString s;
// convert to theme-defined difficulty name
if( pSteps->GetDifficulty() == DIFFICULTY_EDIT ) if( pSteps->GetDifficulty() == DIFFICULTY_EDIT )
s = pSteps->GetDescription(); s = pSteps->GetDescription();
else else
s = SONGMAN->GetDifficultyThemeName( pSteps->GetDifficulty() ); s = DifficultyToThemedString( pSteps->GetDifficulty() );
s += ssprintf( " (%d)", pSteps->GetMeter() ); s += ssprintf( " (%d)", pSteps->GetMeter() );
row.choices.push_back( s ); row.choices.push_back( s );
+1 -1
View File
@@ -46,7 +46,7 @@ SongCreditDisplay::SongCreditDisplay()
for( unsigned i=0; i<vpStepsToShow.size(); i++ ) for( unsigned i=0; i<vpStepsToShow.size(); i++ )
{ {
Steps* pSteps = vpStepsToShow[i]; Steps* pSteps = vpStepsToShow[i];
CString sDifficulty = SONGMAN->GetDifficultyThemeName( pSteps->GetDifficulty() ); CString sDifficulty = DifficultyToThemedString( pSteps->GetDifficulty() );
// HACK: reset capitalization // HACK: reset capitalization
sDifficulty.MakeLower(); sDifficulty.MakeLower();
-6
View File
@@ -416,12 +416,6 @@ RageColor SongManager::GetDifficultyColor( Difficulty dc ) const
} }
} }
CString SongManager::GetDifficultyThemeName( Difficulty dc ) const
{
CString sMetricName = "Difficulty" + Capitalize( DifficultyToString(dc) );
return THEME->GetMetric( "Common", sMetricName );
}
static void GetSongsFromVector( const vector<Song*> &Songs, vector<Song*> &AddTo, CString sGroupName, int iMaxStages ) static void GetSongsFromVector( const vector<Song*> &Songs, vector<Song*> &AddTo, CString sGroupName, int iMaxStages )
{ {
AddTo.clear(); AddTo.clear();
-1
View File
@@ -56,7 +56,6 @@ public:
RageColor GetGroupColor( const CString &sGroupName ); RageColor GetGroupColor( const CString &sGroupName );
RageColor GetSongColor( const Song* pSong ); RageColor GetSongColor( const Song* pSong );
RageColor GetDifficultyColor( Difficulty dc ) const; RageColor GetDifficultyColor( Difficulty dc ) const;
CString GetDifficultyThemeName( Difficulty dc ) const;
static CString ShortenGroupName( CString sLongGroupName ); static CString ShortenGroupName( CString sLongGroupName );
static int GetNumStagesForSong( const Song* pSong ); // LongVer songs take 2 stages, MarathonVer take 3 static int GetNumStagesForSong( const Song* pSong ); // LongVer songs take 2 stages, MarathonVer take 3