[WheelBase] Add GetCurrentIndex and GetNumItems Lua bindings.
This commit is contained in:
@@ -524,6 +524,8 @@ public:
|
||||
static int IsSettled( T* p, lua_State *L ){ lua_pushboolean( L, p->IsSettled() ); return 1; }
|
||||
static int IsLocked( T* p, lua_State *L ){ lua_pushboolean( L, p->WheelIsLocked() ); return 1; }
|
||||
static int SetOpenSection( T* p, lua_State *L ){ p->SetOpenSection( SArg(1) ); return 0; }
|
||||
static int GetCurrentIndex( T* p, lua_State *L ){ lua_pushnumber( L, p->GetCurrentIndex() ); return 1; }
|
||||
static int GetNumItems( T* p, lua_State *L ){ lua_pushnumber( L, p->GetNumItems() ); return 1; }
|
||||
// evil shit
|
||||
//static int Move( T* p, lua_State *L ){ p->Move( IArg(1) ); return 0; }
|
||||
//static int ChangeMusic( T* p, lua_State *L ){ p->ChangeMusicUnlessLocked( IArg(1) ); return 0; }
|
||||
@@ -534,6 +536,8 @@ public:
|
||||
ADD_METHOD( IsSettled );
|
||||
ADD_METHOD( IsLocked );
|
||||
ADD_METHOD( SetOpenSection );
|
||||
ADD_METHOD( GetCurrentIndex );
|
||||
ADD_METHOD( GetNumItems );
|
||||
// evil shit
|
||||
//ADD_METHOD( Move );
|
||||
//ADD_METHOD( ChangeMusic );
|
||||
|
||||
+2
-2
@@ -1,5 +1,3 @@
|
||||
/* WheelBase - A wheel with data elements. */
|
||||
|
||||
#ifndef WHEELBASE_H
|
||||
#define WHEELBASE_H
|
||||
|
||||
@@ -16,6 +14,7 @@
|
||||
|
||||
#define NUM_WHEEL_ITEMS ((int)ceil(NUM_WHEEL_ITEMS_TO_DRAW+2))
|
||||
|
||||
/** @brief A wheel with data elements. */
|
||||
class WheelBase : public ActorFrame
|
||||
{
|
||||
public:
|
||||
@@ -48,6 +47,7 @@ public:
|
||||
WheelItemBaseData* LastSelected();
|
||||
WheelItemBase *GetWheelItem( int i ) { if( i < 0 || i >= (int) m_WheelBaseItems.size() ) return NULL; return m_WheelBaseItems[i]; }
|
||||
RString GetExpandedSectionName() { return m_sExpandedSectionName; }
|
||||
int GetCurrentIndex() { return m_iSelection; }
|
||||
|
||||
// Lua
|
||||
void PushSelf( lua_State *L );
|
||||
|
||||
Reference in New Issue
Block a user