Add LifeMeterBattery:GetLivesLeft() Lua binding.
This commit is contained in:
@@ -231,6 +231,22 @@ void LifeMeterBattery::Update( float fDeltaTime )
|
||||
}
|
||||
}
|
||||
|
||||
// lua start
|
||||
#include "LuaBinding.h"
|
||||
|
||||
class LunaLifeMeterBattery: public Luna<LifeMeterBattery>
|
||||
{
|
||||
public:
|
||||
static int GetLivesLeft( T* p, lua_State *L ) { lua_pushnumber( L, p->GetLivesLeft() ); return 1; }
|
||||
|
||||
LunaLifeMeterBattery()
|
||||
{
|
||||
ADD_METHOD( GetLivesLeft );
|
||||
}
|
||||
};
|
||||
|
||||
LUA_REGISTER_DERIVED_CLASS( LifeMeterBattery, LifeMeter )
|
||||
|
||||
/*
|
||||
* (c) 2001-2004 Chris Danford
|
||||
* All rights reserved.
|
||||
|
||||
@@ -31,6 +31,10 @@ public:
|
||||
virtual float GetLife() const;
|
||||
|
||||
void Refresh();
|
||||
int GetLivesLeft() { return m_iLivesLeft; }
|
||||
|
||||
// Lua
|
||||
virtual void PushSelf( lua_State *L );
|
||||
|
||||
private:
|
||||
int m_iLivesLeft; // dead when 0
|
||||
|
||||
Reference in New Issue
Block a user