Add ChangeSort method to Lua MusicWheel

This commit is contained in:
Devin J. Pohly
2013-03-24 00:12:17 -04:00
parent b7d74c6c0b
commit 4c2bfd7dc9
2 changed files with 14 additions and 0 deletions
+3
View File
@@ -2610,6 +2610,9 @@ save yourself some time, copy this for undocumented things:
</Function> </Function>
</Class> </Class>
<Class name='MusicWheel'> <Class name='MusicWheel'>
<Function name='ChangeSort' return='bool' arguments='SortOrder so'>
Changes the sort order of the wheel. Returns <code>true</code> if the order was changed.
</Function>
<Function name='IsRouletting' return='bool' arguments=''> <Function name='IsRouletting' return='bool' arguments=''>
Returns <code>true</code> if the MusicWheel is currently handling Roulette selection. Returns <code>true</code> if the MusicWheel is currently handling Roulette selection.
</Function> </Function>
+11
View File
@@ -1626,6 +1626,16 @@ void MusicWheel::FinishChangingSorts()
class LunaMusicWheel: public Luna<MusicWheel> class LunaMusicWheel: public Luna<MusicWheel>
{ {
public: public:
static int ChangeSort( T* p, lua_State *L )
{
if( lua_isnil(L,1) ) { lua_pushboolean( L, false ); }
else
{
SortOrder so = Enum::Check<SortOrder>(L, 1);
lua_pushboolean( L, p->ChangeSort( so ) );
}
return 1;
}
static int IsRouletting( T* p, lua_State *L ){ lua_pushboolean( L, p->IsRouletting() ); return 1; } static int IsRouletting( T* p, lua_State *L ){ lua_pushboolean( L, p->IsRouletting() ); return 1; }
static int SelectSong( T* p, lua_State *L ) static int SelectSong( T* p, lua_State *L )
{ {
@@ -1651,6 +1661,7 @@ public:
LunaMusicWheel() LunaMusicWheel()
{ {
ADD_METHOD( ChangeSort );
ADD_METHOD( IsRouletting ); ADD_METHOD( IsRouletting );
ADD_METHOD( SelectSong ); ADD_METHOD( SelectSong );
ADD_METHOD( SelectCourse ); ADD_METHOD( SelectCourse );