add lua bindings

This commit is contained in:
Chris Danford
2005-07-29 22:59:11 +00:00
parent 5d35c1dc18
commit c9718db4b6
7 changed files with 87 additions and 8 deletions
+31
View File
@@ -13,10 +13,13 @@
#include "Style.h"
#include "RageTexture.h"
#include "CourseEntryDisplay.h"
#include "ActorUtil.h"
const int MAX_VISIBLE_ITEMS = 5;
const int MAX_ITEMS = MAX_VISIBLE_ITEMS+2;
REGISTER_ACTOR_CLASS( CourseContentsList )
CourseContentsList::CourseContentsList()
{
for( int i=0; i<MAX_ITEMS; i++ )
@@ -40,6 +43,13 @@ void CourseContentsList::Load()
}
}
void CourseContentsList::LoadFromNode( const CString& sDir, const XNode* pNode )
{
ActorScroller::LoadFromNode( sDir, pNode );
Load();
}
void CourseContentsList::SetFromGameState()
{
RemoveAllChildren();
@@ -109,6 +119,27 @@ void CourseContentsList::TweenInAfterChangedCourse()
*/
}
// lua start
#include "LuaBinding.h"
class LunaCourseContentsList: public Luna<CourseContentsList>
{
public:
LunaCourseContentsList() { LUA->Register( Register ); }
static int SetFromGameState( T* p, lua_State *L ) { p->SetFromGameState(); return 0; }
static void Register(lua_State *L)
{
ADD_METHOD( SetFromGameState )
Luna<T>::Register( L );
}
};
LUA_REGISTER_DERIVED_CLASS( CourseContentsList, ActorScroller )
// lua end
/*
* (c) 2001-2004 Chris Danford
* All rights reserved.