new Difficulty binding
This commit is contained in:
@@ -17,8 +17,9 @@ static const char *DifficultyNames[] = {
|
||||
};
|
||||
XToString( Difficulty, NUM_Difficulty );
|
||||
XToLocalizedString( Difficulty );
|
||||
LuaXType( Difficulty, NUM_Difficulty , "Difficulty_" );
|
||||
|
||||
LuaFunction( DifficultyToLocalizedString, DifficultyToLocalizedString((Difficulty) IArg(1)) );
|
||||
LuaFunction( DifficultyToLocalizedString, DifficultyToLocalizedString( Enum::Check<Difficulty>(L, 1)) );
|
||||
|
||||
/* We prefer the above names; recognize a number of others, too. (They'l
|
||||
* get normalized when written to SMs, etc.) */
|
||||
@@ -47,20 +48,6 @@ Difficulty StringToDifficulty( const RString& sDC )
|
||||
else return DIFFICULTY_INVALID;
|
||||
}
|
||||
|
||||
static void LuaDifficulty(lua_State* L)
|
||||
{
|
||||
FOREACH_Difficulty( d )
|
||||
{
|
||||
RString s = DifficultyToString(d);
|
||||
s.MakeUpper();
|
||||
LUA->SetGlobal( "DIFFICULTY_"+s, d );
|
||||
}
|
||||
LUA->SetGlobal( "NUM_Difficulty", NUM_Difficulty );
|
||||
}
|
||||
REGISTER_WITH_LUA_FUNCTION( LuaDifficulty );
|
||||
|
||||
|
||||
|
||||
static const char *CourseDifficultyNames[] =
|
||||
{
|
||||
"Beginner",
|
||||
|
||||
@@ -21,6 +21,7 @@ enum Difficulty
|
||||
const RString& DifficultyToString( Difficulty dc );
|
||||
const RString& DifficultyToLocalizedString( Difficulty dc );
|
||||
Difficulty StringToDifficulty( const RString& sDC );
|
||||
LuaDeclareType( Difficulty );
|
||||
|
||||
|
||||
typedef Difficulty CourseDifficulty;
|
||||
|
||||
Reference in New Issue
Block a user