2003-02-16 04:01:45 +00:00
|
|
|
#include "global.h"
|
2002-05-20 08:59:37 +00:00
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
2002-05-28 20:01:22 +00:00
|
|
|
Class: ScreenTitleMenu
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2002-05-28 20:01:22 +00:00
|
|
|
Desc: See header.
|
2002-05-20 08:59:37 +00:00
|
|
|
|
|
|
|
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
2002-05-28 20:01:22 +00:00
|
|
|
Chris Danford
|
2002-05-20 08:59:37 +00:00
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "ScreenTitleMenu.h"
|
2003-04-13 04:50:08 +00:00
|
|
|
#include "ScreenAttract.h"
|
2002-05-20 08:59:37 +00:00
|
|
|
#include "ScreenManager.h"
|
|
|
|
|
#include "GameConstantsAndTypes.h"
|
|
|
|
|
#include "RageUtil.h"
|
|
|
|
|
#include "StepMania.h"
|
2002-07-23 01:41:40 +00:00
|
|
|
#include "PrefsManager.h"
|
2002-05-20 08:59:37 +00:00
|
|
|
#include "RageLog.h"
|
|
|
|
|
#include "SongManager.h"
|
|
|
|
|
#include "AnnouncerManager.h"
|
2002-07-23 01:41:40 +00:00
|
|
|
#include "GameState.h"
|
2002-05-28 20:01:22 +00:00
|
|
|
#include "GameManager.h"
|
2002-08-27 03:59:22 +00:00
|
|
|
#include "InputMapper.h"
|
2002-11-11 04:53:31 +00:00
|
|
|
#include "ThemeManager.h"
|
2003-02-14 06:54:39 +00:00
|
|
|
#include "SDL_utils.h"
|
2003-07-26 23:05:16 +00:00
|
|
|
#include "RageSounds.h"
|
2003-04-13 04:50:08 +00:00
|
|
|
#include "CodeDetector.h"
|
2003-04-18 23:55:20 +00:00
|
|
|
#include "RageTextureManager.h"
|
2003-07-25 00:03:05 +00:00
|
|
|
#include "UnlockSystem.h"
|
2003-08-10 03:19:16 +00:00
|
|
|
#include "ProductInfo.h"
|
2003-01-02 07:54:28 +00:00
|
|
|
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-04-13 04:50:08 +00:00
|
|
|
#define LOGO_ON_COMMAND THEME->GetMetric("ScreenTitleMenu","LogoOnCommand")
|
|
|
|
|
#define LOGO_HOME_ON_COMMAND THEME->GetMetric("ScreenTitleMenu","LogoHomeOnCommand")
|
|
|
|
|
#define VERSION_ON_COMMAND THEME->GetMetric("ScreenTitleMenu","VersionOnCommand")
|
|
|
|
|
#define SONGS_ON_COMMAND THEME->GetMetric("ScreenTitleMenu","SongsOnCommand")
|
2003-03-09 00:55:49 +00:00
|
|
|
#define HELP_X THEME->GetMetricF("ScreenTitleMenu","HelpX")
|
|
|
|
|
#define HELP_Y THEME->GetMetricF("ScreenTitleMenu","HelpY")
|
|
|
|
|
#define CHOICES_X THEME->GetMetricF("ScreenTitleMenu","ChoicesX")
|
|
|
|
|
#define CHOICES_START_Y THEME->GetMetricF("ScreenTitleMenu","ChoicesStartY")
|
|
|
|
|
#define CHOICES_SPACING_Y THEME->GetMetricF("ScreenTitleMenu","ChoicesSpacingY")
|
|
|
|
|
#define CHOICES_SHADOW_LENGTH THEME->GetMetricF("ScreenTitleMenu","ChoicesShadowLength")
|
|
|
|
|
#define COLOR_NOT_SELECTED THEME->GetMetricC("ScreenTitleMenu","ColorNotSelected")
|
|
|
|
|
#define COLOR_SELECTED THEME->GetMetricC("ScreenTitleMenu","ColorSelected")
|
|
|
|
|
#define ZOOM_NOT_SELECTED THEME->GetMetricF("ScreenTitleMenu","ZoomNotSelected")
|
|
|
|
|
#define ZOOM_SELECTED THEME->GetMetricF("ScreenTitleMenu","ZoomSelected")
|
2003-05-12 08:01:13 +00:00
|
|
|
#define MENU_TEXT_ALIGN THEME->GetMetricI("ScreenTitleMenu","MenuTextAlign")
|
2003-03-09 00:55:49 +00:00
|
|
|
#define SECONDS_BETWEEN_COMMENTS THEME->GetMetricF("ScreenTitleMenu","SecondsBetweenComments")
|
|
|
|
|
#define SECONDS_BEFORE_ATTRACT THEME->GetMetricF("ScreenTitleMenu","SecondsBeforeAttract")
|
2003-04-13 04:50:08 +00:00
|
|
|
#define HELP_TEXT( coin_mode ) THEME->GetMetric("ScreenTitleMenu","HelpText"+Capitalize(CoinModeToString(coin_mode)))
|
2003-03-09 00:55:49 +00:00
|
|
|
#define NEXT_SCREEN THEME->GetMetric("ScreenTitleMenu","NextScreen")
|
2003-09-02 00:45:02 +00:00
|
|
|
#define MENU_ITEM_CREATE THEME->GetMetric("ScreenTitleMenu","MenuCommandOnCreate")
|
2003-09-04 11:06:07 +00:00
|
|
|
#define MENU_ITEM_SELECT_DELAY THEME->GetMetricF("ScreenTitleMenu","MenuCommandSelectDelay")
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-01-11 08:55:21 +00:00
|
|
|
const ScreenMessage SM_PlayComment = ScreenMessage(SM_User+1);
|
2003-01-10 02:22:07 +00:00
|
|
|
const ScreenMessage SM_GoToAttractLoop = ScreenMessage(SM_User+13);
|
2002-08-02 09:31:06 +00:00
|
|
|
|
2003-04-13 04:50:08 +00:00
|
|
|
ScreenTitleMenu::ScreenTitleMenu() : Screen("ScreenTitleMenu")
|
2002-05-20 08:59:37 +00:00
|
|
|
{
|
2002-07-31 19:40:40 +00:00
|
|
|
LOG->Trace( "ScreenTitleMenu::ScreenTitleMenu()" );
|
2003-02-12 11:43:08 +00:00
|
|
|
|
2003-04-13 06:29:02 +00:00
|
|
|
GAMESTATE->Reset();
|
2003-03-09 03:28:34 +00:00
|
|
|
GAMESTATE->m_bPlayersCanJoin = true;
|
|
|
|
|
|
2003-04-13 04:50:08 +00:00
|
|
|
CodeDetector::RefreshCacheItems();
|
|
|
|
|
|
|
|
|
|
if( PREFSMAN->m_iCoinMode!=COIN_HOME && PREFSMAN->m_bJointPremium )
|
2003-03-09 00:55:49 +00:00
|
|
|
{
|
2003-04-12 17:39:27 +00:00
|
|
|
m_JointPremium.LoadFromAniDir( THEME->GetPathToB("ScreenTitleMenu joint premium") );
|
2003-03-09 00:55:49 +00:00
|
|
|
this->AddChild( &m_JointPremium );
|
2003-02-12 06:25:51 +00:00
|
|
|
}
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-04-13 04:50:08 +00:00
|
|
|
|
|
|
|
|
m_Background.LoadFromAniDir( THEME->GetPathToB("ScreenTitleMenu background") );
|
|
|
|
|
this->AddChild( &m_Background );
|
|
|
|
|
|
|
|
|
|
m_sprLogo.Load( THEME->GetPathToG(ssprintf("ScreenLogo %s",GAMESTATE->GetCurrentGameDef()->m_szName)) );
|
|
|
|
|
m_sprLogo.Command( PREFSMAN->m_iCoinMode==COIN_HOME ? LOGO_HOME_ON_COMMAND : LOGO_ON_COMMAND );
|
|
|
|
|
this->AddChild( &m_sprLogo );
|
|
|
|
|
|
|
|
|
|
m_textVersion.LoadFromFont( THEME->GetPathToF("Common normal") );
|
|
|
|
|
m_textVersion.Command( VERSION_ON_COMMAND );
|
2003-08-10 03:19:16 +00:00
|
|
|
m_textVersion.SetText( PRODUCT_VER );
|
2003-04-13 04:50:08 +00:00
|
|
|
this->AddChild( &m_textVersion );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_textSongs.LoadFromFont( THEME->GetPathToF("Common normal") );
|
|
|
|
|
m_textSongs.Command( SONGS_ON_COMMAND );
|
2003-07-31 22:50:27 +00:00
|
|
|
CString text = ssprintf("%d songs in %d groups, %d courses", SONGMAN->GetNumSongs(), SONGMAN->GetNumGroups(), SONGMAN->GetNumCourses() );
|
|
|
|
|
if( PREFSMAN->m_bUseUnlockSystem )
|
|
|
|
|
text += ssprintf(", %d unlocks", GAMESTATE->m_pUnlockingSys->GetNumUnlocks() );
|
|
|
|
|
m_textSongs.SetText( text );
|
2003-04-13 04:50:08 +00:00
|
|
|
this->AddChild( &m_textSongs );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CString sCoinMode = CoinModeToString((CoinMode)PREFSMAN->m_iCoinMode);
|
|
|
|
|
m_CoinMode.LoadFromAniDir( THEME->GetPathToB("ScreenTitleMenu "+sCoinMode) );
|
|
|
|
|
this->AddChild( &m_CoinMode );
|
2003-03-09 00:55:49 +00:00
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_textHelp.LoadFromFont( THEME->GetPathToF("ScreenTitleMenu help") );
|
2003-04-13 04:50:08 +00:00
|
|
|
m_textHelp.SetText( HELP_TEXT((CoinMode)PREFSMAN->m_iCoinMode) );
|
2002-08-13 23:26:46 +00:00
|
|
|
m_textHelp.SetXY( HELP_X, HELP_Y );
|
2002-05-20 08:59:37 +00:00
|
|
|
m_textHelp.SetZoom( 0.5f );
|
2003-03-02 01:43:33 +00:00
|
|
|
m_textHelp.SetEffectDiffuseBlink();
|
|
|
|
|
m_textHelp.EnableShadow( true );
|
2002-05-20 08:59:37 +00:00
|
|
|
m_textHelp.SetShadowLength( 2 );
|
2002-09-02 21:59:58 +00:00
|
|
|
this->AddChild( &m_textHelp );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-04-13 04:50:08 +00:00
|
|
|
switch( PREFSMAN->m_iCoinMode )
|
2002-05-20 08:59:37 +00:00
|
|
|
{
|
2003-04-13 04:50:08 +00:00
|
|
|
case COIN_HOME:
|
2003-01-19 04:44:22 +00:00
|
|
|
int i;
|
2003-01-21 05:14:59 +00:00
|
|
|
for( i=0; i<NUM_CHOICES; i++ )
|
2003-01-19 04:44:22 +00:00
|
|
|
{
|
2003-04-12 17:39:27 +00:00
|
|
|
m_textChoice[i].LoadFromFont( THEME->GetPathToF("ScreenTitleMenu choices") );
|
2003-05-12 08:01:13 +00:00
|
|
|
m_textChoice[i].SetHorizAlign( (enum Actor::HorizAlign)MENU_TEXT_ALIGN );
|
2003-01-31 21:34:34 +00:00
|
|
|
m_textChoice[i].SetText( ChoiceToString((Choice)i) );
|
2003-01-19 04:44:22 +00:00
|
|
|
m_textChoice[i].SetXY( CHOICES_X, CHOICES_START_Y + i*CHOICES_SPACING_Y );
|
|
|
|
|
m_textChoice[i].SetShadowLength( CHOICES_SHADOW_LENGTH );
|
2003-03-02 01:43:33 +00:00
|
|
|
m_textChoice[i].EnableShadow( true );
|
2003-01-19 04:44:22 +00:00
|
|
|
this->AddChild( &m_textChoice[i] );
|
|
|
|
|
}
|
|
|
|
|
break;
|
2003-04-13 04:50:08 +00:00
|
|
|
case COIN_PAY:
|
|
|
|
|
case COIN_FREE:
|
2003-01-19 04:44:22 +00:00
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ASSERT(0);
|
|
|
|
|
}
|
|
|
|
|
|
2002-10-08 08:53:38 +00:00
|
|
|
|
2003-04-13 04:50:08 +00:00
|
|
|
m_In.Load( THEME->GetPathToB("ScreenTitleMenu in") );
|
|
|
|
|
m_In.StartTransitioning();
|
|
|
|
|
this->AddChild( &m_In );
|
|
|
|
|
|
|
|
|
|
m_Out.Load( THEME->GetPathToB("ScreenTitleMenu out") );
|
|
|
|
|
this->AddChild( &m_Out );
|
|
|
|
|
|
2003-07-07 01:29:18 +00:00
|
|
|
m_BeginOut.Load( THEME->GetPathToB("ScreenTitleMenu begin out") );
|
|
|
|
|
this->AddChild( &m_BeginOut );
|
|
|
|
|
|
2003-04-13 04:50:08 +00:00
|
|
|
|
2003-07-26 23:05:16 +00:00
|
|
|
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("title menu game name") );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2002-07-23 01:41:40 +00:00
|
|
|
|
2002-08-27 23:31:41 +00:00
|
|
|
m_soundAttract.Load( ANNOUNCER->GetPathTo("title menu attract") );
|
2003-04-12 17:39:27 +00:00
|
|
|
m_soundChange.Load( THEME->GetPathToS("ScreenTitleMenu change") );
|
|
|
|
|
m_soundSelect.Load( THEME->GetPathToS("Common start") );
|
|
|
|
|
m_soundInvalid.Load( THEME->GetPathToS("Common invalid") );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-01-21 05:14:59 +00:00
|
|
|
m_Choice = CHOICE_GAME_START;
|
2002-09-03 22:31:06 +00:00
|
|
|
|
2003-01-21 05:14:59 +00:00
|
|
|
for( int i=0; i<NUM_CHOICES; i++ )
|
2003-09-04 11:06:07 +00:00
|
|
|
if (i != m_Choice)
|
|
|
|
|
m_textChoice[i].Command( MENU_ITEM_CREATE );
|
|
|
|
|
else
|
|
|
|
|
GainFocus( m_Choice );
|
2003-01-11 08:55:21 +00:00
|
|
|
|
2003-07-26 23:05:16 +00:00
|
|
|
SOUND->PlayMusic( THEME->GetPathToS("ScreenTitleMenu music") );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-03-25 21:17:29 +00:00
|
|
|
this->PostScreenMessage( SM_PlayComment, SECONDS_BETWEEN_COMMENTS);
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-03-09 00:55:49 +00:00
|
|
|
this->MoveToTail( &m_In ); // put it in the back so it covers up the stuff we just added
|
|
|
|
|
this->MoveToTail( &m_Out ); // put it in the back so it covers up the stuff we just added
|
2003-07-07 01:29:18 +00:00
|
|
|
this->MoveToTail( &m_BeginOut ); // put it in the back so it covers up the stuff we just added
|
2003-01-11 08:55:21 +00:00
|
|
|
}
|
2002-05-20 08:59:37 +00:00
|
|
|
|
|
|
|
|
ScreenTitleMenu::~ScreenTitleMenu()
|
|
|
|
|
{
|
2002-07-31 19:40:40 +00:00
|
|
|
LOG->Trace( "ScreenTitleMenu::~ScreenTitleMenu()" );
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ScreenTitleMenu::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
|
|
|
|
|
{
|
2003-01-09 07:46:45 +00:00
|
|
|
LOG->Trace( "ScreenTitleMenu::Input( %d-%d )", DeviceI.device, DeviceI.button ); // debugging gameport joystick problem
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-01-19 04:44:22 +00:00
|
|
|
if( type != IET_FIRST_PRESS )
|
|
|
|
|
return;
|
2003-03-09 00:55:49 +00:00
|
|
|
|
|
|
|
|
/* If the CoinMode was changed, we need to reload this screen
|
|
|
|
|
* so that the right choices will show */
|
|
|
|
|
if( ScreenAttract::ChangeCoinModeInput( DeviceI, type, GameI, MenuI, StyleI ) )
|
2003-01-19 04:44:22 +00:00
|
|
|
{
|
2003-03-09 00:55:49 +00:00
|
|
|
SCREENMAN->SetNewScreen( "ScreenTitleMenu" );
|
2003-01-19 04:44:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( !MenuI.IsValid() )
|
2002-05-20 08:59:37 +00:00
|
|
|
return;
|
2003-01-07 01:23:41 +00:00
|
|
|
|
2003-03-09 03:28:34 +00:00
|
|
|
switch( MenuI.button )
|
2003-01-19 04:44:22 +00:00
|
|
|
{
|
2003-03-09 03:28:34 +00:00
|
|
|
case MENU_BUTTON_UP:
|
2003-04-13 04:50:08 +00:00
|
|
|
if( PREFSMAN->m_iCoinMode != COIN_HOME )
|
2003-01-19 04:44:22 +00:00
|
|
|
break;
|
2003-07-07 01:29:18 +00:00
|
|
|
if( m_In.IsTransitioning() || m_Out.IsTransitioning() || m_BeginOut.IsTransitioning() )
|
2003-01-19 04:44:22 +00:00
|
|
|
break;
|
2003-03-09 03:28:34 +00:00
|
|
|
TimeToDemonstration.GetDeltaTime(); /* Reset the demonstration timer when a key is pressed. */
|
|
|
|
|
LoseFocus( m_Choice );
|
|
|
|
|
if( m_Choice == 0 ) // wrap around
|
|
|
|
|
m_Choice = (Choice)((int)NUM_CHOICES);
|
|
|
|
|
m_Choice = Choice( m_Choice-1 );
|
|
|
|
|
m_soundChange.Play();
|
|
|
|
|
GainFocus( m_Choice );
|
|
|
|
|
break;
|
|
|
|
|
case MENU_BUTTON_DOWN:
|
2003-04-13 04:50:08 +00:00
|
|
|
if( PREFSMAN->m_iCoinMode != COIN_HOME )
|
2003-01-21 03:18:16 +00:00
|
|
|
break;
|
2003-07-07 01:29:18 +00:00
|
|
|
if( m_In.IsTransitioning() || m_Out.IsTransitioning() || m_BeginOut.IsTransitioning() )
|
2003-03-09 03:28:34 +00:00
|
|
|
break;
|
|
|
|
|
TimeToDemonstration.GetDeltaTime(); /* Reset the demonstration timer when a key is pressed. */
|
|
|
|
|
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.Play();
|
|
|
|
|
GainFocus( m_Choice );
|
2003-03-09 00:55:49 +00:00
|
|
|
break;
|
2003-03-09 03:28:34 +00:00
|
|
|
case MENU_BUTTON_BACK:
|
2003-07-07 01:29:18 +00:00
|
|
|
if( m_In.IsTransitioning() || m_Out.IsTransitioning() || m_BeginOut.IsTransitioning() )
|
2003-03-09 00:55:49 +00:00
|
|
|
break;
|
2003-03-09 03:28:34 +00:00
|
|
|
m_Out.StartTransitioning( SM_GoToAttractLoop );
|
|
|
|
|
break;
|
|
|
|
|
case MENU_BUTTON_START:
|
|
|
|
|
if( m_In.IsTransitioning() )
|
|
|
|
|
break;
|
|
|
|
|
/* break if the choice is invalid */
|
2003-03-11 08:52:45 +00:00
|
|
|
if( m_Choice == CHOICE_JUKEBOX ||
|
|
|
|
|
m_Choice == CHOICE_EDIT )
|
2003-03-09 03:28:34 +00:00
|
|
|
{
|
|
|
|
|
if( SONGMAN->GetNumSongs() == 0 )
|
|
|
|
|
{
|
|
|
|
|
m_soundInvalid.Play();
|
|
|
|
|
SCREENMAN->SystemMessage( "No songs are installed" );
|
2003-03-11 08:52:45 +00:00
|
|
|
return;
|
2003-03-09 03:28:34 +00:00
|
|
|
}
|
2003-03-11 08:52:45 +00:00
|
|
|
}
|
2003-08-10 23:48:10 +00:00
|
|
|
if( m_Choice == CHOICE_EDIT_COURSES )
|
|
|
|
|
{
|
2003-08-16 17:45:23 +00:00
|
|
|
vector<Course*> vCourses;
|
|
|
|
|
SONGMAN->GetAllCourses( vCourses, false );
|
|
|
|
|
|
|
|
|
|
if( vCourses.size() == 0 )
|
2003-08-10 23:48:10 +00:00
|
|
|
{
|
|
|
|
|
m_soundInvalid.Play();
|
|
|
|
|
SCREENMAN->SystemMessage( "No courses are installed" );
|
|
|
|
|
return;
|
|
|
|
|
}
|
2003-08-16 17:45:23 +00:00
|
|
|
if( SONGMAN->GetNumSongs() == 0 )
|
|
|
|
|
{
|
|
|
|
|
m_soundInvalid.Play();
|
|
|
|
|
SCREENMAN->SystemMessage( "No songs are installed" );
|
|
|
|
|
return;
|
|
|
|
|
}
|
2003-08-10 23:48:10 +00:00
|
|
|
}
|
2003-03-11 08:52:45 +00:00
|
|
|
if( m_Choice == CHOICE_EXIT )
|
|
|
|
|
{
|
2003-03-09 03:28:34 +00:00
|
|
|
LOG->Trace("CHOICE_EXIT: shutting down");
|
2003-03-11 08:52:45 +00:00
|
|
|
ExitGame();
|
2003-03-09 03:28:34 +00:00
|
|
|
return;
|
2003-01-19 04:44:22 +00:00
|
|
|
}
|
2003-03-09 03:28:34 +00:00
|
|
|
|
|
|
|
|
if( Screen::JoinInput( DeviceI, type, GameI, MenuI, StyleI ) )
|
2003-07-07 01:29:18 +00:00
|
|
|
if( !m_Out.IsTransitioning() && !m_BeginOut.IsTransitioning() )
|
|
|
|
|
m_BeginOut.StartTransitioning( SM_GoToNextScreen );
|
2003-01-19 04:44:22 +00:00
|
|
|
}
|
|
|
|
|
|
2003-04-13 04:50:08 +00:00
|
|
|
// detect codes
|
|
|
|
|
if( CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_THEME) )
|
|
|
|
|
{
|
|
|
|
|
THEME->NextTheme();
|
2003-05-25 22:39:23 +00:00
|
|
|
ApplyGraphicOptions(); // update window title and icon
|
2003-04-13 04:50:08 +00:00
|
|
|
SCREENMAN->SystemMessage( "Theme: "+THEME->GetCurThemeName() );
|
|
|
|
|
SCREENMAN->SetNewScreen( "ScreenTitleMenu" );
|
2003-04-18 23:55:20 +00:00
|
|
|
TEXTUREMAN->DoDelayedDelete();
|
2003-04-13 04:50:08 +00:00
|
|
|
}
|
|
|
|
|
if( CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_ANNOUNCER) )
|
|
|
|
|
{
|
|
|
|
|
ANNOUNCER->NextAnnouncer();
|
|
|
|
|
CString sName = ANNOUNCER->GetCurAnnouncerName();
|
|
|
|
|
if( sName=="" ) sName = "(none)";
|
|
|
|
|
SCREENMAN->SystemMessage( "Announcer: "+sName );
|
|
|
|
|
SCREENMAN->SetNewScreen( "ScreenTitleMenu" );
|
|
|
|
|
}
|
2003-03-09 00:55:49 +00:00
|
|
|
// Screen::Input( DeviceI, type, GameI, MenuI, StyleI );
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
2003-01-07 01:37:21 +00:00
|
|
|
void ScreenTitleMenu::Update( float fDelta )
|
|
|
|
|
{
|
2003-01-11 08:55:21 +00:00
|
|
|
if(TimeToDemonstration.PeekDeltaTime() >= SECONDS_BEFORE_ATTRACT)
|
|
|
|
|
{
|
2003-03-25 21:17:29 +00:00
|
|
|
this->PostScreenMessage( SM_GoToAttractLoop, 0 );
|
2003-01-11 08:55:21 +00:00
|
|
|
TimeToDemonstration.GetDeltaTime();
|
|
|
|
|
}
|
2003-01-07 01:37:21 +00:00
|
|
|
Screen::Update(fDelta);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2002-05-20 08:59:37 +00:00
|
|
|
void ScreenTitleMenu::HandleScreenMessage( const ScreenMessage SM )
|
|
|
|
|
{
|
|
|
|
|
switch( SM )
|
|
|
|
|
{
|
2003-01-11 08:55:21 +00:00
|
|
|
case SM_PlayComment:
|
2002-08-03 18:40:09 +00:00
|
|
|
m_soundAttract.PlayRandom();
|
2003-03-25 21:17:29 +00:00
|
|
|
this->PostScreenMessage( SM_PlayComment, SECONDS_BETWEEN_COMMENTS );
|
2002-08-03 18:40:09 +00:00
|
|
|
break;
|
2002-08-13 23:26:46 +00:00
|
|
|
case SM_GoToNextScreen:
|
2003-01-21 05:14:59 +00:00
|
|
|
switch( m_Choice )
|
2002-08-13 23:26:46 +00:00
|
|
|
{
|
|
|
|
|
case CHOICE_GAME_START:
|
2003-04-01 19:31:27 +00:00
|
|
|
{
|
|
|
|
|
// apply default options
|
|
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
GAMESTATE->m_PlayerOptions[p].FromString( PREFSMAN->m_sDefaultModifiers );
|
|
|
|
|
GAMESTATE->m_SongOptions.FromString( PREFSMAN->m_sDefaultModifiers );
|
|
|
|
|
|
|
|
|
|
SCREENMAN->SetNewScreen( NEXT_SCREEN );
|
|
|
|
|
}
|
2002-08-13 23:26:46 +00:00
|
|
|
break;
|
|
|
|
|
case CHOICE_SELECT_GAME:
|
2002-08-27 03:59:22 +00:00
|
|
|
SCREENMAN->SetNewScreen( "ScreenSelectGame" );
|
2002-08-13 23:26:46 +00:00
|
|
|
break;
|
2003-01-31 23:31:35 +00:00
|
|
|
case CHOICE_OPTIONS:
|
|
|
|
|
SCREENMAN->SetNewScreen( "ScreenOptionsMenu" );
|
2002-08-13 23:26:46 +00:00
|
|
|
break;
|
2003-01-31 21:34:34 +00:00
|
|
|
case CHOICE_JUKEBOX:
|
2003-02-11 02:20:38 +00:00
|
|
|
SCREENMAN->SetNewScreen( "ScreenJukeboxMenu" );
|
2003-01-31 21:34:34 +00:00
|
|
|
break;
|
2003-02-14 22:24:28 +00:00
|
|
|
#ifdef DEBUG
|
2002-11-19 22:55:51 +00:00
|
|
|
case CHOICE_SANDBOX:
|
2003-01-09 04:45:49 +00:00
|
|
|
SCREENMAN->SetNewScreen( "ScreenTest" );
|
2002-11-19 22:55:51 +00:00
|
|
|
break;
|
|
|
|
|
#endif
|
2002-08-13 23:26:46 +00:00
|
|
|
case CHOICE_EDIT:
|
2002-08-27 03:59:22 +00:00
|
|
|
SCREENMAN->SetNewScreen( "ScreenEditMenu" );
|
2002-08-13 23:26:46 +00:00
|
|
|
break;
|
2003-08-10 23:48:10 +00:00
|
|
|
case CHOICE_EDIT_COURSES:
|
|
|
|
|
SCREENMAN->SetNewScreen( "ScreenEditCoursesMenu" );
|
|
|
|
|
break;
|
2002-08-13 23:26:46 +00:00
|
|
|
case CHOICE_EXIT:
|
|
|
|
|
default:
|
2002-12-28 22:26:06 +00:00
|
|
|
RAGE_ASSERT_M(0, "CHOICE_EXIT reached?"); // should never get here
|
2002-08-13 23:26:46 +00:00
|
|
|
break;
|
|
|
|
|
}
|
2002-06-23 11:43:53 +00:00
|
|
|
break;
|
2003-01-10 02:22:07 +00:00
|
|
|
case SM_GoToAttractLoop:
|
|
|
|
|
SCREENMAN->SetNewScreen( "ScreenCompany" );
|
2002-08-02 09:31:06 +00:00
|
|
|
break;
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ScreenTitleMenu::LoseFocus( int iChoiceIndex )
|
|
|
|
|
{
|
|
|
|
|
m_textChoice[iChoiceIndex].SetEffectNone();
|
2002-09-02 21:59:58 +00:00
|
|
|
m_textChoice[iChoiceIndex].StopTweening();
|
2002-05-20 08:59:37 +00:00
|
|
|
m_textChoice[iChoiceIndex].BeginTweening( 0.3f );
|
2003-04-12 06:16:12 +00:00
|
|
|
m_textChoice[iChoiceIndex].SetZoom( ZOOM_NOT_SELECTED );
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenTitleMenu::GainFocus( int iChoiceIndex )
|
|
|
|
|
{
|
2002-09-02 21:59:58 +00:00
|
|
|
m_textChoice[iChoiceIndex].StopTweening();
|
2002-05-20 08:59:37 +00:00
|
|
|
m_textChoice[iChoiceIndex].BeginTweening( 0.3f );
|
2003-04-12 06:16:12 +00:00
|
|
|
m_textChoice[iChoiceIndex].SetZoom( ZOOM_SELECTED );
|
2002-10-28 05:30:45 +00:00
|
|
|
RageColor color1, color2;
|
2002-08-13 23:26:46 +00:00
|
|
|
color1 = COLOR_SELECTED;
|
|
|
|
|
color2 = color1 * 0.5f;
|
|
|
|
|
color2.a = 1;
|
2003-02-18 23:15:38 +00:00
|
|
|
m_textChoice[iChoiceIndex].SetEffectDiffuseShift( 0.5f, color1, color2 );
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|