2002-06-14 22:25:22 +00:00
|
|
|
#include "stdafx.h"
|
|
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
Class: ScreenSelectCourse
|
|
|
|
|
|
|
|
|
|
Desc: See header.
|
|
|
|
|
|
|
|
|
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
|
|
|
|
Chris Danford
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "ScreenSelectCourse.h"
|
|
|
|
|
#include "ScreenManager.h"
|
|
|
|
|
#include "PrefsManager.h"
|
|
|
|
|
#include "SongManager.h"
|
|
|
|
|
#include "GameManager.h"
|
|
|
|
|
#include "RageMusic.h"
|
|
|
|
|
#include "ScreenTitleMenu.h"
|
|
|
|
|
#include "GameConstantsAndTypes.h"
|
2002-07-23 01:41:40 +00:00
|
|
|
#include "PrefsManager.h"
|
2002-06-14 22:25:22 +00:00
|
|
|
#include "ScreenGameplay.h"
|
|
|
|
|
#include "ScreenPrompt.h"
|
|
|
|
|
#include "ScreenPlayerOptions.h"
|
|
|
|
|
#include "RageLog.h"
|
|
|
|
|
#include "InputMapper.h"
|
|
|
|
|
#include "InputQueue.h"
|
|
|
|
|
#include "ScreenStage.h"
|
|
|
|
|
#include "AnnouncerManager.h"
|
2002-07-23 01:41:40 +00:00
|
|
|
#include "GameState.h"
|
2002-06-14 22:25:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
const float COURSE_INFO_FRAME_X = 160;
|
|
|
|
|
const float COURSE_INFO_FRAME_Y = SCREEN_TOP+118;
|
|
|
|
|
|
|
|
|
|
const float COURSE_CONTENTS_FRAME_X = 160;
|
2002-07-23 01:41:40 +00:00
|
|
|
const float COURSE_CONTENTS_FRAME_Y = CENTER_Y+70;
|
2002-06-14 22:25:22 +00:00
|
|
|
|
|
|
|
|
const float WHEEL_X = CENTER_X+160;
|
|
|
|
|
const float WHEEL_Y = CENTER_Y+8;
|
|
|
|
|
|
|
|
|
|
const float TWEEN_TIME = 0.5f;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const ScreenMessage SM_GoToPrevState = ScreenMessage(SM_User+1);
|
|
|
|
|
const ScreenMessage SM_GoToNextState = ScreenMessage(SM_User+2);
|
|
|
|
|
const ScreenMessage SM_ConfirmChange = ScreenMessage(SM_User+3);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ScreenSelectCourse::ScreenSelectCourse()
|
|
|
|
|
{
|
|
|
|
|
LOG->WriteLine( "ScreenSelectCourse::ScreenSelectCourse()" );
|
|
|
|
|
|
|
|
|
|
// for debugging
|
2002-07-23 01:41:40 +00:00
|
|
|
if( GAMESTATE->m_CurStyle == STYLE_NONE )
|
|
|
|
|
GAMESTATE->m_CurStyle = STYLE_DANCE_SINGLE;
|
2002-06-14 22:25:22 +00:00
|
|
|
|
|
|
|
|
m_Menu.Load(
|
|
|
|
|
THEME->GetPathTo(GRAPHIC_SELECT_COURSE_BACKGROUND),
|
|
|
|
|
THEME->GetPathTo(GRAPHIC_SELECT_COURSE_TOP_EDGE),
|
|
|
|
|
ssprintf("%c or %c change course then press START",
|
2002-07-11 19:02:26 +00:00
|
|
|
char(1), char(2), char(3), char(3), char(4), char(4), char(3), char(4), char(3), char(4) ),
|
|
|
|
|
false, true, 60
|
|
|
|
|
);
|
2002-07-23 01:41:40 +00:00
|
|
|
this->AddSubActor( &m_Menu );
|
2002-06-14 22:25:22 +00:00
|
|
|
|
|
|
|
|
m_CourseInfoFrame.SetXY( COURSE_INFO_FRAME_X, COURSE_INFO_FRAME_Y );
|
2002-07-23 01:41:40 +00:00
|
|
|
this->AddSubActor( &m_CourseInfoFrame );
|
2002-06-14 22:25:22 +00:00
|
|
|
|
|
|
|
|
m_CourseContentsFrame.SetXY( COURSE_CONTENTS_FRAME_X, COURSE_CONTENTS_FRAME_Y );
|
2002-07-23 01:41:40 +00:00
|
|
|
this->AddSubActor( &m_CourseContentsFrame );
|
2002-06-14 22:25:22 +00:00
|
|
|
|
|
|
|
|
m_MusicWheel.SetXY( WHEEL_X, WHEEL_Y );
|
2002-07-23 01:41:40 +00:00
|
|
|
this->AddSubActor( &m_MusicWheel );
|
2002-06-14 22:25:22 +00:00
|
|
|
|
|
|
|
|
m_textHoldForOptions.Load( THEME->GetPathTo(FONT_STAGE) );
|
|
|
|
|
m_textHoldForOptions.SetXY( CENTER_X, CENTER_Y );
|
|
|
|
|
m_textHoldForOptions.SetText( "hold START for options" );
|
|
|
|
|
m_textHoldForOptions.SetZoom( 1 );
|
|
|
|
|
m_textHoldForOptions.SetZoomY( 0 );
|
|
|
|
|
m_textHoldForOptions.SetDiffuseColor( D3DXCOLOR(1,1,1,0) );
|
|
|
|
|
m_textHoldForOptions.SetZ( -2 );
|
2002-07-23 01:41:40 +00:00
|
|
|
this->AddSubActor( &m_textHoldForOptions );
|
2002-06-14 22:25:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
m_soundSelect.Load( THEME->GetPathTo(SOUND_MENU_START) );
|
|
|
|
|
m_soundChangeNotes.Load( THEME->GetPathTo(SOUND_SELECT_MUSIC_CHANGE_NOTES) );
|
|
|
|
|
|
|
|
|
|
SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_SELECT_COURSE_INTRO) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AfterCourseChange();
|
|
|
|
|
TweenOnScreen();
|
|
|
|
|
m_Menu.TweenOnScreenFromMenu( SM_None );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ScreenSelectCourse::~ScreenSelectCourse()
|
|
|
|
|
{
|
|
|
|
|
LOG->WriteLine( "ScreenSelectCourse::~ScreenSelectCourse()" );
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenSelectCourse::DrawPrimitives()
|
|
|
|
|
{
|
|
|
|
|
m_Menu.DrawBottomLayer();
|
|
|
|
|
Screen::DrawPrimitives();
|
|
|
|
|
m_Menu.DrawTopLayer();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenSelectCourse::TweenOnScreen()
|
|
|
|
|
{
|
|
|
|
|
m_CourseInfoFrame.SetXY( COURSE_INFO_FRAME_X - 400, COURSE_INFO_FRAME_Y );
|
|
|
|
|
m_CourseInfoFrame.BeginTweening( TWEEN_TIME, Actor::TWEEN_BIAS_END );
|
|
|
|
|
m_CourseInfoFrame.SetTweenXY( COURSE_INFO_FRAME_X, COURSE_INFO_FRAME_Y );
|
|
|
|
|
|
|
|
|
|
m_MusicWheel.TweenOnScreen();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenSelectCourse::TweenOffScreen()
|
|
|
|
|
{
|
|
|
|
|
m_CourseInfoFrame.BeginTweening( TWEEN_TIME, Actor::TWEEN_BOUNCE_END );
|
|
|
|
|
m_CourseInfoFrame.SetTweenXY( COURSE_INFO_FRAME_X - 400, COURSE_INFO_FRAME_Y );
|
|
|
|
|
|
|
|
|
|
m_MusicWheel.TweenOffScreen();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ScreenSelectCourse::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
|
|
|
|
|
{
|
|
|
|
|
LOG->WriteLine( "ScreenSelectCourse::Input()" );
|
|
|
|
|
|
|
|
|
|
if( m_Menu.IsClosing() )
|
|
|
|
|
return; // ignore
|
|
|
|
|
|
2002-06-24 22:04:31 +00:00
|
|
|
if( MenuI.player == PLAYER_INVALID )
|
2002-06-14 22:25:22 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
Screen::Input( DeviceI, type, GameI, MenuI, StyleI ); // default input handler
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ScreenSelectCourse::HandleScreenMessage( const ScreenMessage SM )
|
|
|
|
|
{
|
|
|
|
|
Screen::HandleScreenMessage( SM );
|
|
|
|
|
|
|
|
|
|
switch( SM )
|
|
|
|
|
{
|
|
|
|
|
case SM_MenuTimer:
|
|
|
|
|
MenuStart(PLAYER_1);
|
|
|
|
|
break;
|
|
|
|
|
case SM_GoToPrevState:
|
|
|
|
|
SCREENMAN->SetNewScreen( new ScreenTitleMenu );
|
|
|
|
|
break;
|
|
|
|
|
case SM_GoToNextState:
|
|
|
|
|
|
|
|
|
|
// find out if the Next button is being held down on any of the pads
|
|
|
|
|
bool bIsHoldingNext;
|
|
|
|
|
bIsHoldingNext = false;
|
|
|
|
|
int player;
|
|
|
|
|
for( player=0; player<NUM_PLAYERS; player++ )
|
|
|
|
|
{
|
|
|
|
|
MenuInput mi( (PlayerNumber)player, MENU_BUTTON_START );
|
|
|
|
|
if( INPUTMAPPER->IsButtonDown( mi ) )
|
|
|
|
|
bIsHoldingNext = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( bIsHoldingNext )
|
|
|
|
|
{
|
|
|
|
|
SCREENMAN->SetNewScreen( new ScreenPlayerOptions );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
MUSIC->Stop();
|
|
|
|
|
|
2002-06-24 22:04:31 +00:00
|
|
|
SCREENMAN->SetNewScreen( new ScreenStage );
|
2002-06-14 22:25:22 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenSelectCourse::MenuLeft( const PlayerNumber p, const InputEventType type )
|
|
|
|
|
{
|
|
|
|
|
m_MusicWheel.PrevMusic();
|
|
|
|
|
|
|
|
|
|
AfterCourseChange();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ScreenSelectCourse::MenuRight( const PlayerNumber p, const InputEventType type )
|
|
|
|
|
{
|
|
|
|
|
m_MusicWheel.NextMusic();
|
|
|
|
|
|
|
|
|
|
AfterCourseChange();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenSelectCourse::MenuStart( const PlayerNumber p )
|
|
|
|
|
{
|
|
|
|
|
// this needs to check whether valid Notes are selected!
|
2002-06-23 11:43:53 +00:00
|
|
|
m_MusicWheel.Select();
|
2002-06-14 22:25:22 +00:00
|
|
|
|
2002-06-23 11:43:53 +00:00
|
|
|
switch( m_MusicWheel.GetSelectedType() )
|
2002-06-14 22:25:22 +00:00
|
|
|
{
|
2002-06-23 11:43:53 +00:00
|
|
|
case TYPE_COURSE:
|
|
|
|
|
SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_SELECT_MUSIC_COMMENT_GENERAL) );
|
|
|
|
|
|
|
|
|
|
TweenOffScreen();
|
2002-06-14 22:25:22 +00:00
|
|
|
|
2002-06-23 11:43:53 +00:00
|
|
|
m_soundSelect.PlayRandom();
|
2002-06-14 22:25:22 +00:00
|
|
|
|
2002-06-23 11:43:53 +00:00
|
|
|
// show "hold START for options"
|
|
|
|
|
m_textHoldForOptions.SetDiffuseColor( D3DXCOLOR(1,1,1,0) );
|
|
|
|
|
m_textHoldForOptions.BeginTweeningQueued( 0.25f ); // fade in
|
|
|
|
|
m_textHoldForOptions.SetTweenZoomY( 1 );
|
|
|
|
|
m_textHoldForOptions.SetTweenDiffuseColor( D3DXCOLOR(1,1,1,1) );
|
|
|
|
|
m_textHoldForOptions.BeginTweeningQueued( 2.0f ); // sleep
|
|
|
|
|
m_textHoldForOptions.BeginTweeningQueued( 0.25f ); // fade out
|
|
|
|
|
m_textHoldForOptions.SetTweenDiffuseColor( D3DXCOLOR(1,1,1,0) );
|
|
|
|
|
m_textHoldForOptions.SetTweenZoomY( 0 );
|
2002-06-23 02:50:33 +00:00
|
|
|
|
2002-06-23 11:43:53 +00:00
|
|
|
m_Menu.TweenOffScreenToBlack( SM_None, false );
|
2002-06-23 02:50:33 +00:00
|
|
|
|
2002-07-23 01:41:40 +00:00
|
|
|
GAMESTATE->m_pCurCourse = m_MusicWheel.GetSelectedCourse();
|
2002-07-04 21:05:18 +00:00
|
|
|
|
2002-06-23 11:43:53 +00:00
|
|
|
this->SendScreenMessage( SM_GoToNextState, 2.5f );
|
|
|
|
|
|
|
|
|
|
break;
|
2002-06-14 22:25:22 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ScreenSelectCourse::MenuBack( const PlayerNumber p )
|
|
|
|
|
{
|
|
|
|
|
MUSIC->Stop();
|
|
|
|
|
|
|
|
|
|
m_Menu.TweenOffScreenToBlack( SM_GoToPrevState, true );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ScreenSelectCourse::AfterCourseChange()
|
|
|
|
|
{
|
|
|
|
|
switch( m_MusicWheel.GetSelectedType() )
|
|
|
|
|
{
|
|
|
|
|
case TYPE_COURSE:
|
|
|
|
|
{
|
|
|
|
|
Course* pCourse = m_MusicWheel.GetSelectedCourse();
|
|
|
|
|
m_CourseInfoFrame.SetFromCourse( pCourse );
|
|
|
|
|
m_CourseContentsFrame.SetFromCourse( pCourse );
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ASSERT(0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|