add TrySelectCourse so that SelectCourse can be bound without having to change its protection
This commit is contained in:
+10
-2
@@ -1622,13 +1622,21 @@ public:
|
|||||||
static int SelectSong( T* p, lua_State *L )
|
static int SelectSong( T* p, lua_State *L )
|
||||||
{
|
{
|
||||||
if( lua_isnil(L,1) ) { lua_pushboolean( L, false ); }
|
if( lua_isnil(L,1) ) { lua_pushboolean( L, false ); }
|
||||||
else { Song *pS = Luna<Song>::check( L, 1, true ); lua_pushboolean( L, p->SelectSong( pS ) ); }
|
else
|
||||||
|
{
|
||||||
|
Song *pS = Luna<Song>::check( L, 1, true );
|
||||||
|
lua_pushboolean( L, p->SelectSong( pS ) );
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
static int SelectCourse( T* p, lua_State *L )
|
static int SelectCourse( T* p, lua_State *L )
|
||||||
{
|
{
|
||||||
if( lua_isnil(L,1) ) { lua_pushboolean( L, false ); }
|
if( lua_isnil(L,1) ) { lua_pushboolean( L, false ); }
|
||||||
else { Course *pC = Luna<Course>::check( L, 1, true ); lua_pushboolean( L, p->SelectCourse( pC ) ); }
|
else
|
||||||
|
{
|
||||||
|
Course *pC = Luna<Course>::check( L, 1, true );
|
||||||
|
lua_pushboolean( L, p->TrySelectCourse( pC ) );
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ public:
|
|||||||
Song *GetPreferredSelectionForRandomOrPortal();
|
Song *GetPreferredSelectionForRandomOrPortal();
|
||||||
|
|
||||||
bool SelectSong( const Song *p );
|
bool SelectSong( const Song *p );
|
||||||
|
bool TrySelectCourse( const Course *p ){ return TrySelectCourse(p); }
|
||||||
bool SelectSection( const RString & SectionName );
|
bool SelectSection( const RString & SectionName );
|
||||||
void SetOpenSection( RString group );
|
void SetOpenSection( RString group );
|
||||||
SortOrder GetSortOrder() const { return m_SortOrder; }
|
SortOrder GetSortOrder() const { return m_SortOrder; }
|
||||||
|
|||||||
Reference in New Issue
Block a user