added DDREX Nonstop mode, added beginnings of high score tracking
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -33,6 +33,8 @@ Course::Course()
|
||||
|
||||
void Course::LoadFromCRSFile( CString sPath, vector<Song*> &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;
|
||||
|
||||
+15
-4
@@ -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<Song*> &apSongs );
|
||||
@@ -57,6 +58,16 @@ public:
|
||||
void GetSongAndNotesForCurrentStyle( vector<Song*>& apSongsOut, vector<Notes*>& 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();
|
||||
};
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -631,23 +631,17 @@ void MusicWheel::BuildWheelItemDatas( vector<WheelItemData> &arrayWheelItemDatas
|
||||
}
|
||||
|
||||
break;
|
||||
case PLAY_MODE_NONSTOP:
|
||||
case PLAY_MODE_ONI:
|
||||
case PLAY_MODE_ENDLESS:
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
vector<Course*> apCourses;
|
||||
switch( GAMESTATE->m_PlayMode )
|
||||
{
|
||||
case PLAY_MODE_ONI:
|
||||
for( i=0; i<SONGMAN->m_aOniCourses.size(); i++ )
|
||||
apCourses.push_back( &SONGMAN->m_aOniCourses[i] );
|
||||
SortCoursePointerArrayByDifficulty( apCourses );
|
||||
break;
|
||||
case PLAY_MODE_ENDLESS:
|
||||
for( i=0; i<SONGMAN->m_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; c<apCourses.size(); c++ ) // foreach course
|
||||
|
||||
@@ -126,6 +126,7 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
|
||||
case PLAY_MODE_ARCADE:
|
||||
m_ResultMode = bSummary ? RM_ARCADE_SUMMARY : RM_ARCADE_STAGE;
|
||||
break;
|
||||
case PLAY_MODE_NONSTOP:
|
||||
case PLAY_MODE_ONI:
|
||||
case PLAY_MODE_ENDLESS:
|
||||
m_ResultMode = RM_ONI;
|
||||
@@ -835,6 +836,7 @@ void ScreenEvaluation::MenuStart( PlayerNumber pn )
|
||||
case PLAY_MODE_ARCADE:
|
||||
m_Menu.TweenOffScreenToMenu( SM_GoToSelectMusic );
|
||||
break;
|
||||
case PLAY_MODE_NONSTOP:
|
||||
case PLAY_MODE_ONI:
|
||||
case PLAY_MODE_ENDLESS:
|
||||
m_Menu.TweenOffScreenToMenu( SM_GoToSelectCourse );
|
||||
|
||||
@@ -1,217 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
Class: ScreenEz2Stage
|
||||
|
||||
Desc: See header.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
Andrew Livy
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
/*
|
||||
#include "ScreenEz2Stage.h"
|
||||
#include "ScreenManager.h"
|
||||
#include "PrefsManager.h"
|
||||
#include "PrefsManager.h"
|
||||
#include "RageLog.h"
|
||||
#include "GameConstantsAndTypes.h"
|
||||
#include "BitmapText.h"
|
||||
#include "TransitionFadeWipe.h"
|
||||
#include "TransitionFade.h"
|
||||
#include "ScreenSelectMusic.h"
|
||||
#include "ScreenGameplay.h"
|
||||
#include "SongManager.h"
|
||||
#include "Sprite.h"
|
||||
#include "AnnouncerManager.h"
|
||||
#include "GameState.h"
|
||||
|
||||
|
||||
const ScreenMessage SM_StartFadingOut = ScreenMessage(SM_User + 1);
|
||||
const ScreenMessage SM_DoneFadingIn = ScreenMessage(SM_User + 2);
|
||||
const ScreenMessage SM_GoToNextState = ScreenMessage(SM_User + 3);
|
||||
|
||||
|
||||
ScreenEz2Stage::ScreenEz2Stage()
|
||||
{
|
||||
|
||||
MUSIC->Stop();
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
@@ -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;
|
||||
};
|
||||
*/
|
||||
|
||||
@@ -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; p<NUM_PLAYERS; p++ )
|
||||
@@ -300,6 +304,7 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration )
|
||||
case PLAY_MODE_ARCADE:
|
||||
m_pScoreDisplay[p] = new ScoreDisplayNormal;
|
||||
break;
|
||||
case PLAY_MODE_NONSTOP:
|
||||
case PLAY_MODE_ONI:
|
||||
case PLAY_MODE_ENDLESS:
|
||||
m_pScoreDisplay[p] = new ScoreDisplayOni;
|
||||
@@ -480,6 +485,7 @@ bool ScreenGameplay::IsLastSong()
|
||||
{
|
||||
case PLAY_MODE_ARCADE:
|
||||
return true;
|
||||
case PLAY_MODE_NONSTOP:
|
||||
case PLAY_MODE_ONI:
|
||||
case PLAY_MODE_ENDLESS:
|
||||
{
|
||||
@@ -510,6 +516,7 @@ void ScreenGameplay::LoadNextSong( bool bFirstLoad )
|
||||
{
|
||||
case PLAY_MODE_ARCADE:
|
||||
break;
|
||||
case PLAY_MODE_NONSTOP:
|
||||
case PLAY_MODE_ONI:
|
||||
case PLAY_MODE_ENDLESS:
|
||||
{
|
||||
@@ -542,8 +549,8 @@ void ScreenGameplay::LoadNextSong( bool bFirstLoad )
|
||||
if( asModifiers[iPlaySongIndex] != "" ) // some modifiers specified
|
||||
GAMESTATE->m_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 );
|
||||
|
||||
@@ -37,7 +37,7 @@ ScreenHighScores::ScreenHighScores() : ScreenAttract("ScreenHighScores","high sc
|
||||
m_textCategory.SetXY( CATEGORY_X, CATEGORY_Y );
|
||||
m_textCategory.SetText( "" );
|
||||
|
||||
for( int i=0; i<NUM_HIGH_SCORES; i++ )
|
||||
for( int i=0; i<NUM_HIGH_SCORE_LINES; i++ )
|
||||
{
|
||||
m_sprBullets[i].Load( THEME->GetPathTo("Graphics",("high scores bullets 1x5")) );
|
||||
m_sprBullets[i].SetXY( BULLETS_START_X+LINE_SPACING_X*i, BULLETS_START_Y+LINE_SPACING_Y*i );
|
||||
|
||||
@@ -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];
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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)",
|
||||
|
||||
@@ -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; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
if( !GAMESTATE->IsPlayerEnabled(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;
|
||||
}
|
||||
}
|
||||
@@ -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];
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -302,7 +302,7 @@ void ScreenSelectCourse::MenuStart( PlayerNumber pn )
|
||||
Course* pCourse = m_MusicWheel.GetSelectedCourse();
|
||||
GAMESTATE->m_pCurCourse = pCourse;
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
pCourse->GetPlayerOptions( &GAMESTATE->m_PlayerOptions[p] );
|
||||
pCourse->GetPlayerOptions( 0, &GAMESTATE->m_PlayerOptions[p] );
|
||||
pCourse->GetSongOptions( &GAMESTATE->m_SongOptions );
|
||||
|
||||
m_Menu.StopTimer();
|
||||
|
||||
@@ -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; d<NUM_DIFFICULTY_ITEMS; d++ )
|
||||
for( unsigned c=0; c<NUM_CHOICES; c++ )
|
||||
{
|
||||
CString sHeaderFile;
|
||||
CString sPictureFile;
|
||||
switch( d )
|
||||
{
|
||||
case 0: sHeaderFile = "select difficulty easy header"; sPictureFile = "select difficulty easy picture"; break;
|
||||
case 1: sHeaderFile = "select difficulty medium header"; sPictureFile = "select difficulty medium picture"; break;
|
||||
case 2: sHeaderFile = "select difficulty hard header"; sPictureFile = "select difficulty hard picture"; break;
|
||||
case 3: sHeaderFile = "select difficulty oni header"; sPictureFile = "select difficulty oni picture"; break;
|
||||
case 4: sHeaderFile = "select difficulty endless header"; sPictureFile = "select difficulty endless picture"; break;
|
||||
default: ASSERT(0);
|
||||
}
|
||||
m_sprPicture[d].Load( THEME->GetPathTo("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; p<NUM_PAGES; p++ )
|
||||
@@ -138,7 +100,8 @@ ScreenSelectDifficulty::ScreenSelectDifficulty()
|
||||
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
m_iSelection[p] = 1; // Select "medium"
|
||||
m_Choice[p] = (Choice)(INITIAL_CHOICE-1);
|
||||
CLAMP( m_Choice[p], (Choice)0, (Choice)(NUM_CHOICES-1) );
|
||||
m_bChosen[p] = false;
|
||||
|
||||
if( !GAMESTATE->IsPlayerEnabled((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; p<NUM_PLAYERS; p++ )
|
||||
if( GAMESTATE->IsPlayerEnabled(p) )
|
||||
MenuStart( (PlayerNumber)p );
|
||||
}
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
if( GAMESTATE->IsPlayerEnabled(p) )
|
||||
MenuStart( (PlayerNumber)p );
|
||||
break;
|
||||
case SM_GoToPrevScreen:
|
||||
SCREENMAN->SetNewScreen( "ScreenTitleMenu" );
|
||||
break;
|
||||
case SM_GoToNextScreen:
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
switch( m_iSelection[p] )
|
||||
{
|
||||
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_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; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
if( GAMESTATE->IsPlayerEnabled(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; p<NUM_PLAYERS; p++ )
|
||||
m_iSelection[p] = iSelectionIs;
|
||||
}
|
||||
else if( bChangedPagesFrom2To1 )
|
||||
{
|
||||
// change only the player who pressed the button
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
m_iSelection[p] = 2;
|
||||
m_Choice[p] = (Choice)iSelectionIs;
|
||||
}
|
||||
else // moving around in page 1
|
||||
{
|
||||
// change only the player who pressed the button
|
||||
m_iSelection[pn] = iSelectionIs;
|
||||
m_Choice[pn] = (Choice)iSelectionIs;
|
||||
|
||||
}
|
||||
|
||||
@@ -374,13 +324,13 @@ void ScreenSelectDifficulty::ChangeTo( PlayerNumber pn, int iSelectionWas, int i
|
||||
{
|
||||
m_sprCursor[p].StopTweening();
|
||||
m_sprCursor[p].BeginTweening( 0.2f, bChangedPages ? TWEEN_LINEAR : TWEEN_BIAS_BEGIN );
|
||||
m_sprCursor[p].SetTweenX( CURSOR_X(m_iSelection[p],(PlayerNumber)p) - CURSOR_SHADOW_LENGTH_X );
|
||||
m_sprCursor[p].SetTweenY( CURSOR_Y(m_iSelection[p],(PlayerNumber)p) - CURSOR_SHADOW_LENGTH_Y );
|
||||
m_sprCursor[p].SetTweenX( CURSOR_X(m_Choice[p],(PlayerNumber)p) - CURSOR_SHADOW_LENGTH_X );
|
||||
m_sprCursor[p].SetTweenY( CURSOR_Y(m_Choice[p],(PlayerNumber)p) - CURSOR_SHADOW_LENGTH_Y );
|
||||
|
||||
m_sprJoinMessagehadow[p].StopTweening();
|
||||
m_sprJoinMessagehadow[p].BeginTweening( 0.2f, bChangedPages ? TWEEN_LINEAR : TWEEN_BIAS_BEGIN );
|
||||
m_sprJoinMessagehadow[p].SetTweenX( CURSOR_X(m_iSelection[p],(PlayerNumber)p) );
|
||||
m_sprJoinMessagehadow[p].SetTweenY( CURSOR_Y(m_iSelection[p],(PlayerNumber)p) );
|
||||
m_sprJoinMessagehadow[p].SetTweenX( CURSOR_X(m_Choice[p],(PlayerNumber)p) );
|
||||
m_sprJoinMessagehadow[p].SetTweenY( CURSOR_Y(m_Choice[p],(PlayerNumber)p) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -398,7 +348,7 @@ void ScreenSelectDifficulty::MenuStart( PlayerNumber pn )
|
||||
|
||||
|
||||
m_soundSelect.Play();
|
||||
int iSelection = m_iSelection[pn];
|
||||
int iSelection = m_Choice[pn];
|
||||
|
||||
switch( iSelection )
|
||||
{
|
||||
@@ -490,30 +440,30 @@ void ScreenSelectDifficulty::TweenOffScreen()
|
||||
m_sprJoinMessagehadow[p].SetTweenDiffuse( RageColor(0,0,0,0) );
|
||||
}
|
||||
|
||||
for( unsigned d=0; d<NUM_DIFFICULTY_ITEMS; d++ )
|
||||
for( unsigned c=0; c<NUM_CHOICES; c++ )
|
||||
{
|
||||
if( SelectedSomethingOnPage2() != IsItemOnPage2(d) ) // item isn't on selected page
|
||||
if( SelectedSomethingOnPage2() != IsItemOnPage2(c) ) // item isn't on selected page
|
||||
continue; // don't tween
|
||||
|
||||
const float fPauseTime = d*0.2f;
|
||||
const float fPauseTime = c*0.2f;
|
||||
|
||||
// pause
|
||||
m_sprHeader[d].BeginTweening( fPauseTime );
|
||||
m_sprHeader[c].BeginTweening( fPauseTime );
|
||||
|
||||
m_sprPicture[d].BeginTweening( fPauseTime );
|
||||
m_sprPicture[c].BeginTweening( fPauseTime );
|
||||
|
||||
// roll up
|
||||
m_sprHeader[d].BeginTweening( 0.3f, TWEEN_BOUNCE_BEGIN );
|
||||
m_sprHeader[c].BeginTweening( 0.3f, TWEEN_BOUNCE_BEGIN );
|
||||
|
||||
m_sprPicture[d].BeginTweening( 0.3f, TWEEN_BOUNCE_BEGIN );
|
||||
m_sprPicture[d].SetTweenZoomY( 0 );
|
||||
m_sprPicture[c].BeginTweening( 0.3f, TWEEN_BOUNCE_BEGIN );
|
||||
m_sprPicture[c].SetTweenZoomY( 0 );
|
||||
|
||||
// fly off
|
||||
m_sprHeader[d].BeginTweening( 0.4f, TWEEN_BIAS_END );
|
||||
m_sprHeader[d].SetTweenXY( ITEM_X(d)-700, ITEM_Y(d) );
|
||||
m_sprHeader[c].BeginTweening( 0.4f, TWEEN_BIAS_END );
|
||||
m_sprHeader[c].SetTweenXY( CHOICE_X(c)-700, CHOICE_Y(c) );
|
||||
|
||||
m_sprPicture[d].BeginTweening( 0.4f, TWEEN_BIAS_END );
|
||||
m_sprPicture[d].SetTweenXY( ITEM_X(d)-700, ITEM_Y(d) );
|
||||
m_sprPicture[c].BeginTweening( 0.4f, TWEEN_BIAS_END );
|
||||
m_sprPicture[c].SetTweenXY( CHOICE_X(c)-700, CHOICE_Y(c) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -537,7 +487,7 @@ void ScreenSelectDifficulty::TweenOnScreen()
|
||||
if( !GAMESTATE->IsPlayerEnabled((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; d<NUM_DIFFICULTY_ITEMS; d++ )
|
||||
for( unsigned d=0; d<NUM_CHOICES; d++ )
|
||||
{
|
||||
const float fPauseTime = d*0.2f;
|
||||
|
||||
@@ -566,9 +516,9 @@ void ScreenSelectDifficulty::TweenOnScreen()
|
||||
continue; // don't tween
|
||||
|
||||
// set off screen
|
||||
m_sprHeader[d].SetXY( ITEM_X(d)-700, ITEM_Y(d) );
|
||||
m_sprHeader[d].SetXY( CHOICE_X(d)-700, CHOICE_Y(d) );
|
||||
|
||||
m_sprPicture[d].SetXY( ITEM_X(d)-700, ITEM_Y(d) );
|
||||
m_sprPicture[d].SetXY( CHOICE_X(d)-700, CHOICE_Y(d) );
|
||||
m_sprPicture[d].SetZoomY( 0 );
|
||||
|
||||
// pause
|
||||
@@ -578,10 +528,10 @@ void ScreenSelectDifficulty::TweenOnScreen()
|
||||
|
||||
// fly on
|
||||
m_sprHeader[d].BeginTweening( 0.5f, TWEEN_BIAS_BEGIN );
|
||||
m_sprHeader[d].SetTweenXY( ITEM_X(d), ITEM_Y(d) );
|
||||
m_sprHeader[d].SetTweenXY( CHOICE_X(d), CHOICE_Y(d) );
|
||||
|
||||
m_sprPicture[d].BeginTweening( 0.5f, TWEEN_BIAS_BEGIN );
|
||||
m_sprPicture[d].SetTweenXY( ITEM_X(d), ITEM_Y(d) );
|
||||
m_sprPicture[d].SetTweenXY( CHOICE_X(d), CHOICE_Y(d) );
|
||||
|
||||
// roll down
|
||||
m_sprHeader[d].BeginTweening( 0.3f, TWEEN_BOUNCE_END );
|
||||
|
||||
@@ -18,13 +18,23 @@
|
||||
#include "RandomSample.h"
|
||||
|
||||
|
||||
const unsigned NUM_ITEMS_ON_PAGE_1 = 3; // easy, medium, hard,
|
||||
const unsigned NUM_ITEMS_ON_PAGE_2 = 2; // Oni, Endless
|
||||
const unsigned NUM_DIFFICULTY_ITEMS = NUM_ITEMS_ON_PAGE_1 + NUM_ITEMS_ON_PAGE_2;
|
||||
const unsigned NUM_PAGES = 2; // easy-medium-hard, Oni
|
||||
|
||||
class ScreenSelectDifficulty : public Screen
|
||||
{
|
||||
enum Choice
|
||||
{
|
||||
CHOICE_EASY, // page 1
|
||||
CHOICE_MEDIUM,
|
||||
CHOICE_HARD,
|
||||
CHOICE_NONSTOP, // page 2
|
||||
CHOICE_ONI,
|
||||
CHOICE_ENDLESS,
|
||||
NUM_CHOICES
|
||||
};
|
||||
|
||||
#define NUM_CHOICES_ON_PAGE_1 3 // easy, medium, hard,
|
||||
#define NUM_CHOICES_ON_PAGE_2 3 // Nonstop, Oni, Endless
|
||||
#define NUM_PAGES 2
|
||||
|
||||
public:
|
||||
ScreenSelectDifficulty();
|
||||
virtual ~ScreenSelectDifficulty();
|
||||
@@ -52,8 +62,8 @@ private:
|
||||
|
||||
ActorFrame m_framePages; // 2 pages
|
||||
|
||||
Sprite m_sprHeader[NUM_DIFFICULTY_ITEMS];
|
||||
Sprite m_sprPicture[NUM_DIFFICULTY_ITEMS];
|
||||
Sprite m_sprHeader[NUM_CHOICES];
|
||||
Sprite m_sprPicture[NUM_CHOICES];
|
||||
Sprite m_sprExplanation[NUM_PAGES];
|
||||
Sprite m_sprMoreArrows[NUM_PAGES];
|
||||
|
||||
@@ -65,7 +75,7 @@ private:
|
||||
RageSound m_soundSelect;
|
||||
RandomSample m_soundDifficult;
|
||||
|
||||
int m_iSelection[NUM_PLAYERS];
|
||||
Choice m_Choice[NUM_PLAYERS];
|
||||
bool m_bChosen[NUM_PLAYERS];
|
||||
|
||||
float m_fLockInputTime;
|
||||
|
||||
@@ -233,10 +233,13 @@ void ScreenSelectMode::HandleScreenMessage( const ScreenMessage SM )
|
||||
case PLAY_MODE_ARCADE:
|
||||
SCREENMAN->SetNewScreen( NEXT_SCREEN );
|
||||
break;
|
||||
case PLAY_MODE_NONSTOP:
|
||||
case PLAY_MODE_ONI:
|
||||
case PLAY_MODE_ENDLESS:
|
||||
SCREENMAN->SetNewScreen( "ScreenSelectCourse" );
|
||||
break;
|
||||
default:
|
||||
ASSERT(0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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; i<NUM_CHOICES; i++ )
|
||||
{
|
||||
m_textChoice[i].LoadFromFont( THEME->GetPathTo("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; i<NUM_TITLE_MENU_CHOICES; i++ )
|
||||
for( int i=0; i<NUM_CHOICES; i++ )
|
||||
LoseFocus( i );
|
||||
GainFocus( m_TitleMenuChoice );
|
||||
GainFocus( m_Choice );
|
||||
|
||||
SOUNDMAN->PlayMusic( 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 );
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -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<saGroupNames.size(); g++ ) // foreach Group
|
||||
{
|
||||
CString sGroupName = saGroupNames[g];
|
||||
CStringArray saCoursePaths;
|
||||
GetDirListing( "Songs\\" + sGroupName + "\\*.crs", saCoursePaths, false, true );
|
||||
for( unsigned i=0; i<saCoursePaths.size(); i++ )
|
||||
{
|
||||
Course course;
|
||||
course.LoadFromCRSFile( saCoursePaths[i], m_pSongs );
|
||||
if( course.GetNumStages() > 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<Course*> AddTo )
|
||||
{
|
||||
PlayerOptions po;
|
||||
for( unsigned i=0; i<m_Courses.size(); i++ )
|
||||
{
|
||||
if( m_Courses[i].m_bRepeat )
|
||||
continue; // skip
|
||||
if( m_Courses[i].m_iLives > 0 ) // use battery life meter
|
||||
continue;
|
||||
|
||||
AddTo.push_back( &m_Courses[i] );
|
||||
}
|
||||
}
|
||||
|
||||
void SongManager::GetOniCourses( vector<Course*> AddTo )
|
||||
{
|
||||
PlayerOptions po;
|
||||
for( unsigned i=0; i<m_Courses.size(); i++ )
|
||||
{
|
||||
if( m_Courses[i].m_bRepeat )
|
||||
continue; // skip
|
||||
if( m_Courses[i].m_iLives <= 0 ) // use bar life meter
|
||||
continue;
|
||||
|
||||
AddTo.push_back( &m_Courses[i] );
|
||||
}
|
||||
}
|
||||
|
||||
void SongManager::GetEndlessCourses( vector<Course*> AddTo )
|
||||
{
|
||||
for( unsigned i=0; i<m_Courses.size(); i++ )
|
||||
{
|
||||
if( m_Courses[i].m_bRepeat )
|
||||
AddTo.push_back( &m_Courses[i] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool SongManager::GetExtraStageInfoFromCourse( bool bExtra2, CString sPreferredGroup,
|
||||
Song*& pSongOut, Notes*& pNotesOut, PlayerOptions& po_out, SongOptions& so_out )
|
||||
{
|
||||
@@ -540,8 +594,8 @@ bool SongManager::GetExtraStageInfoFromCourse( bool bExtra2, CString sPreferredG
|
||||
pNotesOut = course.GetNotesForStage( 0 );
|
||||
if( pNotesOut == NULL ) return false;
|
||||
|
||||
po_out.FromString( course.GetModifiers(0) );
|
||||
so_out.FromString( course.GetModifiers(0) );
|
||||
course.GetPlayerOptions( 0, &po_out );
|
||||
course.GetSongOptions( &so_out );
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -642,3 +696,12 @@ Song* SongManager::GetSongFromDir( CString sDir )
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Course* SongManager::GetCourseFromPath( CString sPath )
|
||||
{
|
||||
for( unsigned int i=0; i<m_Courses.size(); i++ )
|
||||
if( sPath.CompareNoCase(m_Courses[i].m_sPath) == 0 )
|
||||
return &m_Courses[i];
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -46,25 +46,27 @@ public:
|
||||
void GetSongsInGroup( const CString sGroupName, vector<Song*> &AddTo );
|
||||
|
||||
|
||||
// for Oni
|
||||
vector<Course> m_aOniCourses;
|
||||
|
||||
// for Extra Stages
|
||||
vector<Course> m_aExtraCourses;
|
||||
|
||||
// for Endless
|
||||
vector<Course> m_aEndlessCourses;
|
||||
//
|
||||
// Courses for Nonstop, Oni, and Endless
|
||||
//
|
||||
vector<Course> m_Courses;
|
||||
|
||||
void InitCoursesFromDisk();
|
||||
void ReloadCourses();
|
||||
void CleanCourses();
|
||||
|
||||
void GetNonstopCourses( vector<Course*> AddTo ); // add to if life meter type is BAR.
|
||||
void GetOniCourses( vector<Course*> AddTo ); // add to if life meter type is BATTERY.
|
||||
void GetEndlessCourses( vector<Course*> 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 );
|
||||
|
||||
@@ -231,12 +231,6 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||
<File
|
||||
RelativePath="ScreenEz2SelectPlayer.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="ScreenEz2Stage.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="ScreenEz2Stage.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="ScreenGameOver.cpp">
|
||||
</File>
|
||||
@@ -312,6 +306,12 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||
<File
|
||||
RelativePath="ScreenMusicScroll.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="ScreenNameEntry.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="ScreenNameEntry.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="ScreenOptions.cpp">
|
||||
</File>
|
||||
|
||||
Reference in New Issue
Block a user