This commit is contained in:
Glenn Maynard
2006-08-09 21:49:06 +00:00
parent 8bdf73ed2d
commit 36ecadb215
2 changed files with 27 additions and 0 deletions
+23
View File
@@ -373,6 +373,29 @@ void Screenshot::LoadFromNode( const XNode* pNode )
highScore.LoadFromNode( pHighScore );
}
// lua start
#include "LuaBinding.h"
class LunaHighScore: public Luna<HighScore>
{
public:
LunaHighScore() { LUA->Register( Register ); }
static int GetName( T* p, lua_State *L ) { lua_pushstring(L, p->GetName() ); return 1; }
static int GetScore( T* p, lua_State *L ) { lua_pushnumber(L, p->GetScore() ); return 1; }
static void Register(lua_State *L)
{
ADD_METHOD( GetName );
ADD_METHOD( GetScore );
Luna<T>::Register( L );
}
};
LUA_REGISTER_CLASS( HighScore )
// lua end
/*
* (c) 2004 Chris Danford
* All rights reserved.
+4
View File
@@ -10,6 +10,7 @@
#include "RageUtil_AutoPtr.h"
class XNode;
struct lua_State;
struct HighScoreImpl;
struct HighScore
@@ -59,6 +60,9 @@ struct HighScore
void LoadFromNode( const XNode* pNode );
RString GetDisplayName() const;
// Lua
void PushSelf( lua_State *L );
private:
HiddenPtr<HighScoreImpl> m_Impl;
};