Tell the constructor what type it is.

This commit is contained in:
Josh Allen
2005-05-03 21:49:51 +00:00
parent 72327d7e5d
commit 53a4307c9d
2 changed files with 14 additions and 13 deletions
+13 -12
View File
@@ -43,29 +43,30 @@ WheelItemData::WheelItemData( WheelItemType wit, Song* pSong, CString sSectionNa
} }
MusicWheelItem::MusicWheelItem() MusicWheelItem::MusicWheelItem(CString sType)
:WheelItemBase( sType )
{ {
data = NULL; data = NULL;
SetName( "MusicWheelItem" ); SetName( sType );
m_sprSongBar.Load( THEME->GetPathG("MusicWheelItem","song") ); m_sprSongBar.Load( THEME->GetPathG(sType,"song") );
m_sprSongBar.SetXY( 0, 0 ); m_sprSongBar.SetXY( 0, 0 );
this->AddChild( &m_sprSongBar ); this->AddChild( &m_sprSongBar );
m_sprSectionBar.Load( THEME->GetPathG("MusicWheelItem","section") ); m_sprSectionBar.Load( THEME->GetPathG(sType,"section") );
m_sprSectionBar.SetXY( 0, 0 ); m_sprSectionBar.SetXY( 0, 0 );
this->AddChild( &m_sprSectionBar ); this->AddChild( &m_sprSectionBar );
m_sprExpandedBar.Load( THEME->GetPathG("MusicWheelItem","expanded") ); m_sprExpandedBar.Load( THEME->GetPathG(sType,"expanded") );
m_sprExpandedBar.SetXY( 0, 0 ); m_sprExpandedBar.SetXY( 0, 0 );
this->AddChild( &m_sprExpandedBar ); this->AddChild( &m_sprExpandedBar );
m_sprModeBar.Load( THEME->GetPathG("MusicWheelItem","mode") ); m_sprModeBar.Load( THEME->GetPathG(sType,"mode") );
m_sprModeBar.SetXY( 0, 0 ); m_sprModeBar.SetXY( 0, 0 );
this->AddChild( &m_sprModeBar ); this->AddChild( &m_sprModeBar );
m_sprSortBar.Load( THEME->GetPathG("MusicWheelItem","sort") ); m_sprSortBar.Load( THEME->GetPathG(sType,"sort") );
m_sprSortBar.SetXY( 0, 0 ); m_sprSortBar.SetXY( 0, 0 );
this->AddChild( &m_sprSortBar ); this->AddChild( &m_sprSortBar );
@@ -79,13 +80,13 @@ MusicWheelItem::MusicWheelItem()
m_TextBanner.RunCommands( SONG_NAME_ON_COMMAND ); m_TextBanner.RunCommands( SONG_NAME_ON_COMMAND );
this->AddChild( &m_TextBanner ); this->AddChild( &m_TextBanner );
m_textSection.LoadFromFont( THEME->GetPathF("MusicWheelItem","section") ); m_textSection.LoadFromFont( THEME->GetPathF(sType,"section") );
m_textSection.SetShadowLength( 0 ); m_textSection.SetShadowLength( 0 );
m_textSection.SetXY( SECTION_X, SECTION_Y ); m_textSection.SetXY( SECTION_X, SECTION_Y );
m_textSection.RunCommands( SECTION_ON_COMMAND ); m_textSection.RunCommands( SECTION_ON_COMMAND );
this->AddChild( &m_textSection ); this->AddChild( &m_textSection );
m_textRoulette.LoadFromFont( THEME->GetPathF("MusicWheelItem","roulette") ); m_textRoulette.LoadFromFont( THEME->GetPathF(sType,"roulette") );
m_textRoulette.SetShadowLength( 0 ); m_textRoulette.SetShadowLength( 0 );
m_textRoulette.TurnRainbowOn(); m_textRoulette.TurnRainbowOn();
m_textRoulette.SetXY( ROULETTE_X, ROULETTE_Y ); m_textRoulette.SetXY( ROULETTE_X, ROULETTE_Y );
@@ -93,18 +94,18 @@ MusicWheelItem::MusicWheelItem()
this->AddChild( &m_textRoulette ); this->AddChild( &m_textRoulette );
m_textCourse.SetName( "CourseName" ); m_textCourse.SetName( "CourseName" );
m_textCourse.LoadFromFont( THEME->GetPathF("MusicWheelItem","course") ); m_textCourse.LoadFromFont( THEME->GetPathF(sType,"course") );
SET_XY_AND_ON_COMMAND( &m_textCourse ); SET_XY_AND_ON_COMMAND( &m_textCourse );
this->AddChild( &m_textCourse ); this->AddChild( &m_textCourse );
m_textSort.SetName( "Sort" ); m_textSort.SetName( "Sort" );
m_textSort.LoadFromFont( THEME->GetPathF("MusicWheelItem","sort") ); m_textSort.LoadFromFont( THEME->GetPathF(sType,"sort") );
SET_XY_AND_ON_COMMAND( &m_textSort ); SET_XY_AND_ON_COMMAND( &m_textSort );
this->AddChild( &m_textSort ); this->AddChild( &m_textSort );
FOREACH_PlayerNumber( p ) FOREACH_PlayerNumber( p )
{ {
m_GradeDisplay[p].Load( THEME->GetPathG("MusicWheelItem","grades") ); m_GradeDisplay[p].Load( THEME->GetPathG(sType,"grades") );
m_GradeDisplay[p].SetZoom( 1.0f ); m_GradeDisplay[p].SetZoom( 1.0f );
m_GradeDisplay[p].SetXY( GRADE_X.GetValue(p), 0 ); m_GradeDisplay[p].SetXY( GRADE_X.GetValue(p), 0 );
this->AddChild( &m_GradeDisplay[p] ); this->AddChild( &m_GradeDisplay[p] );
+1 -1
View File
@@ -20,7 +20,7 @@ struct WheelItemData;
class MusicWheelItem : public WheelItemBase class MusicWheelItem : public WheelItemBase
{ {
public: public:
MusicWheelItem(); MusicWheelItem(CString sType = "MusicWheelItem");
virtual void LoadFromWheelItemData( WheelItemData* pWID, bool bExpanded ); virtual void LoadFromWheelItemData( WheelItemData* pWID, bool bExpanded );
void RefreshGrades(); void RefreshGrades();