This commit is contained in:
Glenn Maynard
2005-12-09 21:39:41 +00:00
parent 37f82b43f7
commit 5c5183b953
2 changed files with 27 additions and 0 deletions
+20
View File
@@ -1301,6 +1301,26 @@ int ScreenOptions::GetCurrentRow( PlayerNumber pn ) const
return r;
}
// lua start
#include "LuaBinding.h"
class LunaScreenOptions: public Luna<ScreenOptions>
{
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<T>::Register( L );
}
};
LUA_REGISTER_DERIVED_CLASS( ScreenOptions, ScreenWithMenuElements )
// lua end
/*
* (c) 2001-2004 Chris Danford, Glenn Maynard
+7
View File
@@ -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 );