bound alignment constants
This commit is contained in:
+16
-18
@@ -32,6 +32,20 @@ Actor *Actor::Copy() const { return new Actor(*this); }
|
||||
|
||||
static float g_fCabinetLights[NUM_CABINET_LIGHTS];
|
||||
|
||||
static const char *HorizAlignNames[] = {
|
||||
"Left",
|
||||
"Center",
|
||||
"Right"
|
||||
};
|
||||
LuaXType( HorizAlign );
|
||||
|
||||
static const char *VertAlignNames[] = {
|
||||
"Top",
|
||||
"Middle",
|
||||
"Bottom"
|
||||
};
|
||||
LuaXType( VertAlign );
|
||||
|
||||
void Actor::SetBGMTime( float fTime, float fBeat )
|
||||
{
|
||||
g_fCurrentBGMTime = fTime;
|
||||
@@ -829,22 +843,6 @@ void Actor::ScaleTo( const RectF &rect, StretchType st )
|
||||
SetZoom( fNewZoom );
|
||||
}
|
||||
|
||||
void Actor::SetHorizAlignString( const RString &s )
|
||||
{
|
||||
if (s.EqualsNoCase("left")) this->SetHorizAlign( HorizAlign_Left ); /* call derived */
|
||||
else if(s.EqualsNoCase("center")) this->SetHorizAlign( HorizAlign_Center );
|
||||
else if(s.EqualsNoCase("right")) this->SetHorizAlign( HorizAlign_Right );
|
||||
else ASSERT(0);
|
||||
}
|
||||
|
||||
void Actor::SetVertAlignString( const RString &s )
|
||||
{
|
||||
if (s.EqualsNoCase("top")) this->SetVertAlign( VertAlign_Top ); /* call derived */
|
||||
else if(s.EqualsNoCase("middle")) this->SetVertAlign( VertAlign_Middle );
|
||||
else if(s.EqualsNoCase("bottom")) this->SetVertAlign( VertAlign_Bottom );
|
||||
else ASSERT(0);
|
||||
}
|
||||
|
||||
void Actor::SetEffectClockString( const RString &s )
|
||||
{
|
||||
if (s.EqualsNoCase("timer")) this->SetEffectClock( CLOCK_TIMER );
|
||||
@@ -1388,8 +1386,8 @@ public:
|
||||
static int pitch( T* p, lua_State *L ) { p->AddRotationP(FArg(1)); return 0; }
|
||||
static int roll( T* p, lua_State *L ) { p->AddRotationR(FArg(1)); return 0; }
|
||||
static int shadowlength( T* p, lua_State *L ) { p->SetShadowLength(FArg(1)); return 0; }
|
||||
static int horizalign( T* p, lua_State *L ) { p->SetHorizAlignString(SArg(1)); return 0; }
|
||||
static int vertalign( T* p, lua_State *L ) { p->SetVertAlignString(SArg(1)); return 0; }
|
||||
static int horizalign( T* p, lua_State *L ) { p->SetHorizAlign(Enum::Check<HorizAlign>(L, 1)); return 0; }
|
||||
static int vertalign( T* p, lua_State *L ) { p->SetVertAlign(Enum::Check<VertAlign>(L, 1)); return 0; }
|
||||
static int luaeffect( T* p, lua_State *L ) { p->SetEffectLua(SArg(1)); return 0; }
|
||||
static int diffuseblink( T* p, lua_State *L ) { p->SetEffectDiffuseBlink(); return 0; }
|
||||
static int diffuseshift( T* p, lua_State *L ) { p->SetEffectDiffuseShift(); return 0; }
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "RageTypes.h"
|
||||
#include "RageUtil_AutoPtr.h"
|
||||
#include "LuaReference.h"
|
||||
#include "EnumHelper.h"
|
||||
#include <map>
|
||||
class XNode;
|
||||
struct lua_State;
|
||||
@@ -30,6 +31,7 @@ enum HorizAlign
|
||||
NUM_HorizAlign,
|
||||
HorizAlign_Invalid
|
||||
};
|
||||
LuaDeclareType( HorizAlign );
|
||||
|
||||
enum VertAlign
|
||||
{
|
||||
@@ -39,6 +41,8 @@ enum VertAlign
|
||||
NUM_VertAlign,
|
||||
VertAlign_Invalid
|
||||
};
|
||||
LuaDeclareType( VertAlign );
|
||||
|
||||
#define align_left HorizAlign_Left
|
||||
#define align_center HorizAlign_Center
|
||||
#define align_right HorizAlign_Right
|
||||
@@ -251,10 +255,7 @@ public:
|
||||
// Alignment settings. These need to be virtual for BitmapText
|
||||
//
|
||||
virtual void SetHorizAlign( HorizAlign ha ) { m_HorizAlign = ha; }
|
||||
void SetHorizAlignString( const RString &s ); // convenience
|
||||
|
||||
virtual void SetVertAlign( VertAlign va ) { m_VertAlign = va; }
|
||||
void SetVertAlignString( const RString &s ); // convenience
|
||||
|
||||
|
||||
//
|
||||
|
||||
@@ -430,8 +430,6 @@ void ActorUtil::ParseActorCommands( Lua *L, const RString &sCommands )
|
||||
s << "\tself:" << sName << "(";
|
||||
|
||||
bool bFirstParamIsString =
|
||||
sName == "horizalign" ||
|
||||
sName == "vertalign" ||
|
||||
sName == "effectclock" ||
|
||||
sName == "playcommand" ||
|
||||
sName == "queuecommand" ||
|
||||
|
||||
Reference in New Issue
Block a user