add Lua bindings
This commit is contained in:
@@ -3,6 +3,9 @@
|
|||||||
#include "RageUtil.h"
|
#include "RageUtil.h"
|
||||||
#include "arch/Dialog/Dialog.h"
|
#include "arch/Dialog/Dialog.h"
|
||||||
#include "RageLog.h"
|
#include "RageLog.h"
|
||||||
|
#include "ActorUtil.h"
|
||||||
|
|
||||||
|
REGISTER_ACTOR_CLASS( GradeDisplay )
|
||||||
|
|
||||||
void GradeDisplay::Load( RageTextureID ID )
|
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
|
* (c) 2001-2002 Chris Danford
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#include "Sprite.h"
|
#include "Sprite.h"
|
||||||
#include "Grade.h"
|
#include "Grade.h"
|
||||||
#include "PlayerNumber.h"
|
#include "PlayerNumber.h"
|
||||||
|
struct lua_State;
|
||||||
|
|
||||||
class GradeDisplay : public Sprite
|
class GradeDisplay : public Sprite
|
||||||
{
|
{
|
||||||
@@ -16,6 +16,12 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
int GetFrameIndex( PlayerNumber pn, Grade g );
|
int GetFrameIndex( PlayerNumber pn, Grade g );
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual GradeDisplay *Copy() const;
|
||||||
|
|
||||||
|
// Lua
|
||||||
|
void PushSelf( lua_State *L );
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user