StringToDifficulty->BackwardCompatibleStringToDifficulty. Don't accept song file backward compatible names other places, like in metrics

This commit is contained in:
Chris Danford
2008-11-28 18:08:12 +00:00
parent b2ed76e536
commit e623ca8d3d
4 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -42,7 +42,7 @@ LuaFunction( DifficultyDisplayTypeToLocalizedString, DifficultyDisplayTypeToLoca
/* TODO: Format specific hacks should be moved into the file loader for
* that format. We don't want to carry these hacks forward to file
* formats that don't need them. */
Difficulty StringToDifficulty( const RString& sDC )
Difficulty BackwardCompatibleStringToDifficulty( const RString& sDC )
{
RString s2 = sDC;
s2.MakeLower();
+3
View File
@@ -22,6 +22,8 @@ const RString& DifficultyToString( Difficulty dc );
Difficulty StringToDifficulty( const RString& sDC );
LuaDeclareType( Difficulty );
Difficulty BackwardCompatibleStringToDifficulty( const RString& sDC );
typedef Difficulty CourseDifficulty;
const int NUM_CourseDifficulty = NUM_Difficulty;
#define FOREACH_ShownCourseDifficulty( cd ) for( Difficulty cd=GetNextShownCourseDifficulty((CourseDifficulty)-1); cd!=Difficulty_Invalid; cd=GetNextShownCourseDifficulty(cd) )
@@ -31,6 +33,7 @@ const RString& CourseDifficultyToLocalizedString( Difficulty dc );
Difficulty GetNextShownCourseDifficulty( Difficulty pn );
enum DifficultyDisplayType // ID for coloring and localized strings in StepsDisplay
{
DifficultyDisplayType_Single_Beginner,
+1 -1
View File
@@ -173,7 +173,7 @@ static bool LoadFromDWITokens(
int iNumFeet = atoi(sNumFeet);
// out.SetDescription(sDescription); // Don't put garbage in the description.
out.SetMeter(iNumFeet);
out.SetDifficulty( StringToDifficulty(sDescription) );
out.SetDifficulty( BackwardCompatibleStringToDifficulty(sDescription) );
NoteData newNoteData;
newNoteData.SetNumTracks( g_mapDanceNoteToNoteDataColumn.size() );
+1 -1
View File
@@ -34,7 +34,7 @@ static void LoadFromSMTokens(
out.m_StepsType = GameManager::StringToStepsType( sStepsType );
out.SetDescription( sDescription );
out.SetDifficulty( StringToDifficulty(sDifficulty) );
out.SetDifficulty( BackwardCompatibleStringToDifficulty(sDifficulty) );
// HACK: We used to store SMANIAC as Difficulty_Hard with special description.
// Now, it has its own Difficulty_Challenge