Include the index of which a wheel item was drawn as a parameter for additional control when scripting themes via lua.
This commit is contained in:
@@ -153,9 +153,9 @@ MusicWheelItem::~MusicWheelItem()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void MusicWheelItem::LoadFromWheelItemData( const WheelItemBaseData *pData, int iIndex, bool bHasFocus )
|
void MusicWheelItem::LoadFromWheelItemData( const WheelItemBaseData *pData, int iIndex, bool bHasFocus, int iDrawIndex )
|
||||||
{
|
{
|
||||||
WheelItemBase::LoadFromWheelItemData( pData, iIndex, bHasFocus );
|
WheelItemBase::LoadFromWheelItemData( pData, iIndex, bHasFocus, iDrawIndex );
|
||||||
|
|
||||||
const MusicWheelItemData *pWID = dynamic_cast<const MusicWheelItemData*>( pData );
|
const MusicWheelItemData *pWID = dynamic_cast<const MusicWheelItemData*>( pData );
|
||||||
|
|
||||||
@@ -264,6 +264,8 @@ void MusicWheelItem::LoadFromWheelItemData( const WheelItemBaseData *pData, int
|
|||||||
msg.SetParam( "Index", iIndex );
|
msg.SetParam( "Index", iIndex );
|
||||||
msg.SetParam( "HasFocus", bHasFocus );
|
msg.SetParam( "HasFocus", bHasFocus );
|
||||||
msg.SetParam( "SongGroup", pWID->m_sText );
|
msg.SetParam( "SongGroup", pWID->m_sText );
|
||||||
|
msg.SetParam( "DrawIndex", iDrawIndex );
|
||||||
|
|
||||||
this->HandleMessage( msg );
|
this->HandleMessage( msg );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public:
|
|||||||
virtual ~MusicWheelItem();
|
virtual ~MusicWheelItem();
|
||||||
virtual MusicWheelItem *Copy() const { return new MusicWheelItem(*this); }
|
virtual MusicWheelItem *Copy() const { return new MusicWheelItem(*this); }
|
||||||
|
|
||||||
virtual void LoadFromWheelItemData( const WheelItemBaseData* pWID, int iIndex, bool bHasFocus );
|
virtual void LoadFromWheelItemData( const WheelItemBaseData* pWID, int iIndex, bool bHasFocus, int iDrawIndex );
|
||||||
virtual void HandleMessage( const Message &msg );
|
virtual void HandleMessage( const Message &msg );
|
||||||
void RefreshGrades();
|
void RefreshGrades();
|
||||||
|
|
||||||
|
|||||||
@@ -174,15 +174,15 @@ bool RoomWheel::Select()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RoomWheelItem::LoadFromWheelItemData( const WheelItemBaseData *pWID, int iIndex, bool bHasFocus )
|
void RoomWheelItem::LoadFromWheelItemData( const WheelItemBaseData *pWID, int iIndex, bool bHasFocus, int iDrawIndex )
|
||||||
{
|
{
|
||||||
WheelItemBase::LoadFromWheelItemData( pWID, iIndex, bHasFocus );
|
WheelItemBase::LoadFromWheelItemData( pWID, iIndex, bHasFocus, iDrawIndex );
|
||||||
|
|
||||||
m_text.SetText( pWID->m_sText );
|
m_text.SetText( pWID->m_sText );
|
||||||
m_text.SetDiffuseColor( pWID->m_color );
|
m_text.SetDiffuseColor( pWID->m_color );
|
||||||
|
|
||||||
const RoomWheelItemData *tmpdata = dynamic_cast<const RoomWheelItemData*>( pWID );
|
const RoomWheelItemData *tmpdata = dynamic_cast<const RoomWheelItemData*>( pWID );
|
||||||
WheelItemBase::LoadFromWheelItemData( pWID, iIndex, bHasFocus );
|
WheelItemBase::LoadFromWheelItemData( pWID, iIndex, bHasFocus, iDrawIndex );
|
||||||
m_Desc.SetText( tmpdata->m_sDesc );
|
m_Desc.SetText( tmpdata->m_sDesc );
|
||||||
m_Desc.SetDiffuseColor( pWID->m_color );
|
m_Desc.SetDiffuseColor( pWID->m_color );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public:
|
|||||||
RoomWheelItem( const RoomWheelItem &cpy );
|
RoomWheelItem( const RoomWheelItem &cpy );
|
||||||
|
|
||||||
void Load( RString sType );
|
void Load( RString sType );
|
||||||
virtual void LoadFromWheelItemData( const WheelItemBaseData* pWID, int iIndex, bool bHasFocus );
|
virtual void LoadFromWheelItemData( const WheelItemBaseData* pWID, int iIndex, bool bHasFocus, int iDrawIndex );
|
||||||
virtual RoomWheelItem *Copy() const { return new RoomWheelItem(*this); }
|
virtual RoomWheelItem *Copy() const { return new RoomWheelItem(*this); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -481,7 +481,7 @@ void WheelBase::RebuildWheelItems( int iDist )
|
|||||||
wrap( iIndex, data.size() );
|
wrap( iIndex, data.size() );
|
||||||
const WheelItemBaseData *pData = data[iIndex];
|
const WheelItemBaseData *pData = data[iIndex];
|
||||||
WheelItemBase *pDisplay = items[i];
|
WheelItemBase *pDisplay = items[i];
|
||||||
pDisplay->LoadFromWheelItemData( pData, iIndex, m_iSelection==iIndex );
|
pDisplay->LoadFromWheelItemData( pData, iIndex, m_iSelection==iIndex, i );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ void WheelItemBase::Load( RString sType )
|
|||||||
m_colorLocked = RageColor(0,0,0,0);
|
m_colorLocked = RageColor(0,0,0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WheelItemBase::LoadFromWheelItemData( const WheelItemBaseData* pWID, int iIndex, bool bHasFocus )
|
void WheelItemBase::LoadFromWheelItemData( const WheelItemBaseData* pWID, int iIndex, bool bHasFocus, int iDrawIndex )
|
||||||
{
|
{
|
||||||
ASSERT( pWID != NULL );
|
ASSERT( pWID != NULL );
|
||||||
m_pData = pWID;
|
m_pData = pWID;
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public:
|
|||||||
void DrawGrayBar( Actor& bar );
|
void DrawGrayBar( Actor& bar );
|
||||||
void SetExpanded( bool bExpanded ) { m_bExpanded = bExpanded; }
|
void SetExpanded( bool bExpanded ) { m_bExpanded = bExpanded; }
|
||||||
|
|
||||||
virtual void LoadFromWheelItemData( const WheelItemBaseData* pWID, int iIndex, bool bHasFocus );
|
virtual void LoadFromWheelItemData( const WheelItemBaseData* pWID, int iIndex, bool bHasFocus, int iDrawIndex );
|
||||||
|
|
||||||
RageColor m_colorLocked;
|
RageColor m_colorLocked;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user