From afa880cbac109980687dbcbd25873b2b2bef0855 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Thu, 25 Mar 2004 06:21:58 +0000 Subject: [PATCH] clean up Difficulty name theming theme CourseDifficulty on options screen --- stepmania/src/DifficultyList.cpp | 2 +- stepmania/src/GameConstantsAndTypes.cpp | 50 +++++++++++++------------ stepmania/src/GameConstantsAndTypes.h | 2 + stepmania/src/ScreenAward.cpp | 2 +- stepmania/src/ScreenOptionsMaster.cpp | 20 +++++----- stepmania/src/SongCreditDisplay.cpp | 2 +- stepmania/src/SongManager.cpp | 6 --- stepmania/src/SongManager.h | 3 +- 8 files changed, 41 insertions(+), 46 deletions(-) diff --git a/stepmania/src/DifficultyList.cpp b/stepmania/src/DifficultyList.cpp index 238248aa67..4459607036 100644 --- a/stepmania/src/DifficultyList.cpp +++ b/stepmania/src/DifficultyList.cpp @@ -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. */ diff --git a/stepmania/src/GameConstantsAndTypes.cpp b/stepmania/src/GameConstantsAndTypes.cpp index 03adf82908..7f5dae05d0 100644 --- a/stepmania/src/GameConstantsAndTypes.cpp +++ b/stepmania/src/GameConstantsAndTypes.cpp @@ -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 ); diff --git a/stepmania/src/GameConstantsAndTypes.h b/stepmania/src/GameConstantsAndTypes.h index 4332990d4e..86486a96b8 100644 --- a/stepmania/src/GameConstantsAndTypes.h +++ b/stepmania/src/GameConstantsAndTypes.h @@ -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 ); diff --git a/stepmania/src/ScreenAward.cpp b/stepmania/src/ScreenAward.cpp index fb0fe18578..1184574ff4 100644 --- a/stepmania/src/ScreenAward.cpp +++ b/stepmania/src/ScreenAward.cpp @@ -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() ) { diff --git a/stepmania/src/ScreenOptionsMaster.cpp b/stepmania/src/ScreenOptionsMaster.cpp index a7ea916123..a0bf88581c 100644 --- a/stepmania/src/ScreenOptionsMaster.cpp +++ b/stepmania/src/ScreenOptionsMaster.cpp @@ -114,15 +114,14 @@ void ScreenOptionsMaster::SetStep( OptionRowData &row, OptionRowHandler &hand ) for( int d=0; dHasCourseDifficulty(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 ); diff --git a/stepmania/src/SongCreditDisplay.cpp b/stepmania/src/SongCreditDisplay.cpp index 4228ea54da..11811d089a 100644 --- a/stepmania/src/SongCreditDisplay.cpp +++ b/stepmania/src/SongCreditDisplay.cpp @@ -46,7 +46,7 @@ SongCreditDisplay::SongCreditDisplay() for( unsigned i=0; iGetDifficultyThemeName( pSteps->GetDifficulty() ); + CString sDifficulty = DifficultyToThemedString( pSteps->GetDifficulty() ); // HACK: reset capitalization sDifficulty.MakeLower(); diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index cb81619e98..9f6c624cd7 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -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 &Songs, vector &AddTo, CString sGroupName, int iMaxStages ) { AddTo.clear(); diff --git a/stepmania/src/SongManager.h b/stepmania/src/SongManager.h index 9c960402cd..684f28e95b 100644 --- a/stepmania/src/SongManager.h +++ b/stepmania/src/SongManager.h @@ -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