Trying lua code to get the unlocked Step.

Untested right now.
Will doc it when confirmed working.
This commit is contained in:
Jason Felds
2011-08-12 23:55:36 -04:00
parent 51030846fd
commit 939b46c01e
+19
View File
@@ -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 );