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 )
s = row.m_Steps->GetDescription();
else
s = SONGMAN->GetDifficultyThemeName(dc);
s = DifficultyToThemedString(dc);
m_Descriptions[i].SetMaxWidth( DESCRIPTION_MAX_WIDTH );
m_Descriptions[i].SetText( s );
/* 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] = {
"stream",
"voltage",
"air",
"freeze",
"chaos",
"taps",
"jumps",
"holds",
"mines",
"hands",
"Stream",
"Voltage",
"Air",
"Freeze",
"Chaos",
"Taps",
"Jumps",
"Holds",
"Mines",
"Hands",
};
XToString( RadarCategory );
static const CString DifficultyNames[NUM_RADAR_CATEGORIES] = {
"beginner",
"easy",
"medium",
"hard",
"challenge",
"edit",
"Beginner",
"Easy",
"Medium",
"Hard",
"Challenge",
"Edit",
};
XToString( Difficulty );
XToThemedString( Difficulty );
/* We prefer the above names; recognize a number of others, too. (They'l
* get normalized when written to SMs, etc.) */
@@ -99,20 +100,21 @@ Difficulty StringToDifficulty( const CString& sDC )
static const CString CourseDifficultyNames[NUM_COURSE_DIFFICULTIES] = {
"regular",
"difficult",
"Regular",
"Difficult",
};
XToString( CourseDifficulty );
XToThemedString( CourseDifficulty );
StringToX( CourseDifficulty );
static const CString PlayModeNames[NUM_PLAY_MODES] = {
"arcade",
"nonstop",
"oni",
"endless",
"battle",
"rave",
"Arcade",
"Nonstop",
"Oni",
"Endless",
"Battle",
"Rave",
};
XToString( PlayMode );
StringToX( PlayMode );
+2
View File
@@ -98,6 +98,7 @@ enum Difficulty
#define FOREACH_Difficulty( dc ) FOREACH_ENUM( Difficulty, NUM_DIFFICULTIES, dc )
const CString& DifficultyToString( Difficulty dc );
CString DifficultyToThemedString( Difficulty dc );
Difficulty StringToDifficulty( const CString& sDC );
@@ -111,6 +112,7 @@ enum CourseDifficulty
#define FOREACH_CourseDifficulty( cd ) FOREACH_ENUM( CourseDifficulty, NUM_COURSE_DIFFICULTIES, cd )
const CString& CourseDifficultyToString( CourseDifficulty dc );
CString CourseDifficultyToThemedString( CourseDifficulty dc );
CourseDifficulty StringToCourseDifficulty( const CString& sDC );
+1 -1
View File
@@ -47,7 +47,7 @@ ScreenAward::ScreenAward( CString sName ) : Screen( sName )
sAward = PerDifficultyAwardToString( pda );
sDescription =
PerDifficultyAwardToThemedString( pda ) + "\n" +
SONGMAN->GetDifficultyThemeName( GAMESTATE->m_pCurNotes[p]->GetDifficulty() );
DifficultyToThemedString( GAMESTATE->m_pCurNotes[p]->GetDifficulty() );
}
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++ )
{
CourseDifficulty cd = (CourseDifficulty)d;
if( pCourse->HasCourseDifficulty(st,cd) )
{
CString sDifficulty = CourseDifficultyToString( cd );
sDifficulty = Capitalize( sDifficulty );
row.choices.push_back( ENTRY_NAME(sDifficulty+"Courses") );
ModeChoice mc;
mc.m_CourseDifficulty = cd;
hand.ListEntries.push_back( mc );
}
if( !pCourse->HasCourseDifficulty(st,cd) )
continue; // skip
CString s = CourseDifficultyToThemedString( cd );
row.choices.push_back( s );
ModeChoice mc;
mc.m_CourseDifficulty = cd;
hand.ListEntries.push_back( mc );
}
}
else // !GAMESTATE->IsCourseMode(), playing a song
@@ -135,11 +134,10 @@ void ScreenOptionsMaster::SetStep( OptionRowData &row, OptionRowHandler &hand )
Steps* pSteps = vSteps[i];
CString s;
// convert to theme-defined difficulty name
if( pSteps->GetDifficulty() == DIFFICULTY_EDIT )
s = pSteps->GetDescription();
else
s = SONGMAN->GetDifficultyThemeName( pSteps->GetDifficulty() );
s = DifficultyToThemedString( pSteps->GetDifficulty() );
s += ssprintf( " (%d)", pSteps->GetMeter() );
row.choices.push_back( s );
+1 -1
View File
@@ -46,7 +46,7 @@ SongCreditDisplay::SongCreditDisplay()
for( unsigned i=0; i<vpStepsToShow.size(); i++ )
{
Steps* pSteps = vpStepsToShow[i];
CString sDifficulty = SONGMAN->GetDifficultyThemeName( pSteps->GetDifficulty() );
CString sDifficulty = DifficultyToThemedString( pSteps->GetDifficulty() );
// HACK: reset capitalization
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 )
{
AddTo.clear();
+1 -2
View File
@@ -56,8 +56,7 @@ public:
RageColor GetGroupColor( const CString &sGroupName );
RageColor GetSongColor( const Song* pSong );
RageColor GetDifficultyColor( Difficulty dc ) const;
CString GetDifficultyThemeName( Difficulty dc ) const;
static CString ShortenGroupName( CString sLongGroupName );
static int GetNumStagesForSong( const Song* pSong ); // LongVer songs take 2 stages, MarathonVer take 3