diff --git a/stepmania/src/OptionIconRow.cpp b/stepmania/src/OptionIconRow.cpp index 75727ce986..5816532d2a 100644 --- a/stepmania/src/OptionIconRow.cpp +++ b/stepmania/src/OptionIconRow.cpp @@ -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 +{ +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::Register( L ); + } +}; + +LUA_REGISTER_DERIVED_CLASS( OptionIconRow, ActorFrame ) + +// lua end + /* * (c) 2002-2004 Chris Danford * All rights reserved. diff --git a/stepmania/src/OptionIconRow.h b/stepmania/src/OptionIconRow.h index a814c692ea..9cc1a3bb85 100644 --- a/stepmania/src/OptionIconRow.h +++ b/stepmania/src/OptionIconRow.h @@ -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]; };