diff --git a/stepmania/src/GradeDisplay.cpp b/stepmania/src/GradeDisplay.cpp index 943936e4dc..aa696a70d0 100644 --- a/stepmania/src/GradeDisplay.cpp +++ b/stepmania/src/GradeDisplay.cpp @@ -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 +{ +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(L, 1); + Grade g = Enum::Check(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. diff --git a/stepmania/src/GradeDisplay.h b/stepmania/src/GradeDisplay.h index d514c53bfb..c4e52c58e8 100644 --- a/stepmania/src/GradeDisplay.h +++ b/stepmania/src/GradeDisplay.h @@ -6,7 +6,7 @@ #include "Sprite.h" #include "Grade.h" #include "PlayerNumber.h" - +struct lua_State; class GradeDisplay : public Sprite { @@ -16,6 +16,12 @@ public: protected: int GetFrameIndex( PlayerNumber pn, Grade g ); + +public: + virtual GradeDisplay *Copy() const; + + // Lua + void PushSelf( lua_State *L ); }; #endif