diff --git a/src/WheelBase.cpp b/src/WheelBase.cpp index 9e5bf8bbe6..e46b230468 100644 --- a/src/WheelBase.cpp +++ b/src/WheelBase.cpp @@ -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 ); diff --git a/src/WheelBase.h b/src/WheelBase.h index d6149f638c..317b24a6d4 100644 --- a/src/WheelBase.h +++ b/src/WheelBase.h @@ -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 );