[SongManager] Add SongToPreferredSortSectionName(song), WasLoadedFromAdditionalSongs(song), and WasLoadedFromAdditionalCourses(course) Lua bindings

This commit is contained in:
AJ Kelly
2011-08-27 15:23:20 -05:00
parent d5979dab6a
commit 183888f4f1
3 changed files with 25 additions and 7 deletions
+2
View File
@@ -16,6 +16,8 @@ StepMania 5.0 $next | 2011????
GetPopularSongs() Lua bindings. [AJ]
* [SongManager] Added GetPreferredSortSongs(), GetPreferredSortCourses(courseType,bIncludeAutogen),
and GetPopularCourses(courseType) Lua bindings. [AJ]
* [SongManager] Add SongToPreferredSortSectionName(song), WasLoadedFromAdditionalSongs(song),
and WasLoadedFromAdditionalCourses(course) Lua bindings. [AJ]
2011/08/23
----------
+21 -5
View File
@@ -1987,6 +1987,24 @@ public:
LuaHelpers::CreateTableFromArray<Course*>( v, L );
return 1;
}
static int SongToPreferredSortSectionName( T* p, lua_State *L )
{
const Song* pSong = Luna<Song>::check(L,1);
lua_pushstring(L, p->SongToPreferredSortSectionName(pSong));
return 1;
}
static int WasLoadedFromAdditionalSongs( T* p, lua_State *L )
{
const Song* pSong = Luna<Song>::check(L,1);
lua_pushboolean(L, p->WasLoadedFromAdditionalSongs(pSong));
return 1;
}
static int WasLoadedFromAdditionalCourses( T* p, lua_State *L )
{
const Course* pCourse = Luna<Course>::check(L,1);
lua_pushboolean(L, p->WasLoadedFromAdditionalCourses(pCourse));
return 1;
}
LunaSongManager()
{
@@ -2025,11 +2043,9 @@ public:
ADD_METHOD( DoesCourseGroupExist );
ADD_METHOD( GetPopularSongs );
ADD_METHOD( GetPopularCourses );
//ADD_METHOD( GetSongsOfCurrentGame );
//ADD_METHOD( GetAllSongsOfCurrentGame );
//ADD_METHOD( SongToPreferredSortSectionName );
//ADD_METHOD( WasLoadedFromAdditionalSongs );
//ADD_METHOD( WasLoadedFromAdditionalCourses );
ADD_METHOD( SongToPreferredSortSectionName );
ADD_METHOD( WasLoadedFromAdditionalSongs );
ADD_METHOD( WasLoadedFromAdditionalCourses );
}
};
+2 -2
View File
@@ -102,7 +102,7 @@ public:
* a song is chosen.
* @return all of the popular songs. */
const vector<Song*> &GetPopularSongs() const { return m_pPopularSongs; }
/**
* @brief Retrieve all of the songs in a group that have at least one
* valid step for the current gametype.
@@ -114,7 +114,7 @@ public:
* valid step for the current gametype.
* @return the songs within the game that have at least one valid Step. */
const vector<Song *> &GetAllSongsOfCurrentGame() const;
void GetPreferredSortSongs( vector<Song*> &AddTo ) const;
RString SongToPreferredSortSectionName( const Song *pSong ) const;
const vector<Course*> &GetPopularCourses( CourseType ct ) const { return m_pPopularCourses[ct]; }