diff --git a/stepmania/src/ScreenOptions.cpp b/stepmania/src/ScreenOptions.cpp index ca15a14827..e74e7806fa 100644 --- a/stepmania/src/ScreenOptions.cpp +++ b/stepmania/src/ScreenOptions.cpp @@ -1301,6 +1301,26 @@ int ScreenOptions::GetCurrentRow( PlayerNumber pn ) const return r; } +// lua start +#include "LuaBinding.h" + +class LunaScreenOptions: public Luna +{ +public: + LunaScreenOptions() { LUA->Register( Register ); } + + static int GetCurrentRow( T* p, lua_State *L ) { lua_pushnumber( L, p->GetCurrentRow((PlayerNumber) IArg(1)) ); return 1; } + static void Register( Lua *L ) + { + ADD_METHOD( GetCurrentRow ); + + Luna::Register( L ); + } +}; + +LUA_REGISTER_DERIVED_CLASS( ScreenOptions, ScreenWithMenuElements ) +// lua end + /* * (c) 2001-2004 Chris Danford, Glenn Maynard diff --git a/stepmania/src/ScreenOptions.h b/stepmania/src/ScreenOptions.h index 04264f864d..9422e58c3e 100644 --- a/stepmania/src/ScreenOptions.h +++ b/stepmania/src/ScreenOptions.h @@ -89,6 +89,13 @@ protected: bool IsOnLastRow( PlayerNumber pn ) const; bool AllAreOnLastRow() const; +public: + // + // Lua + // + virtual void PushSelf( lua_State *L ); + friend class LunaScreenOptions; + protected: // derived classes need access to these void SetOptionIcon( PlayerNumber pn, int iRow, CString sText, GameCommand &gc );