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