Trying lua code to get the unlocked Step.
Untested right now. Will doc it when confirmed working.
This commit is contained in:
@@ -799,6 +799,24 @@ public:
|
||||
if( pSong ) { pSong->PushSelf(L); return 1; }
|
||||
return 0;
|
||||
}
|
||||
// TODO: Add a function to just get all steps.
|
||||
static int GetStepByStepsType( T* p, lua_State *L )
|
||||
{
|
||||
Song *pSong = p->m_Song.ToSong();
|
||||
if (pSong)
|
||||
{
|
||||
const vector<Steps*>& allStepsType = pSong->GetStepsByStepsType(p->m_StepsType);
|
||||
FOREACH_CONST(Steps*, allStepsType, step)
|
||||
{
|
||||
if ((*step)->GetDifficulty() == p->m_dc)
|
||||
{
|
||||
(*step)->PushSelf(L); return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int GetCourse( T* p, lua_State *L )
|
||||
{
|
||||
Course *pCourse = p->m_Course.ToCourse();
|
||||
@@ -848,6 +866,7 @@ public:
|
||||
ADD_METHOD( GetRequirePassChallengeSteps );
|
||||
ADD_METHOD( GetSong );
|
||||
ADD_METHOD( GetCourse );
|
||||
ADD_METHOD( GetStepByStepsType );
|
||||
ADD_METHOD( song );
|
||||
ADD_METHOD( steps );
|
||||
ADD_METHOD( steps_type );
|
||||
|
||||
Reference in New Issue
Block a user