This commit is contained in:
Josh Allen
2005-05-03 01:05:11 +00:00
parent 0ac5e2b008
commit 531b4731a8
4 changed files with 34 additions and 16 deletions
+10 -6
View File
@@ -402,6 +402,15 @@ bool WheelBase::Select() // return true if this selection ends the screen
return false;
}
WheelItemBaseData* WheelBase::GetItem(unsigned int index) // return true if this selection ends the screen
{
if (!m_isEmpty)
if (index < m_WheelBaseItemsData.size())
return m_WheelBaseItemsData[index];
return NULL;
}
int WheelBase::IsMoving() const
{
return m_Moving && m_TimeBeforeMovingBegins == 0;
@@ -583,8 +592,7 @@ void WheelBase::AddItem(WheelItemBaseData* itemdata)
//If the item was shown in the wheel, rebuild the wheel
if ((0 <= (index - visible)) && ((index - visible) < NUM_WHEEL_ITEMS))
{
RebuildWheelItems();
SCREENMAN->SystemMessageNoAnimate("redraw");
RebuildWheelItems();
}
}
@@ -629,19 +637,15 @@ void WheelBase::RebuildWheelItems( int dist )
if( dist == -999999 )
{
LOG->Info("data:%d", m_WheelBaseItemsData.size());
// Refresh all
for( int i=0; i<NUM_WHEEL_ITEMS; i++ )
{
LOG->Info("i:%d", i);
int iIndex = iFirstVisibleIndex + i;
wrap( iIndex, m_WheelBaseItemsData.size() );
LOG->Info("iIndex:%d", iIndex);
WheelItemBaseData *data = m_WheelBaseItemsData[iIndex];
WheelItemBase *display = m_WheelBaseItems[i];
LOG->Info("DISP");
display->LoadFromWheelItemBaseData( data );
}
}