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:
+27
-11
@@ -502,17 +502,6 @@ void WheelBase::RebuildWheelItems( int iDist )
|
|||||||
iLast = -iDist-1;
|
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++ )
|
for( int i=iFirst; i <= iLast; i++ )
|
||||||
{
|
{
|
||||||
int iIndex = iFirstVisibleIndex + i;
|
int iIndex = iFirstVisibleIndex + i;
|
||||||
@@ -556,6 +545,33 @@ int WheelBase::FirstVisibleIndex()
|
|||||||
return iFirstVisibleIndex;
|
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
|
* (c) 2001-2004 Chris Danford, Chris Gomez, Glenn Maynard, Josh Allen
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
|||||||
@@ -45,6 +45,10 @@ public:
|
|||||||
bool IsEmpty() { return m_bEmpty; }
|
bool IsEmpty() { return m_bEmpty; }
|
||||||
WheelItemBaseData* GetItem(unsigned int index);
|
WheelItemBaseData* GetItem(unsigned int index);
|
||||||
WheelItemBaseData* LastSelected();
|
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:
|
protected:
|
||||||
void TweenOnScreenForSort();
|
void TweenOnScreenForSort();
|
||||||
|
|||||||
Reference in New Issue
Block a user