update registration for BitmapText types
This commit is contained in:
@@ -12,9 +12,6 @@
|
||||
#include "ActorUtil.h" // for BeginHandleArgs
|
||||
#include "LuaBinding.h"
|
||||
|
||||
// lua start
|
||||
LUA_REGISTER_CLASS( BitmapText )
|
||||
// lua end
|
||||
REGISTER_ACTOR_CLASS( BitmapText )
|
||||
|
||||
/*
|
||||
@@ -841,6 +838,36 @@ void ColorBitmapText::SetMaxLines( int iNumLines, int iDirection )
|
||||
}
|
||||
BuildChars();
|
||||
}
|
||||
|
||||
// lua start
|
||||
|
||||
template<class T>
|
||||
class LunaBitmapText : public Luna<T>
|
||||
{
|
||||
public:
|
||||
LunaBitmapText() { LUA->Register( Register ); }
|
||||
|
||||
static int wrapwidthpixels( T* p, lua_State *L ) { p->SetWrapWidthPixels( IArg(1) ); return 0; }
|
||||
static int maxwidth( T* p, lua_State *L ) { p->SetMaxWidth( FArg(1) ); return 0; }
|
||||
static int maxheight( T* p, lua_State *L ) { p->SetMaxHeight( FArg(1) ); return 0; }
|
||||
static int settext( T* p, lua_State *L ) { p->SetText( SArg(1) ); return 0; }
|
||||
static int GetText( T* p, lua_State *L ) { lua_pushstring( L, p->GetText() ); return 1; }
|
||||
|
||||
static void Register(lua_State *L)
|
||||
{
|
||||
ADD_METHOD( wrapwidthpixels )
|
||||
ADD_METHOD( maxwidth )
|
||||
ADD_METHOD( maxheight )
|
||||
ADD_METHOD( settext )
|
||||
ADD_METHOD( GetText )
|
||||
Luna<T>::Register( L );
|
||||
}
|
||||
};
|
||||
|
||||
LUA_REGISTER_DERIVED_CLASS( BitmapText, Actor )
|
||||
|
||||
// lua end
|
||||
|
||||
/*
|
||||
* (c) 2003-2004 Chris Danford, Charles Lohr
|
||||
* All rights reserved.
|
||||
|
||||
@@ -8,31 +8,6 @@ class RageTexture;
|
||||
|
||||
class Font;
|
||||
|
||||
|
||||
template<class T>
|
||||
class LunaBitmapText : public LunaActor<T>
|
||||
{
|
||||
public:
|
||||
LunaBitmapText() { LUA->Register( Register ); }
|
||||
|
||||
static int wrapwidthpixels( T* p, lua_State *L ) { p->SetWrapWidthPixels( IArg(1) ); return 0; }
|
||||
static int maxwidth( T* p, lua_State *L ) { p->SetMaxWidth( FArg(1) ); return 0; }
|
||||
static int maxheight( T* p, lua_State *L ) { p->SetMaxHeight( FArg(1) ); return 0; }
|
||||
static int settext( T* p, lua_State *L ) { p->SetText( SArg(1) ); return 0; }
|
||||
static int GetText( T* p, lua_State *L ) { lua_pushstring( L, p->GetText() ); return 1; }
|
||||
|
||||
static void Register(lua_State *L)
|
||||
{
|
||||
ADD_METHOD( wrapwidthpixels )
|
||||
ADD_METHOD( maxwidth )
|
||||
ADD_METHOD( maxheight )
|
||||
ADD_METHOD( settext )
|
||||
ADD_METHOD( GetText )
|
||||
LunaActor<T>::Register( L );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class BitmapText : public Actor
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -75,7 +75,7 @@ void HelpDisplay::Update( float fDeltaTime )
|
||||
|
||||
|
||||
template<class T>
|
||||
class LunaHelpDisplay : public LunaBitmapText<T>
|
||||
class LunaHelpDisplay : public Luna<T>
|
||||
{
|
||||
public:
|
||||
LunaHelpDisplay() { LUA->Register( Register ); }
|
||||
@@ -119,11 +119,11 @@ public:
|
||||
{
|
||||
ADD_METHOD( settips )
|
||||
ADD_METHOD( gettips )
|
||||
LunaActor<T>::Register( L );
|
||||
Luna<T>::Register( L );
|
||||
}
|
||||
};
|
||||
|
||||
LUA_REGISTER_CLASS( HelpDisplay )
|
||||
LUA_REGISTER_DERIVED_CLASS( HelpDisplay, BitmapText )
|
||||
|
||||
|
||||
#include "song.h"
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
#include "XmlFile.h"
|
||||
#include "ActorUtil.h"
|
||||
|
||||
// lua start
|
||||
LUA_REGISTER_CLASS( RollingNumbers )
|
||||
// lua end
|
||||
REGISTER_ACTOR_CLASS( RollingNumbers )
|
||||
|
||||
RollingNumbers::RollingNumbers()
|
||||
@@ -60,6 +57,22 @@ void RollingNumbers::UpdateText()
|
||||
SetText( ssprintf(m_sFormat, m_fCurrentNumber) );
|
||||
}
|
||||
|
||||
// lua start
|
||||
template<class T>
|
||||
class LunaRollingNumbers : public Luna<T>
|
||||
{
|
||||
public:
|
||||
LunaRollingNumbers() { LUA->Register( Register ); }
|
||||
|
||||
static void Register(lua_State *L)
|
||||
{
|
||||
Luna<T>::Register( L );
|
||||
}
|
||||
};
|
||||
|
||||
LUA_REGISTER_DERIVED_CLASS( RollingNumbers, BitmapText )
|
||||
|
||||
// lua end
|
||||
|
||||
/*
|
||||
* (c) 2001-2004 Chris Danford
|
||||
|
||||
@@ -5,20 +5,6 @@
|
||||
|
||||
#include "BitmapText.h"
|
||||
|
||||
|
||||
template<class T>
|
||||
class LunaRollingNumbers : public LunaBitmapText<T>
|
||||
{
|
||||
public:
|
||||
LunaRollingNumbers() { LUA->Register( Register ); }
|
||||
|
||||
static void Register(lua_State *L)
|
||||
{
|
||||
LunaBitmapText<T>::Register( L );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class RollingNumbers : public BitmapText
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -7,9 +7,6 @@
|
||||
#include "StatsManager.h"
|
||||
#include "ActorUtil.h"
|
||||
|
||||
// lua start
|
||||
LUA_REGISTER_CLASS( ScoreDisplayAliveTime )
|
||||
// lua end
|
||||
REGISTER_ACTOR_CLASS( ScoreDisplayAliveTime )
|
||||
|
||||
|
||||
@@ -60,6 +57,23 @@ void ScoreDisplayAliveTime::UpdateNumber()
|
||||
SetText( SecondsToMMSSMsMs(fSecsIntoPlay) );
|
||||
}
|
||||
|
||||
// lua start
|
||||
template<class T>
|
||||
class LunaScoreDisplayAliveTime : public Luna<T>
|
||||
{
|
||||
public:
|
||||
LunaScoreDisplayAliveTime() { LUA->Register( Register ); }
|
||||
|
||||
static void Register(lua_State *L)
|
||||
{
|
||||
Luna<T>::Register( L );
|
||||
}
|
||||
};
|
||||
|
||||
LUA_REGISTER_DERIVED_CLASS( ScoreDisplayAliveTime, BitmapText )
|
||||
|
||||
// lua end
|
||||
|
||||
/*
|
||||
* (c) 2001-2004 Chris Danford
|
||||
* All rights reserved.
|
||||
|
||||
@@ -8,19 +8,6 @@
|
||||
#include "PlayerNumber.h"
|
||||
|
||||
|
||||
template<class T>
|
||||
class LunaScoreDisplayAliveTime : public LunaBitmapText<T>
|
||||
{
|
||||
public:
|
||||
LunaScoreDisplayAliveTime() { LUA->Register( Register ); }
|
||||
|
||||
static void Register(lua_State *L)
|
||||
{
|
||||
LunaBitmapText<T>::Register( L );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class ScoreDisplayAliveTime : public BitmapText
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -9,9 +9,6 @@
|
||||
#include "ActorUtil.h"
|
||||
#include "StatsManager.h"
|
||||
|
||||
// lua start
|
||||
LUA_REGISTER_CLASS( ScoreDisplayCalories )
|
||||
// lua end
|
||||
REGISTER_ACTOR_CLASS( ScoreDisplayCalories )
|
||||
|
||||
ScoreDisplayCalories::ScoreDisplayCalories()
|
||||
@@ -69,6 +66,23 @@ void ScoreDisplayCalories::UpdateNumber()
|
||||
SetTargetNumber( fCals );
|
||||
}
|
||||
|
||||
// lua start
|
||||
template<class T>
|
||||
class LunaScoreDisplayCalories : public Luna<T>
|
||||
{
|
||||
public:
|
||||
LunaScoreDisplayCalories() { LUA->Register( Register ); }
|
||||
|
||||
static void Register(lua_State *L)
|
||||
{
|
||||
Luna<T>::Register( L );
|
||||
}
|
||||
};
|
||||
|
||||
LUA_REGISTER_DERIVED_CLASS( ScoreDisplayCalories, BitmapText )
|
||||
|
||||
// lua end
|
||||
|
||||
/*
|
||||
* (c) 2001-2004 Chris Danford
|
||||
* All rights reserved.
|
||||
|
||||
@@ -7,19 +7,6 @@
|
||||
#include "PlayerNumber.h"
|
||||
|
||||
|
||||
template<class T>
|
||||
class LunaScoreDisplayCalories : public LunaRollingNumbers<T>
|
||||
{
|
||||
public:
|
||||
LunaScoreDisplayCalories() { LUA->Register( Register ); }
|
||||
|
||||
static void Register(lua_State *L)
|
||||
{
|
||||
LunaRollingNumbers<T>::Register( L );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class ScoreDisplayCalories : public RollingNumbers
|
||||
{
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user