Remove WheelIndex. Bind the m_WheelBaseItems instead. To tween

each wheel item separately, do it in eg. WheelOnCommand, and
iterate over the items.
This commit is contained in:
Glenn Maynard
2007-02-03 23:00:16 +00:00
parent 09a1a6091a
commit 80f2507399
2 changed files with 31 additions and 11 deletions
+27 -11
View File
@@ -502,17 +502,6 @@ void WheelBase::RebuildWheelItems( int iDist )
iLast = -iDist-1;
}
Lua *L = LUA->Get();
for( int i=0; i < (int) m_WheelBaseItems.size(); i++ )
{
m_WheelBaseItems[i]->PushContext(L);
lua_pushstring( L, "WheelIndex" );
lua_pushnumber( L, i );
lua_settable( L, -3 );
lua_pop( L, 1 );
}
LUA->Release( L );
for( int i=iFirst; i <= iLast; i++ )
{
int iIndex = iFirstVisibleIndex + i;
@@ -556,6 +545,33 @@ int WheelBase::FirstVisibleIndex()
return iFirstVisibleIndex;
}
// lua start
#include "LuaBinding.h"
class LunaWheelBase: public Luna<WheelBase>
{
public:
static int GetWheelItem( T* p, lua_State *L )
{
int iItem = IArg(1);
WheelItemBase *pItem = p->GetWheelItem( iItem );
if( pItem == NULL )
luaL_error( L, "%i out of bounds", iItem );
pItem->PushSelf( L );
return 1;
}
LunaWheelBase()
{
ADD_METHOD( GetWheelItem );
}
};
LUA_REGISTER_DERIVED_CLASS( WheelBase, ActorFrame )
// lua end
/*
* (c) 2001-2004 Chris Danford, Chris Gomez, Glenn Maynard, Josh Allen
* All rights reserved.
+4
View File
@@ -45,6 +45,10 @@ public:
bool IsEmpty() { return m_bEmpty; }
WheelItemBaseData* GetItem(unsigned int index);
WheelItemBaseData* LastSelected();
WheelItemBase *GetWheelItem( int i ) { if( i < 0 || i >= (int) m_WheelBaseItems.size() ) return NULL; return m_WheelBaseItems[i]; }
// Lua
void PushSelf( lua_State *L );
protected:
void TweenOnScreenForSort();