Style to match the rest of the code.
This commit is contained in:
@@ -40,8 +40,8 @@ WheelItemBase *RoomWheel::MakeItem()
|
||||
return new RoomWheelItem;
|
||||
}
|
||||
|
||||
RoomWheelItem::RoomWheelItem( RString sType )
|
||||
:WheelItemBase( sType )
|
||||
RoomWheelItem::RoomWheelItem( RString sType ):
|
||||
WheelItemBase( sType )
|
||||
{
|
||||
Load( sType );
|
||||
}
|
||||
@@ -77,14 +77,12 @@ void RoomWheelItem::Load( RString sType )
|
||||
void RoomWheel::BuildWheelItemsData( vector<WheelItemBaseData*> &arrayWheelItemDatas )
|
||||
{
|
||||
if( arrayWheelItemDatas.empty() )
|
||||
{
|
||||
arrayWheelItemDatas.push_back( new RoomWheelData(TYPE_GENERIC, "- EMPTY -", "", RageColor(1,0,0,1)) );
|
||||
}
|
||||
}
|
||||
|
||||
void RoomWheel::AddPerminateItem( RoomWheelData *itemdata )
|
||||
{
|
||||
m_offset++;
|
||||
++m_offset;
|
||||
AddItem( itemdata );
|
||||
}
|
||||
|
||||
@@ -103,10 +101,8 @@ void RoomWheel::AddItem( WheelItemBaseData* pItemData )
|
||||
|
||||
// If the item was shown in the wheel, rebuild the wheel
|
||||
if( 0 <= iIndex - iVisible && iIndex - iVisible < NUM_WHEEL_ITEMS )
|
||||
{
|
||||
RebuildWheelItems();
|
||||
}
|
||||
}
|
||||
|
||||
void RoomWheel::RemoveItem( int index )
|
||||
{
|
||||
@@ -142,7 +138,7 @@ bool RoomWheel::Select()
|
||||
|
||||
if( m_iSelection > 0 )
|
||||
return WheelBase::Select();
|
||||
else if( m_iSelection == 0 )
|
||||
if( m_iSelection == 0 )
|
||||
{
|
||||
// Since this is not actually an option outside of this wheel, NULL is a good idea.
|
||||
m_LastSelection = NULL;
|
||||
@@ -153,7 +149,7 @@ bool RoomWheel::Select()
|
||||
|
||||
void RoomWheelItem::LoadFromWheelItemData( const WheelItemBaseData *pWID, int iIndex, bool bHasFocus )
|
||||
{
|
||||
const RoomWheelData* tmpdata = (RoomWheelData*) pWID;
|
||||
const RoomWheelData *tmpdata = dynamic_cast<const RoomWheelData*>( pWID );
|
||||
WheelItemBase::LoadFromWheelItemData( pWID, iIndex, bHasFocus );
|
||||
m_Desc.SetText( tmpdata->m_sDesc );
|
||||
m_Desc.SetDiffuseColor( pWID->m_color );
|
||||
@@ -162,14 +158,16 @@ void RoomWheelItem::LoadFromWheelItemData( const WheelItemBaseData* pWID, int iI
|
||||
|
||||
void RoomWheel::Move( int n )
|
||||
{
|
||||
if ((n == 0) && (m_iSelection >= m_offset))
|
||||
if( n == 0 && m_iSelection >= m_offset )
|
||||
{
|
||||
const RoomWheelData* data = GetItem( m_iSelection-m_offset );
|
||||
if( data != NULL )
|
||||
SCREENMAN->PostMessageToTopScreen( SM_RoomInfoDeploy, 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
SCREENMAN->PostMessageToTopScreen( SM_RoomInfoRetract, 0 );
|
||||
}
|
||||
|
||||
WheelBase::Move( n );
|
||||
}
|
||||
|
||||
@@ -10,9 +10,8 @@
|
||||
struct RoomWheelData : public WheelItemBaseData
|
||||
{
|
||||
RoomWheelData() : m_iFlags(0) { WheelItemBaseData::WheelItemBaseData(); }
|
||||
RoomWheelData( WheelItemType wit, const RString& sTitle, const RString& sDesc, RageColor color )
|
||||
: WheelItemBaseData( wit, sTitle, color ), m_sDesc(sDesc), m_iFlags(0)
|
||||
{};
|
||||
RoomWheelData( WheelItemType wit, const RString& sTitle, const RString& sDesc, RageColor color ):
|
||||
WheelItemBaseData( wit, sTitle, color ), m_sDesc(sDesc), m_iFlags(0) { };
|
||||
|
||||
RString m_sDesc;
|
||||
unsigned int m_iFlags;
|
||||
@@ -52,7 +51,7 @@ public:
|
||||
virtual bool Select();
|
||||
virtual void Move( int n );
|
||||
|
||||
inline RoomWheelData* GetItem(unsigned int i) { return (RoomWheelData*)WheelBase::GetItem(i + m_offset); }
|
||||
inline RoomWheelData *GetItem( unsigned int i ) { return dynamic_cast<RoomWheelData*>( WheelBase::GetItem(i + m_offset) ); }
|
||||
void AddPerminateItem( RoomWheelData *itemdata );
|
||||
int GetCurrentIndex() const { return m_iSelection; }
|
||||
int GetPerminateOffset() const { return m_offset; }
|
||||
|
||||
Reference in New Issue
Block a user