This commit is contained in:
Glenn Maynard
2006-09-01 23:21:19 +00:00
parent ee1d3212af
commit 6d829011a3
2 changed files with 27 additions and 0 deletions
+21
View File
@@ -179,6 +179,27 @@ void MenuTimer::SetText( float fSeconds )
LUA->Release(L);
}
// lua start
#include "LuaBinding.h"
class LunaMenuTimer: public Luna<MenuTimer>
{
public:
LunaMenuTimer() { LUA->Register( Register ); }
static int setseconds( T* p, lua_State *L ) { p->SetSeconds(FArg(1)); return 0; }
static int pause( T* p, lua_State *L ) { p->Pause(); return 0; }
static void Register(lua_State *L) {
ADD_METHOD( setseconds );
ADD_METHOD( pause );
Luna<T>::Register( L );
}
};
LUA_REGISTER_DERIVED_CLASS( MenuTimer, ActorFrame )
// lua end
/*
* (c) 2002-2004 Chris Danford
* All rights reserved.
+6
View File
@@ -8,6 +8,7 @@
#include "RageSound.h"
#include "ThemeMetric.h"
class LuaClass;
class MenuTimer : public ActorFrame
{
@@ -25,6 +26,11 @@ public:
void Stall(); // pause countdown for a sec
void EnableStealth( bool bStealth ); // make timer invisible and silent
//
// Lua
//
virtual void PushSelf( lua_State *L );
protected:
float m_fSecondsLeft;
float m_fStallSeconds, m_fStallSecondsLeft;