diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index 5428f4d291..863db9f50d 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -1339,6 +1339,10 @@ public: static int FindCourse( T* p, lua_State *L ) { Course *pC = p->FindCourse(SArg(1)); if(pC) pC->PushSelf(L); else lua_pushnil(L); return 1; } static int GetRandomSong( T* p, lua_State *L ) { Song *pS = p->GetRandomSong(); if(pS) pS->PushSelf(L); else lua_pushnil(L); return 1; } static int GetRandomCourse( T* p, lua_State *L ){ Course *pC = p->GetRandomCourse(); if(pC) pC->PushSelf(L); else lua_pushnil(L); return 1; } + static int GetNumSongs( T* p, lua_State *L ) { lua_pushnumber( L, p->GetNumSongs() ); return 1; } + static int GetNumSongGroups( T* p, lua_State *L ) { lua_pushnumber( L, p->GetNumSongGroups() ); return 1; } + static int GetNumCourses( T* p, lua_State *L ) { lua_pushnumber( L, p->GetNumCourses() ); return 1; } + static int GetNumCourseGroups( T* p, lua_State *L ) { lua_pushnumber( L, p->GetNumCourseGroups() ); return 1; } static void Register(lua_State *L) { @@ -1348,6 +1352,10 @@ public: ADD_METHOD( FindCourse ) ADD_METHOD( GetRandomSong ) ADD_METHOD( GetRandomCourse ) + ADD_METHOD( GetNumSongs ) + ADD_METHOD( GetNumSongGroups ) + ADD_METHOD( GetNumCourses ) + ADD_METHOD( GetNumCourseGroups ) Luna::Register( L ); // Add global singleton if constructed already. If it's not constructed yet, diff --git a/stepmania/src/UnlockManager.cpp b/stepmania/src/UnlockManager.cpp index b5234664cb..ec21803679 100644 --- a/stepmania/src/UnlockManager.cpp +++ b/stepmania/src/UnlockManager.cpp @@ -512,6 +512,7 @@ public: static int FindCode( T* p, lua_State *L ) { CString sName = SArg(1); int i = p->FindCode(sName); if( i == -1 ) lua_pushnil(L); else lua_pushnumber(L, i); return 1; } static int UnlockCode( T* p, lua_State *L ) { int iCode = IArg(1); p->UnlockCode(iCode); return 0; } static int PreferUnlockCode( T* p, lua_State *L ) { int iCode = IArg(1); p->PreferUnlockCode(iCode); return 0; } + static int GetNumUnlocks( T* p, lua_State *L ) { lua_pushnumber( L, p->GetNumUnlocks() ); return 1; } static int GetSongsUnlockedByCode( T* p, lua_State *L ) { vector apSongs; @@ -536,6 +537,7 @@ public: ADD_METHOD( FindCode ) ADD_METHOD( UnlockCode ) ADD_METHOD( PreferUnlockCode ) + ADD_METHOD( GetNumUnlocks ) ADD_METHOD( GetSongsUnlockedByCode ) ADD_METHOD( GetStepsUnlockedByCode ) Luna::Register( L );