This commit is contained in:
Glenn Maynard
2005-07-09 08:26:20 +00:00
parent f47fef683c
commit d972df89f0
2 changed files with 35 additions and 1 deletions
+28
View File
@@ -6,6 +6,8 @@
#include "RageLog.h"
#include "PlayerState.h"
#include "ActorUtil.h"
#include "XmlFile.h"
#include "LuaManager.h"
REGISTER_ACTOR_CLASS( OptionIconRow )
@@ -22,6 +24,12 @@ OptionIconRow::OptionIconRow()
}
}
void OptionIconRow::LoadFromNode( const CString& sDir, const XNode* pNode )
{
Load();
ActorFrame::LoadFromNode( sDir, pNode );
}
struct OptionColumnEntry
{
@@ -130,6 +138,26 @@ void OptionIconRow::SetFromGameState( PlayerNumber pn )
m_OptionIcon[i].Set( pn, asTabs[i-1], false );
}
// lua start
#include "LuaBinding.h"
class LunaOptionIconRow: public Luna<OptionIconRow>
{
public:
LunaOptionIconRow() { LUA->Register( Register ); }
static int set( T* p, lua_State *L ) { p->SetFromGameState( (PlayerNumber) IArg(1) ); return 0; }
static void Register(lua_State *L)
{
ADD_METHOD( set )
Luna<T>::Register( L );
}
};
LUA_REGISTER_DERIVED_CLASS( OptionIconRow, ActorFrame )
// lua end
/*
* (c) 2002-2004 Chris Danford
* All rights reserved.
+7 -1
View File
@@ -7,7 +7,7 @@
#include "ActorFrame.h"
#include "OptionIcon.h"
struct PlayerOptions;
struct lua_State;
const unsigned NUM_OPTION_COLS = 8;
@@ -18,8 +18,14 @@ public:
OptionIconRow();
void Load();
virtual void LoadFromNode( const CString& sDir, const XNode* pNode );
void SetFromGameState( PlayerNumber pn );
//
// Commands
//
virtual void PushSelf( lua_State *L );
protected:
OptionIcon m_OptionIcon[NUM_OPTION_COLS];
};