diff --git a/stepmania/TODO.chris b/stepmania/TODO.chris index 9ece6f52a9..225725ad9d 100644 --- a/stepmania/TODO.chris +++ b/stepmania/TODO.chris @@ -2,6 +2,10 @@ Fix ///////////////////////// +groove radar goes wild when random selected + +take out "it's a new record" + note coloring in graphic, NoteColor with add? remove shadow from everywhere diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index b517f120d7..7abcca42bf 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -111,27 +111,31 @@ ExplanationPage1X=170 ExplanationPage1Y=70 ExplanationPage2X=1100 ExplanationPage2Y=70 -EasyX=120 -EasyY=200 -MediumX=320 -MediumY=180 -HardX=520 -HardY=200 -OniX=860 -OniY=180 -EndlessX=1060 -EndlessY=180 +Choice1X=120 +Choice1Y=200 +Choice2X=320 +Choice2Y=180 +Choice3X=520 +Choice3Y=200 +Choice4X=760 +Choice4Y=200 +Choice5X=960 +Choice5Y=180 +Choice6X=1160 +Choice6Y=200 CursorOffsetP1X=-40 CursorOffsetP1Y=200 CursorOffsetP2X=+40 CursorOffsetP2Y=200 CursorShadowLengthX=10 CursorShadowLengthY=10 +InitialChoice=1 HelpText=Use &LEFT; &RIGHT; to select, then press START TimerSeconds=40 NextScreenArcade=ScreenSelectGroup NextScreenOni=ScreenInstructions + [ScreenSelectGroup] FrameX=180 FrameY=160 diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index 6f1a8ca5ff..0b0dde3f09 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -33,6 +33,8 @@ Course::Course() void Course::LoadFromCRSFile( CString sPath, vector &apSongs ) { + m_sPath = sPath; // save path + MsdFile msd; if( !msd.ReadFile(sPath) ) RageException::Throw( "Error opening CRS file '%s'.", sPath.GetString() ); @@ -220,10 +222,6 @@ CString Course::GetDescription( int iStage ) const return entries[iStage].description; } -CString Course::GetModifiers( int iStage ) const -{ - return entries[iStage].modifiers; -} void Course::AddStage( Song* pSong, CString sDescription, CString sModifiers ) { @@ -273,12 +271,12 @@ RageColor Course::GetColor() return RageColor(0,1,0,1); // green } -void Course::GetPlayerOptions( PlayerOptions* pPO_out ) +void Course::GetPlayerOptions( int iStage, PlayerOptions* pPO_out ) const { - *pPO_out = PlayerOptions(); + pPO_out->FromString( entries[iStage].modifiers ); } -void Course::GetSongOptions( SongOptions* pSO_out ) +void Course::GetSongOptions( SongOptions* pSO_out ) const { *pSO_out = SongOptions(); pSO_out->m_LifeType = (m_iLives==-1) ? SongOptions::LIFE_BAR : SongOptions::LIFE_BATTERY; diff --git a/stepmania/src/Course.h b/stepmania/src/Course.h index 7bc5008169..d710aa2811 100644 --- a/stepmania/src/Course.h +++ b/stepmania/src/Course.h @@ -23,7 +23,7 @@ class Course int m_iStages; struct course_entry { - CString description; + CString description; // the Notes description CString modifiers; // set player and song options from these Song *song; }; @@ -33,6 +33,7 @@ class Course public: Course(); + CString m_sPath; CString m_sName; CString m_sBannerPath; CString m_sCDTitlePath; @@ -45,9 +46,9 @@ public: Notes *GetNotesForStage( int iStage ); Song *GetSong( int iStage ) const; CString GetDescription( int iStage ) const; - CString GetModifiers( int iStage ) const; - void GetPlayerOptions( PlayerOptions* pPO_out ); - void GetSongOptions( SongOptions* pSO_out); +// CString GetModifiers( int iStage ) const; // redundant. -Chris + void GetPlayerOptions( int iStage, PlayerOptions* pPO_out ) const; + void GetSongOptions( SongOptions* pSO_out) const; int GetNumStages() const; void LoadFromCRSFile( CString sPath, vector &apSongs ); @@ -57,6 +58,16 @@ public: void GetSongAndNotesForCurrentStyle( vector& apSongsOut, vector& apNotesOut, CStringArray& asModifiersOut, bool bShuffled ); RageColor GetColor(); + // Statistics + struct HighScore + { + int iDancePoints; + float fSurviveTime; + CString sName; + }; + HighScore m_MachineScores[NUM_DIFFICULTIES][NUM_HIGH_SCORE_LINES]; // sorted highest to lowest by iDancePoints + HighScore m_MemCardScores[NUM_DIFFICULTIES][NUM_PLAYERS]; + private: void Shuffle(); }; diff --git a/stepmania/src/GameConstantsAndTypes.h b/stepmania/src/GameConstantsAndTypes.h index 6be41c8d16..eb14466e87 100644 --- a/stepmania/src/GameConstantsAndTypes.h +++ b/stepmania/src/GameConstantsAndTypes.h @@ -87,8 +87,9 @@ enum NotesType enum PlayMode { PLAY_MODE_ARCADE, - PLAY_MODE_ONI, - PLAY_MODE_ENDLESS, + PLAY_MODE_NONSTOP, // DDR EX Nonstop + PLAY_MODE_ONI, // DDR EX Challenge + PLAY_MODE_ENDLESS, // DDR PlayStation Endless NUM_PLAY_MODES, PLAY_MODE_INVALID }; @@ -169,4 +170,6 @@ inline int HoldNoteScoreToDancePoints( HoldNoteScore hns ) } } +const int NUM_HIGH_SCORE_LINES = 5; + #endif diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index 99fd859f3d..fd01ef9df6 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -28,7 +28,9 @@ GameState* GAMESTATE = NULL; // global and accessable from anywhere in our progr #define STAGE_COLOR_FINAL THEME->GetMetricC("GameState","StageColorFinal") #define STAGE_COLOR_EXTRA1 THEME->GetMetricC("GameState","StageColorExtra1") #define STAGE_COLOR_EXTRA2 THEME->GetMetricC("GameState","StageColorExtra2") +#define STAGE_COLOR_NONSTOP THEME->GetMetricC("GameState","StageColorNonstop") #define STAGE_COLOR_ONI THEME->GetMetricC("GameState","StageColorOni") +#define STAGE_COLOR_ENDLESS THEME->GetMetricC("GameState","StageColorEndless") #define STAGE_TEXT_DEMO THEME->GetMetric("GameState","StageTextDemo") #define STAGE_TEXT_FINAL THEME->GetMetric("GameState","StageTextFinal") #define STAGE_TEXT_EXTRA1 THEME->GetMetric("GameState","StageTextExtra1") @@ -169,6 +171,7 @@ void GameState::ResetStageStatistics() switch( m_PlayMode ) { + case PLAY_MODE_NONSTOP: case PLAY_MODE_ONI: case PLAY_MODE_ENDLESS: m_apSongsPlayed.clear(); @@ -256,12 +259,14 @@ CString GameState::GetStageText() RageColor GameState::GetStageColor() { - if( m_bDemonstration ) return STAGE_COLOR_DEMO; - else if( m_PlayMode==PLAY_MODE_ONI || m_PlayMode==PLAY_MODE_ENDLESS ) return STAGE_COLOR_ONI; - else if( IsFinalStage() ) return STAGE_COLOR_FINAL; - else if( IsExtraStage() ) return STAGE_COLOR_EXTRA1; - else if( IsExtraStage2() ) return STAGE_COLOR_EXTRA2; - else return STAGE_COLOR( min(m_iCurrentStageIndex,4) ); + if( m_bDemonstration ) return STAGE_COLOR_DEMO; + else if( m_PlayMode==PLAY_MODE_NONSTOP ) return STAGE_COLOR_NONSTOP; + else if( m_PlayMode==PLAY_MODE_ONI ) return STAGE_COLOR_ONI; + else if( m_PlayMode==PLAY_MODE_ENDLESS ) return STAGE_COLOR_ENDLESS; + else if( IsFinalStage() ) return STAGE_COLOR_FINAL; + else if( IsExtraStage() ) return STAGE_COLOR_EXTRA1; + else if( IsExtraStage2() ) return STAGE_COLOR_EXTRA2; + else return STAGE_COLOR( min(m_iCurrentStageIndex,4) ); } GameDef* GameState::GetCurrentGameDef() diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index be201af314..f4ed27c408 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -631,23 +631,17 @@ void MusicWheel::BuildWheelItemDatas( vector &arrayWheelItemDatas } break; + case PLAY_MODE_NONSTOP: case PLAY_MODE_ONI: case PLAY_MODE_ENDLESS: { - unsigned i; - vector apCourses; switch( GAMESTATE->m_PlayMode ) { - case PLAY_MODE_ONI: - for( i=0; im_aOniCourses.size(); i++ ) - apCourses.push_back( &SONGMAN->m_aOniCourses[i] ); - SortCoursePointerArrayByDifficulty( apCourses ); - break; - case PLAY_MODE_ENDLESS: - for( i=0; im_aEndlessCourses.size(); i++ ) - apCourses.push_back( &SONGMAN->m_aEndlessCourses[i] ); - break; + case PLAY_MODE_NONSTOP: SONGMAN->GetNonstopCourses( apCourses ); break; + case PLAY_MODE_ONI: SONGMAN->GetOniCourses( apCourses ); break; + case PLAY_MODE_ENDLESS: SONGMAN->GetEndlessCourses( apCourses ); break; + default: ASSERT(0); } for( unsigned c=0; cStop(); - - m_pNextScreen = NULL; - - m_textStage.Load( THEME->GetPathTo(FONT_STAGE) ); - m_textStage.TurnShadowOff(); - m_textStageString.Load( THEME->GetPathTo(FONT_STAGE) ); - m_textStageString.TurnShadowOff(); - - for (int i=0; i<20; i++) - { - m_blobs_a[i].Load( THEME->GetPathTo(FONT_STAGE) ); - m_blobs_a[i].TurnShadowOff(); - m_blobs_b[i].Load( THEME->GetPathTo(FONT_STAGE) ); - m_blobs_b[i].TurnShadowOff(); - } - - for (i=0; i<2; i++) - { - m_ez2ukm[i].Load( THEME->GetPathTo(FONT_STAGE) ); - m_ez2ukm[i].TurnShadowOff(); - } - - if( GAMESTATE->m_PlayMode == PLAY_MODE_ONI ) - { - m_textStage.SetText( "Nonstop Challenge" ); - m_textStage.SetDiffuseColor( D3DXCOLOR(0.8f,0.8f,1,1) ); // light blue - SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_STAGE_ONI) ); - } - else if( GAMESTATE->m_PlayMode == PLAY_MODE_ENDLESS ) - { - m_textStage.SetText( "Endless Challenge" ); - m_textStage.SetDiffuseColor( D3DXCOLOR(0.8f,0.8f,1,1) ); // light blue - SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_STAGE_ENDLESS) ); - } - else if( GAMESTATE->IsExtraStage() ) - { - m_textStage.SetText( "Extra Stage" ); - m_textStage.SetDiffuseColor( D3DXCOLOR(1,0.1f,0.1f,1) ); // red - SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_STAGE_EXTRA) ); - } - else if( GAMESTATE->IsExtraStage2() ) - { - m_textStage.SetText( "Another Extra Stage" ); // red - m_textStage.SetDiffuseColor( D3DXCOLOR(1,0.1f,0.1f,1) ); - SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_STAGE_ANOTHER_EXTRA) ); - } - else if( GAMESTATE->IsFinalStage() ) - { - m_textStage.SetText( "Final Stage" ); - m_textStage.SetDiffuseColor( D3DXCOLOR(1,1,1,1) ); - SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_STAGE_FINAL) ); - } - else - { - m_textStage.SetText( GAMESTATE->GetStageText() + " Stage" ); - m_textStage.SetDiffuseColor( D3DXCOLOR(1,1,1,1) ); - - m_textStageString.SetText( "NEXT NEXT NEXT NEXT NEXT NEXT NEXT NEXT NEXT NEXT" ); - m_textStageString.SetDiffuseColor( D3DXCOLOR(1,1,1,1) ); - - for ( i=0; i<20; i++) - { - m_blobs_a[i].SetText( "$" ); - m_blobs_a[i].SetDiffuseColor( D3DXCOLOR(1,1,1,1) ); - m_blobs_b[i].SetText( "$" ); - m_blobs_b[i].SetDiffuseColor( D3DXCOLOR(1,1,1,1) ); - } - - for (i=0; i<2; i++) - { - m_ez2ukm[i].SetText( "EZ2DANCER UK MOVE" ); - m_ez2ukm[i].SetDiffuseColor( D3DXCOLOR(1,1,1,1) ); - } - - const int iStageNo = GAMESTATE->GetStageIndex()+1; - switch( iStageNo ) - { - case 1: SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_STAGE_1) ); break; - case 2: SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_STAGE_2) ); break; - case 3: SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_STAGE_3) ); break; - case 4: SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_STAGE_4) ); break; - case 5: SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_STAGE_5) ); break; - default: ; break; // play nothing - } - } - - - m_textStageString.SetXY(CENTER_X - 300, CENTER_Y - 150); - m_textStageString.SetZoomX( 1.5f ); - m_textStageString.SetZoomY( 1.5f ); - m_textStageString.SetDiffuseColor( D3DXCOLOR(0,0,0,1) ); - - for ( i=0; i<20; i++) - { - m_blobs_a[i].SetZoomX( 1.2f ); - m_blobs_a[i].SetZoomY( 1.2f ); - m_blobs_b[i].SetZoomX( 1.2f ); - m_blobs_b[i].SetZoomY( 1.2f ); - m_blobs_a[i].SetXY( CENTER_X-500-((i*i)*4), CENTER_Y + 140 ); - m_blobs_a[i].SetDiffuseColor( D3DXCOLOR(1.0f/255.0f*245.0f,1.0f/255.0f*237.0f,1.0f/255.0f*19.0f,0) ); - m_blobs_b[i].SetXY( CENTER_X+500+((i*i)*4), CENTER_Y + 170 ); - m_blobs_b[i].SetDiffuseColor( D3DXCOLOR(1.0f/255.0f*245.0f,1.0f/255.0f*237.0f,1.0f/255.0f*19.0f,0) ); - } - - for (i=0; i<2; i++) - { - m_ez2ukm[i].SetZoomX( 0.9f ); - m_ez2ukm[i].SetZoomY( 0.9f ); - } - m_ez2ukm[0].SetXY( SCREEN_WIDTH + 100, 30 ); - m_ez2ukm[1].SetXY( 0 - 100, SCREEN_HEIGHT - 30 ); - - m_textStage.SetXY( CENTER_X, CENTER_Y ); - m_textStage.SetZoomX( 4 ); - m_textStage.SetZoomY( 4 ); - m_textStage.SetDiffuseColor( D3DXCOLOR(0,0,0,1) ); - - m_textStage.BeginTweening( 0.5f ); - m_textStageString.BeginTweening( 0.3f ); - for (i=0; i<2; i++) - { - m_ez2ukm[i].BeginTweening(0.5f); - } - for ( i=0; i<20; i++) - { - m_blobs_a[i].BeginTweening(0.2f * i / 7); - m_blobs_b[i].BeginTweening(0.2f * i / 7); - m_blobs_a[i].SetTweenX(40+(i*30.0f)); - m_blobs_b[i].SetTweenX(SCREEN_WIDTH-40-(i*30.0f)); - m_blobs_a[i].SetTweenDiffuseColor( D3DXCOLOR(1.0f/255.0f*245.0f,1.0f/255.0f*237.0f,1.0f/255.0f*19.0f,1) ); - m_blobs_b[i].SetTweenDiffuseColor( D3DXCOLOR(1.0f/255.0f*245.0f,1.0f/255.0f*237.0f,1.0f/255.0f*19.0f,1) ); - } - - m_ez2ukm[0].SetTweenX(0+150); - m_ez2ukm[1].SetTweenX(SCREEN_WIDTH-150); - - m_textStage.SetTweenZoom( 4 ); - m_textStageString.SetTweenX(CENTER_X); - m_textStage.SetTweenDiffuseColor( D3DXCOLOR(1,1,1,1) ); - m_textStageString.SetTweenDiffuseColor( D3DXCOLOR(1.0f/255.0f*245.0f,1.0f/255.0f*237.0f,1.0f/255.0f*19.0f,1) ); - - - this->AddSubActor( &m_textStage ); - this->AddSubActor( &m_textStageString ); - for ( i=0; i<20; i++) - { - this->AddSubActor( &m_blobs_a[i] ); - this->AddSubActor( &m_blobs_b[i] ); - } - for (i=0; i<2; i++) - { - this->AddSubActor( &m_ez2ukm[i] ); - } - - this->SendScreenMessage( SM_DoneFadingIn, 0.6f ); - this->SendScreenMessage( SM_StartFadingOut, 1.2f ); -} - - -void ScreenEz2Stage::HandleScreenMessage( const ScreenMessage SM ) -{ - switch( SM ) - { - case SM_StartFadingOut: - m_textStage.BeginTweening( 0.8f ); - m_textStage.SetTweenDiffuseColor( D3DXCOLOR(1,1,1,0) ); - this->SendScreenMessage( SM_GoToNextState, 0.8f ); - break; - case SM_DoneFadingIn: - m_pNextScreen = new ScreenGameplay; - break; - case SM_GoToNextState: - SCREENMAN->SetNewScreen( m_pNextScreen ); - break; - } -} - -*/ \ No newline at end of file diff --git a/stepmania/src/ScreenEz2Stage.h b/stepmania/src/ScreenEz2Stage.h deleted file mode 100644 index 2a06f5c471..0000000000 --- a/stepmania/src/ScreenEz2Stage.h +++ /dev/null @@ -1,42 +0,0 @@ -/* ------------------------------------------------------------------------------ - Class: ScreenEz2Stage - - Desc: Shows the stage number. - - Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. - Chris Danford - Andrew Livy ------------------------------------------------------------------------------ -*/ - -#include "Screen.h" -#include "BitmapText.h" - - -/* - - Chris: I made big changes to ScreenStage that I don't want to have to - duplicate here. Let me know how I can help accomodate working EZ2 specifc - changes into the existing ScreenStage. These classes are very similar, - and it's silly to duplicate so much code. Sorry. - -class ScreenEz2Stage : public Screen -{ -public: - ScreenEz2Stage(); - - virtual void HandleScreenMessage( const ScreenMessage SM ); - -private: - bool m_bTryExtraStage; - - BitmapText m_textStage; - BitmapText m_textStageString; - BitmapText m_blobs_a[20]; - BitmapText m_blobs_b[20]; - BitmapText m_ez2ukm[2]; - Screen* m_pNextScreen; -}; -*/ - diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 93f6d14fbf..ef4330c24b 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -132,6 +132,7 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration ) GAMESTATE->m_pCurNotes[p]->GetNoteData( ¬edata ); GAMESTATE->m_iPossibleDancePoints[p] = notedata.GetPossibleDancePoints(); break; + case PLAY_MODE_NONSTOP: case PLAY_MODE_ONI: case PLAY_MODE_ENDLESS: { @@ -151,6 +152,8 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration ) } } break; + default: + ASSERT(0); } } @@ -252,6 +255,7 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration ) case PLAY_MODE_ARCADE: this->AddChild( &m_textStageNumber ); break; + case PLAY_MODE_NONSTOP: case PLAY_MODE_ONI: case PLAY_MODE_ENDLESS: for( p=0; pm_PlayerOptions[p].FromString( asModifiers[iPlaySongIndex] ); // put them into effect } + } - break; default: ASSERT(0); break; @@ -804,6 +811,7 @@ void ScreenGameplay::Update( float fDeltaTime ) else if( AllAreInDanger() ) m_announcerDanger.PlayRandom(); else m_announcerGood.PlayRandom(); break; + case PLAY_MODE_NONSTOP: case PLAY_MODE_ONI: case PLAY_MODE_ENDLESS: m_announcerOni.PlayRandom(); @@ -1040,6 +1048,7 @@ void SaveChanges() case PLAY_MODE_ARCADE: GAMESTATE->m_pCurSong->Save(); break; + case PLAY_MODE_NONSTOP: case PLAY_MODE_ONI: case PLAY_MODE_ENDLESS: { @@ -1064,6 +1073,7 @@ void DontSaveChanges() ld.LoadFromSMFile(GAMESTATE->m_pCurSong->GetCacheFilePath(), *GAMESTATE->m_pCurSong); break; + case PLAY_MODE_NONSTOP: case PLAY_MODE_ONI: case PLAY_MODE_ENDLESS: { @@ -1093,6 +1103,7 @@ void ShowSavePrompt( ScreenMessage SM_SendWhenDone ) "Choosing NO will discard your changes.", GAMESTATE->m_pCurSong->GetFullTitle().GetString() ); break; + case PLAY_MODE_NONSTOP: case PLAY_MODE_ONI: case PLAY_MODE_ENDLESS: sMessage = ssprintf( @@ -1392,6 +1403,7 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) // SCREENMAN->SetNewScreen( "ScreenSelectMusic" ); SCREENMAN->SetNewScreen( SONGSEL_SCREEN ); break; + case PLAY_MODE_NONSTOP: case PLAY_MODE_ONI: case PLAY_MODE_ENDLESS: SCREENMAN->SetNewScreen( "ScreenSelectCourse" ); @@ -1474,7 +1486,9 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) ShowSavePrompt( SM_GoToScreenAfterFail ); break; } - if( GAMESTATE->m_PlayMode == PLAY_MODE_ONI || GAMESTATE->m_PlayMode == PLAY_MODE_ENDLESS ) + if( GAMESTATE->m_PlayMode == PLAY_MODE_NONSTOP || + GAMESTATE->m_PlayMode == PLAY_MODE_ONI || + GAMESTATE->m_PlayMode == PLAY_MODE_ENDLESS ) SCREENMAN->SetNewScreen( "ScreenEvaluation" ); else if( PREFSMAN->m_bEventMode ) this->SendScreenMessage( SM_GoToScreenAfterBack, 0 ); diff --git a/stepmania/src/ScreenHighScores.cpp b/stepmania/src/ScreenHighScores.cpp index a8cc100c4c..30604720d5 100644 --- a/stepmania/src/ScreenHighScores.cpp +++ b/stepmania/src/ScreenHighScores.cpp @@ -37,7 +37,7 @@ ScreenHighScores::ScreenHighScores() : ScreenAttract("ScreenHighScores","high sc m_textCategory.SetXY( CATEGORY_X, CATEGORY_Y ); m_textCategory.SetText( "" ); - for( int i=0; iGetPathTo("Graphics",("high scores bullets 1x5")) ); m_sprBullets[i].SetXY( BULLETS_START_X+LINE_SPACING_X*i, BULLETS_START_Y+LINE_SPACING_Y*i ); diff --git a/stepmania/src/ScreenHighScores.h b/stepmania/src/ScreenHighScores.h index 83886d612e..70677ee601 100644 --- a/stepmania/src/ScreenHighScores.h +++ b/stepmania/src/ScreenHighScores.h @@ -10,8 +10,8 @@ */ #include "ScreenAttract.h" +#include "GameConstantsAndTypes.h" // for NUM_HIGH_SCORE_LINES -#define NUM_HIGH_SCORES 5 class ScreenHighScores : public ScreenAttract { @@ -20,9 +20,9 @@ public: protected: BitmapText m_textCategory; - Sprite m_sprBullets[NUM_HIGH_SCORES]; - BitmapText m_textNames[NUM_HIGH_SCORES]; - BitmapText m_textScores[NUM_HIGH_SCORES]; + Sprite m_sprBullets[NUM_HIGH_SCORE_LINES]; + BitmapText m_textNames[NUM_HIGH_SCORE_LINES]; + BitmapText m_textScores[NUM_HIGH_SCORE_LINES]; }; diff --git a/stepmania/src/ScreenInstructions.cpp b/stepmania/src/ScreenInstructions.cpp index 6cad65d14a..61053f40c5 100644 --- a/stepmania/src/ScreenInstructions.cpp +++ b/stepmania/src/ScreenInstructions.cpp @@ -78,12 +78,15 @@ ScreenInstructions::ScreenInstructions() case PLAY_MODE_ARCADE: sHowToPlayPath = THEME->GetPathTo("Graphics","instructions arcade"); break; - case PLAY_MODE_ENDLESS: - sHowToPlayPath = THEME->GetPathTo("Graphics","instructions endless"); + case PLAY_MODE_NONSTOP: + sHowToPlayPath = THEME->GetPathTo("Graphics","instructions nonstop"); break; case PLAY_MODE_ONI: sHowToPlayPath = THEME->GetPathTo("Graphics","instructions oni"); break; + case PLAY_MODE_ENDLESS: + sHowToPlayPath = THEME->GetPathTo("Graphics","instructions endless"); + break; default: ASSERT(0); } @@ -144,6 +147,7 @@ void ScreenInstructions::HandleScreenMessage( const ScreenMessage SM ) case PLAY_MODE_ARCADE: SCREENMAN->SetNewScreen( NEXT_SCREEN_ARCADE ); break; + case PLAY_MODE_NONSTOP: case PLAY_MODE_ONI: case PLAY_MODE_ENDLESS: SCREENMAN->SetNewScreen( NEXT_SCREEN_ONI ); diff --git a/stepmania/src/ScreenMusicScroll.cpp b/stepmania/src/ScreenMusicScroll.cpp index 77d0214926..0be7eb37bc 100644 --- a/stepmania/src/ScreenMusicScroll.cpp +++ b/stepmania/src/ScreenMusicScroll.cpp @@ -78,6 +78,8 @@ const CString CREDIT_LINES[] = "Dro Kulix (Peter S. May)", "nmspaz (Jared Roberts)", "binarys (Brendan Walker)", + "Lance Gilbert (Neovanglist)", + "Michel Donais", "Mantis (Ben Nordstrom)", "Parasyte (Chris Gomez)", "dirkthedaring (Michael Patterson)", diff --git a/stepmania/src/ScreenNameEntry.cpp b/stepmania/src/ScreenNameEntry.cpp new file mode 100644 index 0000000000..941a4d7eba --- /dev/null +++ b/stepmania/src/ScreenNameEntry.cpp @@ -0,0 +1,93 @@ +#include "stdafx.h" +/* +----------------------------------------------------------------------------- + Class: ScreenNameEntry + + Desc: See header. + + Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. + Chris Danford +----------------------------------------------------------------------------- +*/ + +#include "ScreenNameEntry.h" +#include "SongManager.h" +#include "ScreenManager.h" +#include "GameConstantsAndTypes.h" +#include "RageUtil.h" +#include "PrefsManager.h" +#include "GameManager.h" +#include "RageLog.h" +#include "GameState.h" +#include "RageSoundManager.h" +#include "ThemeManager.h" +#include "ScreenHighScores.h" + + +// +// Defines specific to ScreenNameEntry +// +#define EXPLANATION_X THEME->GetMetricF("ScreenNameEntry","ExplanationX") +#define EXPLANATION_Y THEME->GetMetricF("ScreenNameEntry","ExplanationY") +#define EXPLANATION_TEXT THEME->GetMetric("ScreenNameEntry","ExplanationText") +#define HELP_TEXT THEME->GetMetric("ScreenNameEntry","HelpText") + +const ScreenMessage SM_GoToPrevScreen = ScreenMessage(SM_User+1); +const ScreenMessage SM_GoToNextScreen = ScreenMessage(SM_User+2); + + +ScreenNameEntry::ScreenNameEntry() +{ + LOG->Trace( "ScreenNameEntry::ScreenNameEntry()" ); + + m_Background; + + for( int p=0; pIsPlayerEnabled(p) ) + continue; // skip + + m_iHighScoreIndex[p] = -1; + + // is this a new high score? + + + + m_GrayArrowRow[p]; + m_textSelectedChars[p]; + m_textScrollingChars[p]; + m_textCategory[p]; + } + + m_Timer; + + m_Fade; +} + + +ScreenNameEntry::~ScreenNameEntry() +{ + LOG->Trace( "ScreenNameEntry::~ScreenNameEntry()" ); +} + +void ScreenNameEntry::DrawPrimitives() +{ + Screen::DrawPrimitives(); +} + +void ScreenNameEntry::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI ) +{ + LOG->Trace( "ScreenNameEntry::Input()" ); + + Screen::Input( DeviceI, type, GameI, MenuI, StyleI ); +} + +void ScreenNameEntry::HandleScreenMessage( const ScreenMessage SM ) +{ + switch( SM ) + { + case SM_GoToNextScreen: + SCREENMAN->SetNewScreen( "ScreenMusicScroll" ); + break; + } +} diff --git a/stepmania/src/ScreenNameEntry.h b/stepmania/src/ScreenNameEntry.h new file mode 100644 index 0000000000..2f2a988e0b --- /dev/null +++ b/stepmania/src/ScreenNameEntry.h @@ -0,0 +1,45 @@ +/* +----------------------------------------------------------------------------- + Class: ScreenNameEntry + + Desc: Enter you name for a new high score. + + Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. + Chris Danford +----------------------------------------------------------------------------- +*/ + +#include "Screen.h" +#include "SongSelector.h" +#include "BitmapText.h" +#include "TransitionFade.h" +#include "RandomSample.h" +#include "GrayArrowRow.h" + +class ScreenNameEntry : public Screen +{ +public: + ScreenNameEntry(); + virtual ~ScreenNameEntry(); + + virtual void DrawPrimitives(); + virtual void Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI ); + virtual void HandleScreenMessage( const ScreenMessage SM ); + +private: + + BGAnimation m_Background; + + GrayArrowRow m_GrayArrowRow[NUM_PLAYERS]; + BitmapText m_textSelectedChars[NUM_PLAYERS]; + BitmapText m_textScrollingChars[NUM_PLAYERS]; + BitmapText m_textCategory[NUM_PLAYERS]; + MenuTimer m_Timer; + + TransitionFade m_Fade; + + int m_iHighScoreIndex[NUM_PLAYERS]; +}; + + + diff --git a/stepmania/src/ScreenPlayerOptions.cpp b/stepmania/src/ScreenPlayerOptions.cpp index 30985683c5..4c7abf8bb4 100644 --- a/stepmania/src/ScreenPlayerOptions.cpp +++ b/stepmania/src/ScreenPlayerOptions.cpp @@ -138,7 +138,8 @@ void ScreenPlayerOptions::ExportOptions() void ScreenPlayerOptions::GoToPrevState() { - if(GAMESTATE->m_PlayMode == PLAY_MODE_ONI || + if( GAMESTATE->m_PlayMode == PLAY_MODE_NONSTOP || + GAMESTATE->m_PlayMode == PLAY_MODE_ONI || GAMESTATE->m_PlayMode == PLAY_MODE_ENDLESS) SCREENMAN->SetNewScreen( "ScreenSelectCourse" ); else diff --git a/stepmania/src/ScreenSelectCourse.cpp b/stepmania/src/ScreenSelectCourse.cpp index 3a982e94fe..1ac4ca97ee 100644 --- a/stepmania/src/ScreenSelectCourse.cpp +++ b/stepmania/src/ScreenSelectCourse.cpp @@ -302,7 +302,7 @@ void ScreenSelectCourse::MenuStart( PlayerNumber pn ) Course* pCourse = m_MusicWheel.GetSelectedCourse(); GAMESTATE->m_pCurCourse = pCourse; for( int p=0; pGetPlayerOptions( &GAMESTATE->m_PlayerOptions[p] ); + pCourse->GetPlayerOptions( 0, &GAMESTATE->m_PlayerOptions[p] ); pCourse->GetSongOptions( &GAMESTATE->m_SongOptions ); m_Menu.StopTimer(); diff --git a/stepmania/src/ScreenSelectDifficulty.cpp b/stepmania/src/ScreenSelectDifficulty.cpp index 226ed4e334..032c249c6e 100644 --- a/stepmania/src/ScreenSelectDifficulty.cpp +++ b/stepmania/src/ScreenSelectDifficulty.cpp @@ -24,52 +24,24 @@ const float LOCK_INPUT_TIME = 0.30f; // lock input while waiting for tweening to complete -#define MORE_X( p ) THEME->GetMetricF("ScreenSelectDifficulty",ssprintf("MorePage%dX",p+1)) -#define MORE_Y( i ) THEME->GetMetricF("ScreenSelectDifficulty",ssprintf("MorePage%dY",i+1)) -#define EXPLANATION_X( p ) THEME->GetMetricF("ScreenSelectDifficulty",ssprintf("ExplanationPage%dX",p+1)) -#define EXPLANATION_Y( i ) THEME->GetMetricF("ScreenSelectDifficulty",ssprintf("ExplanationPage%dY",i+1)) -#define EASY_X THEME->GetMetricF("ScreenSelectDifficulty","EasyX") -#define EASY_Y THEME->GetMetricF("ScreenSelectDifficulty","EasyY") -#define MEDIUM_X THEME->GetMetricF("ScreenSelectDifficulty","MediumX") -#define MEDIUM_Y THEME->GetMetricF("ScreenSelectDifficulty","MediumY") -#define HARD_X THEME->GetMetricF("ScreenSelectDifficulty","HardX") -#define HARD_Y THEME->GetMetricF("ScreenSelectDifficulty","HardY") -#define ONI_X THEME->GetMetricF("ScreenSelectDifficulty","OniX") -#define ONI_Y THEME->GetMetricF("ScreenSelectDifficulty","OniY") -#define ENDLESS_X THEME->GetMetricF("ScreenSelectDifficulty","EndlessX") -#define ENDLESS_Y THEME->GetMetricF("ScreenSelectDifficulty","EndlessY") +#define MORE_X( page ) THEME->GetMetricF("ScreenSelectDifficulty",ssprintf("MorePage%dX",page+1)) +#define MORE_Y( page ) THEME->GetMetricF("ScreenSelectDifficulty",ssprintf("MorePage%dY",page+1)) +#define EXPLANATION_X( page ) THEME->GetMetricF("ScreenSelectDifficulty",ssprintf("ExplanationPage%dX",page+1)) +#define EXPLANATION_Y( page ) THEME->GetMetricF("ScreenSelectDifficulty",ssprintf("ExplanationPage%dY",page+1)) +#define CHOICE_X( i ) THEME->GetMetricF("ScreenSelectDifficulty",ssprintf("Choice%dX",i+1)) +#define CHOICE_Y( i ) THEME->GetMetricF("ScreenSelectDifficulty",ssprintf("Choice%dY",i+1)) #define CURSOR_OFFSET_X( p ) THEME->GetMetricF("ScreenSelectDifficulty",ssprintf("CursorOffsetP%dX",p+1)) #define CURSOR_OFFSET_Y( i ) THEME->GetMetricF("ScreenSelectDifficulty",ssprintf("CursorOffsetP%dY",i+1)) #define CURSOR_SHADOW_LENGTH_X THEME->GetMetricF("ScreenSelectDifficulty","CursorShadowLengthX") #define CURSOR_SHADOW_LENGTH_Y THEME->GetMetricF("ScreenSelectDifficulty","CursorShadowLengthY") +#define INITIAL_CHOICE THEME->GetMetricI("ScreenSelectDifficulty","InitialChoice") #define HELP_TEXT THEME->GetMetric("ScreenSelectDifficulty","HelpText") #define TIMER_SECONDS THEME->GetMetricI("ScreenSelectDifficulty","TimerSeconds") #define NEXT_SCREEN_ARCADE THEME->GetMetric("ScreenSelectDifficulty","NextScreenArcade") #define NEXT_SCREEN_ONI THEME->GetMetric("ScreenSelectDifficulty","NextScreenOni") - -float ITEM_X( int iItemIndex ) { - switch( iItemIndex ) { - case 0: return EASY_X; - case 1: return MEDIUM_X; - case 2: return HARD_X; - case 3: return ONI_X; - case 4: return ENDLESS_X; - default: ASSERT(0); return 0; - } -} -float ITEM_Y( int iItemIndex ) { - switch( iItemIndex ) { - case 0: return EASY_Y; - case 1: return MEDIUM_Y; - case 2: return HARD_Y; - case 3: return ONI_Y; - case 4: return ENDLESS_Y; - default: ASSERT(0); return 0; - } -} -float CURSOR_X( int iItemIndex, int p ) { return ITEM_X(iItemIndex) + CURSOR_OFFSET_X(p); } -float CURSOR_Y( int iItemIndex, int p ) { return ITEM_Y(iItemIndex) + CURSOR_OFFSET_Y(p); } +float CURSOR_X( int choice, int p ) { return CHOICE_X(choice) + CURSOR_OFFSET_X(p); } +float CURSOR_Y( int choice, int p ) { return CHOICE_Y(choice) + CURSOR_OFFSET_Y(p); } const ScreenMessage SM_GoToPrevScreen = ScreenMessage(SM_User + 1); @@ -96,30 +68,20 @@ ScreenSelectDifficulty::ScreenSelectDifficulty() this->AddChild( &m_Menu ); - for( unsigned d=0; dGetPathTo("Graphics",sPictureFile) ); - m_sprPicture[d].SetXY( ITEM_X(d), ITEM_Y(d) ); - m_sprPicture[d].SetVertAlign( align_bottom ); - m_sprPicture[d].TurnShadowOff(); - m_framePages.AddChild( &m_sprPicture[d] ); + CString sHeaderFile = ssprintf( "select difficulty header %d", c+1 ); + CString sPictureFile = ssprintf( "select difficulty picture %d", c+1 ); - m_sprHeader[d].Load( THEME->GetPathTo("Graphics",sHeaderFile) ); - m_sprHeader[d].SetXY( ITEM_X(d), ITEM_Y(d) ); - m_sprHeader[d].SetVertAlign( align_top ); - m_sprHeader[d].TurnShadowOff(); - m_framePages.AddChild( &m_sprHeader[d] ); + m_sprPicture[c].Load( THEME->GetPathTo("Graphics",sPictureFile) ); + m_sprPicture[c].SetXY( CHOICE_X(c), CHOICE_Y(c) ); + m_sprPicture[c].SetVertAlign( align_bottom ); + m_framePages.AddChild( &m_sprPicture[c] ); + + m_sprHeader[c].Load( THEME->GetPathTo("Graphics",sHeaderFile) ); + m_sprHeader[c].SetXY( CHOICE_X(c), CHOICE_Y(c) ); + m_sprHeader[c].SetVertAlign( align_top ); + m_framePages.AddChild( &m_sprHeader[c] ); } for( p=0; pIsPlayerEnabled((PlayerNumber)p) ) @@ -217,57 +180,50 @@ void ScreenSelectDifficulty::DrawPrimitives() void ScreenSelectDifficulty::HandleScreenMessage( const ScreenMessage SM ) { + int p; + switch( SM ) { case SM_MenuTimer: - { - for( int p=0; pIsPlayerEnabled(p) ) - MenuStart( (PlayerNumber)p ); - } + for( p=0; pIsPlayerEnabled(p) ) + MenuStart( (PlayerNumber)p ); break; case SM_GoToPrevScreen: SCREENMAN->SetNewScreen( "ScreenTitleMenu" ); break; case SM_GoToNextScreen: + for( p=0; pm_PreferredDifficulty[p] = DIFFICULTY_EASY; break; - case 1: GAMESTATE->m_PreferredDifficulty[p] = DIFFICULTY_MEDIUM; break; - case 2: GAMESTATE->m_PreferredDifficulty[p] = DIFFICULTY_HARD; break; - } + switch( m_Choice[p] ) + { + case 3: // need to set preferred difficulty even for courses + case 4: + case 5: + case 0: GAMESTATE->m_PreferredDifficulty[p] = DIFFICULTY_EASY; break; + case 1: GAMESTATE->m_PreferredDifficulty[p] = DIFFICULTY_MEDIUM; break; + case 2: GAMESTATE->m_PreferredDifficulty[p] = DIFFICULTY_HARD; break; + } } - switch( m_iSelection[PLAYER_1] ) + switch( m_Choice[GAMESTATE->m_MasterPlayerNumber] ) { case 0: case 1: - case 2: // something on page 1 was chosen - GAMESTATE->m_PlayMode = PLAY_MODE_ARCADE; - break; - case 3: - GAMESTATE->m_PlayMode = PLAY_MODE_ONI; - break; - case 4: - GAMESTATE->m_PlayMode = PLAY_MODE_ENDLESS; - break; - default: - ASSERT(0); // bad selection + case 2: GAMESTATE->m_PlayMode = PLAY_MODE_ARCADE; break; + case 3: GAMESTATE->m_PlayMode = PLAY_MODE_NONSTOP; break; + case 4: GAMESTATE->m_PlayMode = PLAY_MODE_ONI; break; + case 5: GAMESTATE->m_PlayMode = PLAY_MODE_ENDLESS; break; + default: ASSERT(0); // bad selection } switch( GAMESTATE->m_PlayMode ) { - case PLAY_MODE_ARCADE: - SCREENMAN->SetNewScreen( NEXT_SCREEN_ARCADE ); - break; + case PLAY_MODE_ARCADE: SCREENMAN->SetNewScreen( NEXT_SCREEN_ARCADE ); break; + case PLAY_MODE_NONSTOP: case PLAY_MODE_ONI: - case PLAY_MODE_ENDLESS: - SCREENMAN->SetNewScreen( NEXT_SCREEN_ONI ); - break; - default: - ASSERT(0); + case PLAY_MODE_ENDLESS: SCREENMAN->SetNewScreen( NEXT_SCREEN_ONI ); break; + default: ASSERT(0); } break; case SM_StartTweeningOffScreen: @@ -282,37 +238,37 @@ void ScreenSelectDifficulty::HandleScreenMessage( const ScreenMessage SM ) void ScreenSelectDifficulty::MenuLeft( PlayerNumber pn ) { - if( m_iSelection[pn] == 0 ) // can't go left any more + if( m_Choice[pn] == 0 ) // can't go left any more return; if( m_bChosen[pn] ) return; - ChangeTo( pn, m_iSelection[pn], m_iSelection[pn]-1 ); + ChangeTo( pn, m_Choice[pn], m_Choice[pn]-1 ); } void ScreenSelectDifficulty::MenuRight( PlayerNumber pn ) { - if( m_iSelection[pn] == NUM_DIFFICULTY_ITEMS-1 ) // can't go right any more + if( m_Choice[pn] == NUM_CHOICES-1 ) // can't go right any more return; if( m_bChosen[pn] ) return; - ChangeTo( pn, m_iSelection[pn], m_iSelection[pn]+1 ); + ChangeTo( pn, m_Choice[pn], m_Choice[pn]+1 ); } bool ScreenSelectDifficulty::IsItemOnPage2( int iItemIndex ) { - ASSERT( iItemIndex >= 0 && iItemIndex < unsigned(NUM_DIFFICULTY_ITEMS) ); + ASSERT( iItemIndex >= 0 && iItemIndex < NUM_CHOICES ); - return iItemIndex >= unsigned(NUM_ITEMS_ON_PAGE_1); + return iItemIndex >= unsigned(NUM_CHOICES_ON_PAGE_1); } bool ScreenSelectDifficulty::SelectedSomethingOnPage2() { for( int p=0; pIsPlayerEnabled(p) && IsItemOnPage2(m_iSelection[p]) ) + if( GAMESTATE->IsPlayerEnabled(p) && IsItemOnPage2(m_Choice[p]) ) return true; } return false; @@ -335,22 +291,16 @@ void ScreenSelectDifficulty::ChangeTo( PlayerNumber pn, int iSelectionWas, int i if( bSomeoneMadeAChoice && (bChangedPagesFrom1To2 || bChangedPagesFrom2To1) ) return; // don't allow changing pages after one player has chosen - if( bSelectedSomethingOnPage2 ) + if( bSelectedSomethingOnPage2 || bChangedPagesFrom2To1 ) { // change both players for( int p=0; pIsPlayerEnabled((PlayerNumber)p) ) continue; - int iSelection = m_iSelection[p]; + int iSelection = m_Choice[p]; m_sprCursor[p].SetXY( CURSOR_X(iSelection,(PlayerNumber)p), CURSOR_Y(iSelection,(PlayerNumber)p) ); /* @@ -558,7 +508,7 @@ void ScreenSelectDifficulty::TweenOnScreen() m_sprJoinMessagehadow[p].SetTweenDiffuse( colorOriginal ); } - for( unsigned d=0; dSetNewScreen( NEXT_SCREEN ); break; + case PLAY_MODE_NONSTOP: case PLAY_MODE_ONI: case PLAY_MODE_ENDLESS: SCREENMAN->SetNewScreen( "ScreenSelectCourse" ); break; + default: + ASSERT(0); } break; } diff --git a/stepmania/src/ScreenStage.cpp b/stepmania/src/ScreenStage.cpp index 8ae0aa264f..a8c3d6bab6 100644 --- a/stepmania/src/ScreenStage.cpp +++ b/stepmania/src/ScreenStage.cpp @@ -50,6 +50,7 @@ enum StageMode MODE_FINAL, MODE_EXTRA1, MODE_EXTRA2, + MODE_NONSTOP, MODE_ONI, MODE_ENDLESS }; @@ -62,7 +63,8 @@ ScreenStage::ScreenStage() StageMode stage_mode; - if( GAMESTATE->m_PlayMode == PLAY_MODE_ONI ) stage_mode = MODE_ONI; + if( GAMESTATE->m_PlayMode == PLAY_MODE_NONSTOP ) stage_mode = MODE_NONSTOP; + else if( GAMESTATE->m_PlayMode == PLAY_MODE_ONI ) stage_mode = MODE_ONI; else if( GAMESTATE->m_PlayMode == PLAY_MODE_ENDLESS ) stage_mode = MODE_ENDLESS; else if( GAMESTATE->IsExtraStage() ) stage_mode = MODE_EXTRA1; else if( GAMESTATE->IsExtraStage2() ) stage_mode = MODE_EXTRA2; @@ -89,9 +91,10 @@ ScreenStage::ScreenStage() } } break; - case MODE_FINAL: SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("stage final") ); break; - case MODE_EXTRA1: SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("stage extra1") ); break; - case MODE_EXTRA2: SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("stage extra2") ); break; + case MODE_FINAL: SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("stage final") ); break; + case MODE_EXTRA1: SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("stage extra1") ); break; + case MODE_EXTRA2: SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("stage extra2") ); break; + case MODE_NONSTOP: SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("stage nonstop") ); break; case MODE_ONI: SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("stage oni") ); break; case MODE_ENDLESS: SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("stage endless") ); break; default: ASSERT(0); @@ -185,6 +188,9 @@ ScreenStage::ScreenStage() case MODE_EXTRA2: m_sprStage.Load( THEME->GetPathTo("Graphics","stage extra2") ); break; + case MODE_NONSTOP: + m_sprStage.Load( THEME->GetPathTo("Graphics","stage nonstop") ); + break; case MODE_ONI: m_sprStage.Load( THEME->GetPathTo("Graphics","stage oni") ); break; diff --git a/stepmania/src/ScreenTitleMenu.cpp b/stepmania/src/ScreenTitleMenu.cpp index 35dc969fb9..7c8d5c1f64 100644 --- a/stepmania/src/ScreenTitleMenu.cpp +++ b/stepmania/src/ScreenTitleMenu.cpp @@ -27,21 +27,6 @@ #include "RageSoundManager.h" -const CString CHOICE_TEXT[ScreenTitleMenu::NUM_TITLE_MENU_CHOICES] = { - "GAME START", - "SWITCH GAME", - "CONFIG KEY/JOY", - "INPUT OPTIONS", - "MACHINE OPTIONS", - "GRAPHIC OPTIONS", - "APPEARANCE OPTIONS", - "EDIT/RECORD/SYNCH", - #ifdef _DEBUG - "SANDBOX", - #endif - "EXIT", -}; - #define HELP_X THEME->GetMetricF("ScreenTitleMenu","HelpX") #define HELP_Y THEME->GetMetricF("ScreenTitleMenu","HelpY") #define CHOICES_X THEME->GetMetricF("ScreenTitleMenu","ChoicesX") @@ -63,6 +48,20 @@ const ScreenMessage SM_PlayComment = ScreenMessage(SM_User+1); const ScreenMessage SM_GoToNextScreen = ScreenMessage(SM_User+12); const ScreenMessage SM_GoToAttractLoop = ScreenMessage(SM_User+13); +const CString CHOICE_TEXT[ScreenTitleMenu::NUM_CHOICES]= { + "GAME START", + "SWITCH GAME", + "CONFIG KEY/JOY", + "INPUT OPTIONS", + "MACHINE OPTIONS", + "GRAPHIC OPTIONS", + "APPEARANCE OPTIONS", + "EDIT/RECORD/SYNCH", + #ifdef _DEBUG + "SANDBOX", + #endif + "EXIT", +}; ScreenTitleMenu::ScreenTitleMenu() { @@ -90,7 +89,7 @@ ScreenTitleMenu::ScreenTitleMenu() { case PrefsManager::COIN_HOME: int i; - for( i=0; i< NUM_TITLE_MENU_CHOICES; i++ ) + for( i=0; iGetPathTo("Fonts","titlemenu") ); m_textChoice[i].SetText( CHOICE_TEXT[i] ); @@ -117,11 +116,11 @@ ScreenTitleMenu::ScreenTitleMenu() m_soundSelect.Load( THEME->GetPathTo("Sounds","menu start") ); m_soundInvalid.Load( THEME->GetPathTo("Sounds","menu invalid") ); - m_TitleMenuChoice = CHOICE_GAME_START; + m_Choice = CHOICE_GAME_START; - for( int i=0; iPlayMusic( THEME->GetPathTo("Sounds","title menu music") ); @@ -168,12 +167,12 @@ void ScreenTitleMenu::Input( const DeviceInput& DeviceI, const InputEventType ty { case PrefsManager::COIN_HOME: TimeToDemonstration.GetDeltaTime(); /* Reset the demonstration timer when a key is pressed. */ - LoseFocus( m_TitleMenuChoice ); - if( m_TitleMenuChoice == 0 ) // wrap around - m_TitleMenuChoice = (ScreenTitleMenu::TitleMenuChoice)((int)NUM_TITLE_MENU_CHOICES); - m_TitleMenuChoice = TitleMenuChoice( m_TitleMenuChoice-1 ); + LoseFocus( m_Choice ); + if( m_Choice == 0 ) // wrap around + m_Choice = (Choice)((int)NUM_CHOICES); + m_Choice = Choice( m_Choice-1 ); m_soundChange.PlayRandom(); - GainFocus( m_TitleMenuChoice ); + GainFocus( m_Choice ); break; case PrefsManager::COIN_PAY: case PrefsManager::COIN_FREE: @@ -185,12 +184,12 @@ void ScreenTitleMenu::Input( const DeviceInput& DeviceI, const InputEventType ty { case PrefsManager::COIN_HOME: TimeToDemonstration.GetDeltaTime(); /* Reset the demonstration timer when a key is pressed. */ - LoseFocus( m_TitleMenuChoice ); - if( m_TitleMenuChoice == (int)ScreenTitleMenu::NUM_TITLE_MENU_CHOICES-1 ) - m_TitleMenuChoice = (TitleMenuChoice)-1; // wrap around - m_TitleMenuChoice = TitleMenuChoice( m_TitleMenuChoice+1 ); + LoseFocus( m_Choice ); + if( m_Choice == (int)ScreenTitleMenu::NUM_CHOICES-1 ) + m_Choice = (Choice)-1; // wrap around + m_Choice = Choice( m_Choice+1 ); m_soundChange.PlayRandom(); - GainFocus( m_TitleMenuChoice ); + GainFocus( m_Choice ); break; case PrefsManager::COIN_PAY: case PrefsManager::COIN_FREE: @@ -219,7 +218,7 @@ void ScreenTitleMenu::Input( const DeviceInput& DeviceI, const InputEventType ty GAMESTATE->m_MasterPlayerNumber = MenuI.player; GAMESTATE->m_bPlayersCanJoin = false; - switch( m_TitleMenuChoice ) + switch( m_Choice ) { case CHOICE_GAME_START: case CHOICE_SELECT_GAME: @@ -284,7 +283,7 @@ void ScreenTitleMenu::HandleScreenMessage( const ScreenMessage SM ) this->SendScreenMessage( SM_PlayComment, SECONDS_BETWEEN_COMMENTS ); break; case SM_GoToNextScreen: - switch( m_TitleMenuChoice ) + switch( m_Choice ) { case CHOICE_GAME_START: SCREENMAN->SetNewScreen( NEXT_SCREEN ); diff --git a/stepmania/src/ScreenTitleMenu.h b/stepmania/src/ScreenTitleMenu.h index 8b4479d351..537174d082 100644 --- a/stepmania/src/ScreenTitleMenu.h +++ b/stepmania/src/ScreenTitleMenu.h @@ -28,7 +28,7 @@ public: virtual void Update( float fDelta ); virtual void HandleScreenMessage( const ScreenMessage SM ); - enum TitleMenuChoice { + enum Choice { CHOICE_GAME_START = 0, CHOICE_SELECT_GAME, CHOICE_MAP_INSTRUMENTS, @@ -41,24 +41,25 @@ public: CHOICE_SANDBOX, #endif CHOICE_EXIT, - NUM_TITLE_MENU_CHOICES // leave this at the end! + NUM_CHOICES // leave this at the end! }; + private: void GainFocus( int iChoiceIndex ); void LoseFocus( int iChoiceIndex ); - TitleMenuChoice m_TitleMenuChoice; + Choice m_Choice; - BitmapText m_textHelp; - BitmapText m_textChoice[NUM_TITLE_MENU_CHOICES]; + BitmapText m_textHelp; + BitmapText m_textChoice[NUM_CHOICES]; - RandomSample m_soundAttract; - RandomSample m_soundChange; - RandomSample m_soundSelect; - RandomSample m_soundInvalid; + RandomSample m_soundAttract; + RandomSample m_soundChange; + RandomSample m_soundSelect; + RandomSample m_soundInvalid; - RageTimer TimeToDemonstration; + RageTimer TimeToDemonstration; }; diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index 80141db8b9..7e5680b056 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -265,11 +265,10 @@ void SongManager::ReadStatisticsFromDisk() // load song statistics - const IniFile::key *Key = ini.GetKey( "Statistics" ); - if( Key ) + const IniFile::key *pSongsKey = ini.GetKey( "Statistics" ); + if( pSongsKey ) { - for( IniFile::key::const_iterator i = Key->begin(); - i != Key->end(); ++i ) + for( IniFile::key::const_iterator i = pSongsKey->begin(); i != pSongsKey->end(); ++i ) { CString name = i->first; CString value = i->second; @@ -282,7 +281,7 @@ void SongManager::ReadStatisticsFromDisk() unsigned i; // Parse for Song name and Notes name - iRetVal = sscanf( name, "%[^:]::%[^:]::%[^\n]", szSongDir, szNotesType, szNotesDescription ); + iRetVal = sscanf( name.c_str(), "%[^:]::%[^:]::%[^\n]", szSongDir, szNotesType, szNotesDescription ); if( iRetVal != 3 ) continue; // this line doesn't match what is expected @@ -321,7 +320,7 @@ void SongManager::ReadStatisticsFromDisk() char szGradeLetters[10]; // longest possible string is "AAA" iRetVal = sscanf( - value, + value.c_str(), "%d::%[^:]::%d::%d", &pNotes->m_iNumTimesPlayed, szGradeLetters, @@ -334,6 +333,45 @@ void SongManager::ReadStatisticsFromDisk() pNotes->m_TopGrade = StringToGrade( szGradeLetters ); } } + + // load course statistics + const IniFile::key *pCoursesKey = ini.GetKey( "Courses" ); + if( pCoursesKey ) + { + for( IniFile::key::const_iterator i = pCoursesKey->begin(); i != pCoursesKey->end(); ++i ) + { + CString name = i->first; + CString value = i->second; + + // Each value has the format "CoursePath,Difficulty,Slot=DancePoints,SurviveTime,sName" + + // Parse left hand side + char szCoursePath[256]; + Difficulty difficulty; + int iSlot; + int iDancePoints; + float fSurviveTime; + char szName[256]; + + int iRetVal; + iRetVal = sscanf( name.c_str(), "%[^,],%d,%d", szCoursePath, &difficulty, &iSlot ); + if( iRetVal != 3 ) + continue; // line doesn't match what is expected + iRetVal = sscanf( value.c_str(), "%d,%f,%d[^\n]", &iDancePoints, &fSurviveTime, &szName ); + if( iRetVal != 3 ) + continue; // line doesn't match what is expected + + + // Search for the corresponding Course pointer. + Course* pCourse = SONGMAN->GetCourseFromPath( szCoursePath ); + if( pCourse == NULL ) // didn't find a match + continue; // skip this entry + +// pCourse->m_TopGrade = StringToGrade( szGradeLetters ); + } + } + + } void SongManager::SaveStatisticsToDisk() @@ -460,11 +498,11 @@ void SongManager::InitCoursesFromDisk() Course course; course.LoadFromCRSFile( "Courses\\" + saCourseFiles[i], m_pSongs ); if( course.GetNumStages() > 0 ) - m_aOniCourses.push_back( course ); + m_Courses.push_back( course ); } // - // Create endless courses + // Create group courses for Endless and Nonstop // CStringArray saGroupNames; this->GetGroupNames( saGroupNames ); @@ -481,30 +519,9 @@ void SongManager::InitCoursesFromDisk() course.CreateEndlessCourseFromGroupAndDifficulty( sGroupName, dc, apGroupSongs ); if( course.GetNumStages() > 0 ) - m_aEndlessCourses.push_back( course ); + m_Courses.push_back( course ); } } - - - // - // Load extra stages - // - for( g=0; g 0 ) - m_aExtraCourses.push_back( course ); - } - } - - - } void SongManager::ReloadCourses() @@ -523,9 +540,46 @@ void SongManager::CleanCourses() m_pSongs[i]->m_apNotes[n]->Compress(); } } - } +void SongManager::GetNonstopCourses( vector AddTo ) +{ + PlayerOptions po; + for( unsigned i=0; i 0 ) // use battery life meter + continue; + + AddTo.push_back( &m_Courses[i] ); + } +} + +void SongManager::GetOniCourses( vector AddTo ) +{ + PlayerOptions po; + for( unsigned i=0; i AddTo ) +{ + for( unsigned i=0; i &AddTo ); - // for Oni - vector m_aOniCourses; - - // for Extra Stages - vector m_aExtraCourses; - - // for Endless - vector m_aEndlessCourses; + // + // Courses for Nonstop, Oni, and Endless + // + vector m_Courses; void InitCoursesFromDisk(); void ReloadCourses(); void CleanCourses(); + void GetNonstopCourses( vector AddTo ); // add to if life meter type is BAR. + void GetOniCourses( vector AddTo ); // add to if life meter type is BATTERY. + void GetEndlessCourses( vector AddTo ); // add to if set to REPEAT. + + void GetExtraStageInfo( bool bExtra2, CString sPreferredGroup, const StyleDef *s, Song*& pSongOut, Notes*& pNotesOut, PlayerOptions& po_out, SongOptions& so_out ); Song* GetRandomSong(); Song* GetSongFromDir( CString sDir ); + Course* GetCourseFromPath( CString sPath ); // path to .crs file, or path to song group dir protected: void LoadStepManiaSongDir( CString sDir, LoadingWindow *ld ); diff --git a/stepmania/src/StepMania.vcproj b/stepmania/src/StepMania.vcproj index 9265cb4b7e..183eb87c55 100644 --- a/stepmania/src/StepMania.vcproj +++ b/stepmania/src/StepMania.vcproj @@ -231,12 +231,6 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ - - - - @@ -312,6 +306,12 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ + + + +