adding CustomDifficulty stuff (themable difficulty /StepsType combinations). Doesn't compile - fixing

This commit is contained in:
Chris Danford
2008-11-28 22:02:28 +00:00
parent 261df9636e
commit f18ba1614d
12 changed files with 66 additions and 111 deletions
+28 -29
View File
@@ -5,7 +5,6 @@
#include "LuaManager.h"
#include "LocalizedString.h"
static const char *DifficultyNames[] = {
"Beginner",
"Easy",
@@ -18,26 +17,6 @@ XToString( Difficulty );
StringToX( Difficulty );
LuaXType( Difficulty );
static const char *DifficultyDisplayTypeNames[] = {
"Single_Beginner",
"Single_Easy",
"Single_Medium",
"Single_Hard",
"Single_Challenge",
"Double_Beginner",
"Double_Easy",
"Double_Medium",
"Double_Hard",
"Double_Challenge",
"Edit",
"Couple",
"Routine",
};
XToString( DifficultyDisplayType );
XToLocalizedString( DifficultyDisplayType );
LuaXType( DifficultyDisplayType );
LuaFunction( DifficultyDisplayTypeToLocalizedString, DifficultyDisplayTypeToLocalizedString( Enum::Check<DifficultyDisplayType>(L, 1)) );
/* We prefer the above names; recognize a number of others, too. (They'll
* get normalized when written to SMs, etc.) */
/* TODO: Format specific hacks should be moved into the file loader for
@@ -95,26 +74,46 @@ CourseDifficulty GetNextShownCourseDifficulty( CourseDifficulty cd )
return Difficulty_Invalid;
}
DifficultyDisplayType MakeDifficultyDisplayType( Difficulty dc, StepsTypeCategory stc )
static ThemeMetric<RString> NAMES("CustomDifficulty","Names");
RString GetCustomDifficulty( Difficulty dc, StepsTypeCategory stc )
{
RString s;
switch( stc )
{
DEFAULT_FAIL(stc);
case StepsTypeCategory_Single:
if( dc == Difficulty_Edit )
return DifficultyDisplayType_Edit;
return (DifficultyDisplayType)(DifficultyDisplayType_Single_Beginner + dc);
case StepsTypeCategory_Double:
if( dc == Difficulty_Edit )
return DifficultyDisplayType_Edit;
return (DifficultyDisplayType)(DifficultyDisplayType_Double_Beginner + dc);
return "Edit";
else
{
/*
// OPTIMIZATION OPPORTUNITY: cache these metrics.
vector<RString> vsNames;
split( NAMES, ",", vsNames );
FOREACH( RString, vsNames, s )
{
if( STEPS_TYPE
}
*/
return DifficultyToString( dc );
}
case StepsTypeCategory_Couple:
return DifficultyDisplayType_Couple;
return "Couple";
case StepsTypeCategory_Routine:
return DifficultyDisplayType_Routine;
return "Routine";
}
}
const RString& GetLocalizedCustomDifficulty( RString &sCustomDifficulty )
{
return THEME:GetString( "CustomDifficulty", sCustomDifficultyString );
}
/*
* (c) 2001-2004 Chris Danford
* All rights reserved.