add Lua bindings

This commit is contained in:
Chris Danford
2007-07-13 20:31:13 +00:00
parent 544f922c3a
commit 5cdb22168e
2 changed files with 40 additions and 1 deletions
+33
View File
@@ -3,6 +3,9 @@
#include "RageUtil.h"
#include "arch/Dialog/Dialog.h"
#include "RageLog.h"
#include "ActorUtil.h"
REGISTER_ACTOR_CLASS( GradeDisplay )
void GradeDisplay::Load( RageTextureID ID )
{
@@ -67,6 +70,36 @@ void GradeDisplay::SetGrade( PlayerNumber pn, Grade g )
}
}
// lua start
#include "LuaBinding.h"
class LunaGradeDisplay: public Luna<GradeDisplay>
{
public:
static int Load( T* p, lua_State *L )
{
RageTextureID id = SArg(1);
p->Load( id );
return 0;
}
static int SetGrade( T* p, lua_State *L )
{
PlayerNumber pn = Enum::Check<PlayerNumber>(L, 1);
Grade g = Enum::Check<Grade>(L, 2);
p->SetGrade( pn, g );
return 0;
}
LunaGradeDisplay()
{
ADD_METHOD( Load );
ADD_METHOD( SetGrade );
}
};
LUA_REGISTER_DERIVED_CLASS( GradeDisplay, Sprite )
// lua end
/*
* (c) 2001-2002 Chris Danford
* All rights reserved.