add Lua GetOneSteps
This commit is contained in:
+13
-2
@@ -1380,12 +1380,22 @@ public:
|
||||
static int HasStepsTypeAndDifficulty( T* p, lua_State *L )
|
||||
{
|
||||
StepsType st = Enum::Check<StepsType>(L, 1);
|
||||
|
||||
Difficulty dc = Enum::Check<Difficulty>( L, 2 );
|
||||
|
||||
lua_pushboolean( L, p->HasStepsTypeAndDifficulty(st, dc) );
|
||||
return 1;
|
||||
}
|
||||
// TODO: HasStepsTypeAndDifficulty and GetOneSteps should be in a SongUtil Lua table and a method of Steps.
|
||||
static int GetOneSteps( T* p, lua_State *L )
|
||||
{
|
||||
StepsType st = Enum::Check<StepsType>(L, 1);
|
||||
Difficulty dc = Enum::Check<Difficulty>( L, 2 );
|
||||
Steps *pSteps = SongUtil::GetOneSteps( p, st, dc );
|
||||
if( pSteps )
|
||||
pSteps->PushSelf(L);
|
||||
else
|
||||
lua_pushnil(L);
|
||||
return 1;
|
||||
}
|
||||
|
||||
LunaSong()
|
||||
{
|
||||
@@ -1407,6 +1417,7 @@ public:
|
||||
ADD_METHOD( IsLong );
|
||||
ADD_METHOD( IsMarathon );
|
||||
ADD_METHOD( HasStepsTypeAndDifficulty );
|
||||
ADD_METHOD( GetOneSteps );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user