[OptionRow] Added GetLayoutType() and GetSelectType() Lua bindings.

This commit is contained in:
AJ Kelly
2011-02-21 03:18:37 -06:00
parent 6a253689fb
commit d7caea9f0a
3 changed files with 7 additions and 0 deletions
+4
View File
@@ -944,8 +944,10 @@ class LunaOptionRow: public Luna<OptionRow>
public:
DEFINE_METHOD( FirstItemGoesDown, GetFirstItemGoesDown() )
static int GetChoiceInRowWithFocus( T* p, lua_State *L ) { lua_pushnumber( L, p->GetChoiceInRowWithFocus(Enum::Check<PlayerNumber>(L, 1)) ); return 1; }
DEFINE_METHOD( GetLayoutType, GetHandler()->m_Def.m_layoutType )
static int GetName( T* p, lua_State *L ) { lua_pushstring( L, p->GetHandler()->m_Def.m_sName ); return 1; }
static int GetNumChoices( T* p, lua_State *L ) { lua_pushnumber( L, p->GetHandler()->m_Def.m_vsChoices.size() ); return 1; }
DEFINE_METHOD( GetSelectType, GetHandler()->m_Def.m_selectType )
DEFINE_METHOD( GetRowTitle, GetRowTitle() )
static int HasFocus( T* p, lua_State *L ) { lua_pushboolean( L, p->GetRowHasFocus(Enum::Check<PlayerNumber>(L, 1)) ); return 1; }
static int OneChoiceForAllPlayers( T* p, lua_State *L ) { lua_pushboolean( L, p->GetHandler()->m_Def.m_bOneChoiceForAllPlayers ); return 1; }
@@ -954,9 +956,11 @@ public:
{
ADD_METHOD( FirstItemGoesDown );
ADD_METHOD( GetChoiceInRowWithFocus );
ADD_METHOD( GetLayoutType );
ADD_METHOD( GetName );
ADD_METHOD( GetNumChoices );
ADD_METHOD( GetRowTitle );
ADD_METHOD( GetSelectType );
ADD_METHOD( HasFocus );
ADD_METHOD( OneChoiceForAllPlayers );
}
+2
View File
@@ -36,6 +36,7 @@ static const char *SelectTypeNames[] = {
};
XToString( SelectType );
StringToX( SelectType );
LuaXType( SelectType );
static const char *LayoutTypeNames[] = {
"ShowAllInRow",
@@ -43,6 +44,7 @@ static const char *LayoutTypeNames[] = {
};
XToString( LayoutType );
StringToX( LayoutType );
LuaXType( LayoutType );
RString OptionRowHandler::OptionTitle() const
{