2003-02-16 04:01:45 +00:00
|
|
|
#include "global.h"
|
2002-09-29 18:09:38 +00:00
|
|
|
/****************************************
|
2003-03-03 10:03:02 +00:00
|
|
|
ScreenSelectModeOld,cpp
|
2002-09-29 18:09:38 +00:00
|
|
|
Desc: See Header
|
|
|
|
|
Copyright (C):
|
|
|
|
|
Andrew Livy
|
2002-10-06 00:07:09 +00:00
|
|
|
Chris Danford
|
2002-09-29 18:09:38 +00:00
|
|
|
*****************************************/
|
|
|
|
|
|
|
|
|
|
/* Includes */
|
|
|
|
|
|
|
|
|
|
#include "ScreenSelectMode.h"
|
|
|
|
|
#include "ScreenManager.h"
|
|
|
|
|
#include "PrefsManager.h"
|
2003-01-02 07:54:28 +00:00
|
|
|
#include "RageSoundManager.h"
|
2002-09-29 18:09:38 +00:00
|
|
|
#include "GameConstantsAndTypes.h"
|
|
|
|
|
#include "PrefsManager.h"
|
|
|
|
|
#include "GameManager.h"
|
|
|
|
|
#include "RageLog.h"
|
|
|
|
|
#include "AnnouncerManager.h"
|
|
|
|
|
#include "GameState.h"
|
|
|
|
|
#include "RageException.h"
|
|
|
|
|
#include "RageTimer.h"
|
|
|
|
|
#include "GameState.h"
|
2002-11-11 04:53:31 +00:00
|
|
|
#include "ThemeManager.h"
|
2002-09-29 18:09:38 +00:00
|
|
|
|
|
|
|
|
/* Constants */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2002-09-30 16:57:34 +00:00
|
|
|
#define JOIN_FRAME_X( p ) THEME->GetMetricF("ScreenSelectMode",ssprintf("JoinFrameP%dX",p+1))
|
|
|
|
|
#define JOIN_FRAME_Y( i ) THEME->GetMetricF("ScreenSelectMode",ssprintf("JoinFrameP%dY",i+1))
|
|
|
|
|
#define JOIN_MESSAGE_X( p ) THEME->GetMetricF("ScreenSelectMode",ssprintf("JoinMessageP%dX",p+1))
|
|
|
|
|
#define JOIN_MESSAGE_Y( i ) THEME->GetMetricF("ScreenSelectMode",ssprintf("JoinMessageP%dY",i+1))
|
2002-12-20 19:05:54 +00:00
|
|
|
#define GUIDE_X THEME->GetMetricF("ScreenSelectMode","GuideX")
|
|
|
|
|
#define GUIDE_Y THEME->GetMetricF("ScreenSelectMode","GuideY")
|
2002-09-30 16:57:34 +00:00
|
|
|
#define HELP_TEXT THEME->GetMetric("ScreenSelectMode","HelpText")
|
|
|
|
|
#define TIMER_SECONDS THEME->GetMetricI("ScreenSelectMode","TimerSeconds")
|
|
|
|
|
#define NEXT_SCREEN THEME->GetMetric("ScreenSelectMode","NextScreen")
|
|
|
|
|
#define SCROLLING_ELEMENT_SPACING THEME->GetMetricI("ScreenSelectMode","ScrollingElementSpacing")
|
|
|
|
|
#define SCROLLING_LIST_X THEME->GetMetricF("ScreenSelectMode","ScrollingListX")
|
|
|
|
|
#define SCROLLING_LIST_Y THEME->GetMetricF("ScreenSelectMode","ScrollingListY")
|
|
|
|
|
#define SELECTION_SPECIFIC_BG_ANIMATIONS THEME->GetMetricB("ScreenSelectMode","SelectionSpecificBGAnimations")
|
|
|
|
|
#define BOUNCE_JOIN_MESSAGE THEME->GetMetricB("ScreenSelectMode","BounceJoinMessage")
|
|
|
|
|
#define FOLD_ON_JOIN THEME->GetMetricB("ScreenSelectMode","FoldOnJoin")
|
2002-09-29 18:09:38 +00:00
|
|
|
|
|
|
|
|
const float TWEEN_TIME = 0.35f;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/************************************
|
|
|
|
|
ScreenSelectMode (Constructor)
|
|
|
|
|
Desc: Sets up the screen display
|
|
|
|
|
************************************/
|
|
|
|
|
|
2003-04-12 06:16:12 +00:00
|
|
|
ScreenSelectMode::ScreenSelectMode() : Screen("ScreenSelectMode")
|
2002-09-29 18:09:38 +00:00
|
|
|
{
|
|
|
|
|
LOG->Trace( "ScreenSelectMode::ScreenSelectMode()" );
|
2002-10-06 20:30:11 +00:00
|
|
|
GAMESTATE->m_bPlayersCanJoin = true;
|
|
|
|
|
SCREENMAN->RefreshCreditsMessages();
|
2002-09-29 18:09:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
GAMESTATE->m_PlayMode = PLAY_MODE_ARCADE; // the only mode you can select on this screen
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*********** TODO: MAKE THIS WORK FOR ALL GAME STYLES! *************/
|
2003-04-12 17:39:27 +00:00
|
|
|
m_ChoiceListFrame.Load( THEME->GetPathToG("ScreenSelectMode list frame"));
|
2002-09-30 16:57:34 +00:00
|
|
|
m_ChoiceListFrame.SetXY( SCROLLING_LIST_X, SCROLLING_LIST_Y);
|
|
|
|
|
this->AddChild( &m_ChoiceListFrame );
|
2002-09-29 18:09:38 +00:00
|
|
|
|
|
|
|
|
m_ScrollingList.SetXY( CENTER_X, SCROLLING_LIST_Y );
|
|
|
|
|
m_ScrollingList.SetSpacing( SCROLLING_ELEMENT_SPACING );
|
|
|
|
|
m_ScrollingList.SetNumberVisible( 9 );
|
|
|
|
|
this->AddChild( &m_ScrollingList );
|
|
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_ChoiceListHighlight.Load( THEME->GetPathToG("ScreenSelectMode list highlight"));
|
2002-09-30 16:57:34 +00:00
|
|
|
m_ChoiceListHighlight.SetXY( CENTER_X, SCROLLING_LIST_Y);
|
|
|
|
|
this->AddChild( &m_ChoiceListHighlight );
|
2002-09-29 18:09:38 +00:00
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_Guide.Load( THEME->GetPathToG("select mode guide"));
|
2002-12-20 19:05:54 +00:00
|
|
|
m_Guide.SetXY( GUIDE_X, GUIDE_Y );
|
|
|
|
|
this->AddChild( &m_Guide );
|
|
|
|
|
|
2002-09-29 18:09:38 +00:00
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
2003-04-12 17:39:27 +00:00
|
|
|
m_sprJoinFrame[p].Load( THEME->GetPathToG("ScreenSelectMode join frame 1x2") );
|
2002-09-30 16:57:34 +00:00
|
|
|
m_sprJoinFrame[p].StopAnimating();
|
|
|
|
|
m_sprJoinFrame[p].SetState( p );
|
|
|
|
|
m_sprJoinFrame[p].SetXY( JOIN_FRAME_X(p), JOIN_FRAME_Y(p) );
|
|
|
|
|
this->AddChild( &m_sprJoinFrame[p] );
|
|
|
|
|
|
|
|
|
|
if( GAMESTATE->m_bSideIsJoined[p] )
|
|
|
|
|
m_sprJoinFrame[p].SetZoomY( 0 );
|
|
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_sprJoinMessage[p].Load( THEME->GetPathToG("ScreenSelectMode join message 2x2") );
|
2002-09-30 16:57:34 +00:00
|
|
|
m_sprJoinMessage[p].StopAnimating();
|
|
|
|
|
m_sprJoinMessage[p].SetState( p );
|
|
|
|
|
m_sprJoinMessage[p].SetXY( JOIN_MESSAGE_X(p), JOIN_MESSAGE_Y(p) );
|
|
|
|
|
if( BOUNCE_JOIN_MESSAGE )
|
2003-03-02 01:43:33 +00:00
|
|
|
m_sprJoinMessage[p].SetEffectBounce( 0.5f, RageVector3(0,10,0) );
|
2002-09-30 16:57:34 +00:00
|
|
|
this->AddChild( &m_sprJoinMessage[p] );
|
|
|
|
|
|
|
|
|
|
if( GAMESTATE->m_bSideIsJoined[p] )
|
|
|
|
|
{
|
|
|
|
|
m_sprJoinMessage[p].SetState( p+NUM_PLAYERS );
|
2002-09-29 18:09:38 +00:00
|
|
|
|
2002-09-30 16:57:34 +00:00
|
|
|
if( FOLD_ON_JOIN )
|
|
|
|
|
{
|
|
|
|
|
m_sprJoinMessage[p].SetZoomY( 0 );
|
|
|
|
|
m_sprJoinFrame[p].SetZoomY( 0 );
|
|
|
|
|
}
|
|
|
|
|
}
|
2002-09-29 18:09:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-03-09 00:55:49 +00:00
|
|
|
m_Menu.Load( "ScreenSelectMode" );
|
2002-09-29 18:09:38 +00:00
|
|
|
this->AddChild( &m_Menu );
|
|
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_soundSelect.Load( THEME->GetPathToS("Common start") );
|
|
|
|
|
m_soundChange.Load( THEME->GetPathToS("ScreenSelectMode change"), true );
|
2002-09-29 18:09:38 +00:00
|
|
|
|
2003-03-09 00:55:49 +00:00
|
|
|
SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("select mode intro") );
|
2002-09-29 18:09:38 +00:00
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
SOUNDMAN->PlayMusic( THEME->GetPathToS("ScreenSelectMode music") );
|
2002-09-29 18:09:38 +00:00
|
|
|
|
|
|
|
|
RefreshModeChoices();
|
|
|
|
|
|
2002-12-21 20:33:10 +00:00
|
|
|
if( SELECTION_SPECIFIC_BG_ANIMATIONS )
|
|
|
|
|
{
|
|
|
|
|
CString sGameName = GAMESTATE->GetCurrentGameDef()->m_szName;
|
|
|
|
|
|
|
|
|
|
for( unsigned i=0; i<m_apPossibleModeChoices.size(); i++ )
|
|
|
|
|
{
|
|
|
|
|
CString sChoiceName = m_apPossibleModeChoices[i]->name;
|
2003-04-12 17:39:27 +00:00
|
|
|
m_Infotext[i].Load( THEME->GetPathToG(ssprintf("ScreenSelectMode infotext %s %s", sGameName.GetString(), sChoiceName.GetString())) );
|
2002-12-21 20:33:10 +00:00
|
|
|
m_Infotext[i].SetXY( GUIDE_X, GUIDE_Y );
|
|
|
|
|
this->AddChild( &m_Infotext[i] );
|
|
|
|
|
m_Infotext[i].SetDiffuse( RageColor(0,0,0,0));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
AfterChange();
|
|
|
|
|
|
2002-09-29 18:09:38 +00:00
|
|
|
TweenOnScreen();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/************************************
|
|
|
|
|
~ScreenSelectMode (Destructor)
|
|
|
|
|
Desc: Writes line to log when screen
|
|
|
|
|
is terminated.
|
|
|
|
|
************************************/
|
|
|
|
|
ScreenSelectMode::~ScreenSelectMode()
|
|
|
|
|
{
|
|
|
|
|
LOG->Trace( "ScreenSelectMode::~ScreenSelectMode()" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/************************************
|
|
|
|
|
Update
|
|
|
|
|
Desc: Animates the 1p/2p selection
|
|
|
|
|
************************************/
|
|
|
|
|
void ScreenSelectMode::Update( float fDeltaTime )
|
|
|
|
|
{
|
2002-09-29 22:59:24 +00:00
|
|
|
m_BGAnimations[ m_ScrollingList.GetSelection() ].Update( fDeltaTime );
|
2002-09-29 18:09:38 +00:00
|
|
|
Screen::Update( fDeltaTime );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/************************************
|
|
|
|
|
DrawPrimitives
|
|
|
|
|
Desc: Draws the screen =P
|
|
|
|
|
************************************/
|
|
|
|
|
|
|
|
|
|
void ScreenSelectMode::DrawPrimitives()
|
|
|
|
|
{
|
|
|
|
|
m_Menu.DrawBottomLayer();
|
2002-09-29 22:59:24 +00:00
|
|
|
m_BGAnimations[ m_ScrollingList.GetSelection() ].Draw();
|
2002-09-29 18:09:38 +00:00
|
|
|
Screen::DrawPrimitives();
|
|
|
|
|
m_Menu.DrawTopLayer();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/************************************
|
|
|
|
|
Input
|
|
|
|
|
Desc: Handles player input.
|
|
|
|
|
************************************/
|
|
|
|
|
void ScreenSelectMode::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
|
|
|
|
|
{
|
|
|
|
|
LOG->Trace( "ScreenSelectMode::Input()" );
|
|
|
|
|
|
2003-03-09 00:55:49 +00:00
|
|
|
if( m_Menu.IsTransitioning() )
|
2002-09-29 18:09:38 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
Screen::Input( DeviceI, type, GameI, MenuI, StyleI ); // default input handler
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/************************************
|
|
|
|
|
HandleScreenMessage
|
|
|
|
|
Desc: Handles Screen Messages and changes
|
|
|
|
|
game states.
|
|
|
|
|
************************************/
|
|
|
|
|
void ScreenSelectMode::HandleScreenMessage( const ScreenMessage SM )
|
|
|
|
|
{
|
|
|
|
|
Screen::HandleScreenMessage( SM );
|
|
|
|
|
|
|
|
|
|
switch( SM )
|
|
|
|
|
{
|
|
|
|
|
case SM_MenuTimer:
|
2002-10-06 00:07:09 +00:00
|
|
|
MenuStart( PLAYER_INVALID );
|
2002-09-29 18:09:38 +00:00
|
|
|
TweenOffScreen();
|
2003-03-09 00:55:49 +00:00
|
|
|
m_Menu.StartTransitioning( SM_GoToNextScreen );
|
2002-09-29 18:09:38 +00:00
|
|
|
break;
|
|
|
|
|
case SM_GoToPrevScreen:
|
2003-01-21 02:16:40 +00:00
|
|
|
SOUNDMAN->StopMusic();
|
2002-09-29 18:09:38 +00:00
|
|
|
SCREENMAN->SetNewScreen( "ScreenTitleMenu" );
|
|
|
|
|
break;
|
|
|
|
|
case SM_GoToNextScreen:
|
2002-10-06 00:07:09 +00:00
|
|
|
// Put the mode choice into effect
|
|
|
|
|
int iSelection = m_ScrollingList.GetSelection();
|
2002-11-11 04:53:31 +00:00
|
|
|
const ModeChoice* pChoice = m_apPossibleModeChoices[ iSelection ];
|
|
|
|
|
GAMESTATE->m_CurStyle = pChoice->style;
|
|
|
|
|
GAMESTATE->m_PlayMode = pChoice->pm;
|
2002-10-06 00:07:09 +00:00
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
2002-11-11 04:53:31 +00:00
|
|
|
GAMESTATE->m_PreferredDifficulty[p] = pChoice->dc;
|
2002-10-06 00:07:09 +00:00
|
|
|
|
|
|
|
|
switch( GAMESTATE->m_PlayMode )
|
|
|
|
|
{
|
|
|
|
|
case PLAY_MODE_ARCADE:
|
|
|
|
|
SCREENMAN->SetNewScreen( NEXT_SCREEN );
|
|
|
|
|
break;
|
2003-01-21 05:14:59 +00:00
|
|
|
case PLAY_MODE_NONSTOP:
|
2002-10-06 00:07:09 +00:00
|
|
|
case PLAY_MODE_ONI:
|
|
|
|
|
case PLAY_MODE_ENDLESS:
|
|
|
|
|
SCREENMAN->SetNewScreen( "ScreenSelectCourse" );
|
|
|
|
|
break;
|
2003-01-21 05:14:59 +00:00
|
|
|
default:
|
|
|
|
|
ASSERT(0);
|
2002-10-06 00:07:09 +00:00
|
|
|
}
|
2002-09-29 18:09:38 +00:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenSelectMode::RefreshModeChoices()
|
|
|
|
|
{
|
|
|
|
|
int iNumSidesJoined = GAMESTATE->GetNumSidesJoined();
|
|
|
|
|
|
2003-03-03 10:03:02 +00:00
|
|
|
// GAMEMAN->GetModesChoicesForGame( GAMESTATE->m_CurGame, m_apPossibleModeChoices ); // FIXME
|
2002-11-11 04:53:31 +00:00
|
|
|
ASSERT( !m_apPossibleModeChoices.empty() );
|
2002-09-29 18:09:38 +00:00
|
|
|
|
2002-10-06 17:02:04 +00:00
|
|
|
int i;
|
|
|
|
|
|
2002-10-06 00:07:09 +00:00
|
|
|
// remove ModeChoices that won't work with the current number of players
|
2002-11-11 04:53:31 +00:00
|
|
|
for( i=m_apPossibleModeChoices.size()-1; i>=0; i-- )
|
|
|
|
|
if( m_apPossibleModeChoices[i]->numSidesJoinedToPlay != iNumSidesJoined )
|
|
|
|
|
m_apPossibleModeChoices.erase( m_apPossibleModeChoices.begin()+i,
|
|
|
|
|
m_apPossibleModeChoices.begin()+i+1 );
|
2002-10-06 00:07:09 +00:00
|
|
|
|
2002-09-29 18:09:38 +00:00
|
|
|
CString sGameName = GAMESTATE->GetCurrentGameDef()->m_szName;
|
|
|
|
|
|
|
|
|
|
CStringArray asGraphicPaths;
|
2002-11-11 04:53:31 +00:00
|
|
|
for( unsigned j=0; j<m_apPossibleModeChoices.size(); j++ )
|
2002-09-29 18:09:38 +00:00
|
|
|
{
|
2002-11-11 04:53:31 +00:00
|
|
|
const ModeChoice* pChoice = m_apPossibleModeChoices[j];
|
2003-04-12 17:39:27 +00:00
|
|
|
asGraphicPaths.push_back( THEME->GetPathToG( ssprintf("select mode choice %s %s", sGameName.GetString(), pChoice->name) ) );
|
2002-09-29 18:09:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_ScrollingList.Load( asGraphicPaths );
|
2002-09-29 22:59:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
if( SELECTION_SPECIFIC_BG_ANIMATIONS )
|
|
|
|
|
{
|
|
|
|
|
CString sGameName = GAMESTATE->GetCurrentGameDef()->m_szName;
|
|
|
|
|
|
2002-11-11 04:53:31 +00:00
|
|
|
for( unsigned i=0; i<m_apPossibleModeChoices.size(); i++ )
|
2002-09-29 22:59:24 +00:00
|
|
|
{
|
2002-11-11 04:53:31 +00:00
|
|
|
CString sChoiceName = m_apPossibleModeChoices[i]->name;
|
2003-04-12 17:39:27 +00:00
|
|
|
m_BGAnimations[i].LoadFromAniDir( THEME->GetPathToB(ssprintf("select mode %s %s", sGameName.GetString(), sChoiceName.GetString())) );
|
2002-09-29 22:59:24 +00:00
|
|
|
}
|
|
|
|
|
}
|
2002-09-29 18:09:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/************************************
|
|
|
|
|
MenuBack
|
|
|
|
|
Desc: Actions performed when a player
|
|
|
|
|
presses the button bound to back
|
|
|
|
|
************************************/
|
|
|
|
|
void ScreenSelectMode::MenuBack( PlayerNumber pn )
|
|
|
|
|
{
|
2003-01-21 02:16:40 +00:00
|
|
|
SOUNDMAN->StopMusic();
|
2002-09-29 18:09:38 +00:00
|
|
|
|
2003-03-09 00:55:49 +00:00
|
|
|
m_Menu.Back( SM_GoToPrevScreen );
|
2002-09-29 18:09:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenSelectMode::AfterChange()
|
|
|
|
|
{
|
2002-12-21 20:33:10 +00:00
|
|
|
if( SELECTION_SPECIFIC_BG_ANIMATIONS )
|
|
|
|
|
{
|
|
|
|
|
for( unsigned i=0; i<m_apPossibleModeChoices.size(); i++ )
|
|
|
|
|
{
|
2003-01-11 08:55:21 +00:00
|
|
|
if(i == (unsigned)m_ScrollingList.GetSelection())
|
2002-12-21 20:33:10 +00:00
|
|
|
{
|
|
|
|
|
m_Infotext[i].SetDiffuse(RageColor(1,1,1,1));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
m_Infotext[i].SetDiffuse(RageColor(0,0,0,0));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2002-09-29 22:59:24 +00:00
|
|
|
// CString sGameName = GAMESTATE->GetCurrentGameDef()->m_szName;
|
|
|
|
|
// const ModeChoice& choice = m_aPossibleModeChoices[ m_ScrollingList.GetSelection() ];
|
2002-09-29 18:09:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenSelectMode::MenuLeft( PlayerNumber pn )
|
|
|
|
|
{
|
|
|
|
|
m_ScrollingList.Left();
|
|
|
|
|
m_soundChange.Play();
|
|
|
|
|
AfterChange();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenSelectMode::MenuRight( PlayerNumber pn )
|
|
|
|
|
{
|
|
|
|
|
m_ScrollingList.Right();
|
|
|
|
|
m_soundChange.Play();
|
|
|
|
|
AfterChange();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/************************************
|
|
|
|
|
MenuDown
|
|
|
|
|
Desc: Actions performed when a player
|
|
|
|
|
presses the button bound to down
|
|
|
|
|
************************************/
|
|
|
|
|
void ScreenSelectMode::MenuDown( PlayerNumber pn )
|
|
|
|
|
{
|
|
|
|
|
if( GAMESTATE->m_bSideIsJoined[pn] ) // already joined
|
|
|
|
|
return; // ignore
|
|
|
|
|
|
|
|
|
|
MenuStart( pn );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/************************************
|
|
|
|
|
MenuStart
|
|
|
|
|
Desc: Actions performed when a player
|
|
|
|
|
presses the button bound to start
|
|
|
|
|
************************************/
|
|
|
|
|
void ScreenSelectMode::MenuStart( PlayerNumber pn )
|
|
|
|
|
{
|
2002-10-06 00:07:09 +00:00
|
|
|
if( pn == PLAYER_INVALID )
|
|
|
|
|
pn = GAMESTATE->m_MasterPlayerNumber;
|
|
|
|
|
|
2002-09-29 18:09:38 +00:00
|
|
|
if( !GAMESTATE->m_bSideIsJoined[pn] )
|
|
|
|
|
{
|
|
|
|
|
// join them
|
|
|
|
|
GAMESTATE->m_bSideIsJoined[pn] = true;
|
|
|
|
|
SCREENMAN->RefreshCreditsMessages();
|
|
|
|
|
m_soundSelect.Play();
|
2002-09-30 16:57:34 +00:00
|
|
|
|
|
|
|
|
m_sprJoinMessage[pn].SetState( pn + NUM_PLAYERS );
|
|
|
|
|
|
|
|
|
|
if( FOLD_ON_JOIN )
|
|
|
|
|
{
|
|
|
|
|
m_sprJoinMessage[pn].BeginTweening( 0.25f );
|
2003-04-12 06:16:12 +00:00
|
|
|
m_sprJoinMessage[pn].SetZoomY( 0 );
|
2002-09-30 16:57:34 +00:00
|
|
|
m_sprJoinFrame[pn].BeginTweening( 0.25f );
|
2003-04-12 06:16:12 +00:00
|
|
|
m_sprJoinFrame[pn].SetZoomY( 0 );
|
2002-09-30 16:57:34 +00:00
|
|
|
}
|
2002-09-29 18:09:38 +00:00
|
|
|
|
|
|
|
|
RefreshModeChoices();
|
|
|
|
|
|
|
|
|
|
m_ScrollingList.SetSelection( 0 );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// made a selection
|
|
|
|
|
m_soundSelect.Play();
|
|
|
|
|
|
|
|
|
|
TweenOffScreen();
|
2003-03-09 00:55:49 +00:00
|
|
|
m_Menu.StartTransitioning( SM_GoToNextScreen );
|
2002-10-06 20:30:11 +00:00
|
|
|
GAMESTATE->m_bPlayersCanJoin = false;
|
|
|
|
|
SCREENMAN->RefreshCreditsMessages();
|
2002-09-29 18:09:38 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenSelectMode::TweenOnScreen()
|
|
|
|
|
{
|
|
|
|
|
float fOriginalZoomY = m_ScrollingList.GetZoomY();
|
|
|
|
|
m_ScrollingList.BeginTweening( 0.5f );
|
2003-04-12 06:16:12 +00:00
|
|
|
m_ScrollingList.SetZoomY( fOriginalZoomY );
|
2002-09-29 18:09:38 +00:00
|
|
|
|
|
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
|
|
|
|
float fOffScreenOffset = float( (p==PLAYER_1) ? -SCREEN_WIDTH/2 : +SCREEN_WIDTH/2 );
|
|
|
|
|
|
|
|
|
|
float fOriginalX;
|
|
|
|
|
|
2002-09-30 16:57:34 +00:00
|
|
|
fOriginalX = m_sprJoinMessage[p].GetX();
|
|
|
|
|
m_sprJoinMessage[p].SetX( m_sprJoinMessage[p].GetX()+fOffScreenOffset );
|
|
|
|
|
m_sprJoinMessage[p].BeginTweening( 0.5f, Actor::TWEEN_BOUNCE_END );
|
2003-04-12 06:16:12 +00:00
|
|
|
m_sprJoinMessage[p].SetX( fOriginalX );
|
2002-09-30 16:57:34 +00:00
|
|
|
|
|
|
|
|
fOriginalX = m_sprJoinFrame[p].GetX();
|
|
|
|
|
m_sprJoinFrame[p].SetX( m_sprJoinMessage[p].GetX()+fOffScreenOffset );
|
|
|
|
|
m_sprJoinFrame[p].BeginTweening( 0.5f, Actor::TWEEN_BOUNCE_END );
|
2003-04-12 06:16:12 +00:00
|
|
|
m_sprJoinFrame[p].SetX( fOriginalX );
|
2002-09-29 18:09:38 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenSelectMode::TweenOffScreen()
|
|
|
|
|
{
|
|
|
|
|
m_ScrollingList.BeginTweening( 0.5f );
|
2003-04-12 06:16:12 +00:00
|
|
|
m_ScrollingList.SetZoomY( 0 );
|
2002-09-29 18:09:38 +00:00
|
|
|
|
|
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
|
|
|
|
float fOffScreenOffset = float( (p==PLAYER_1) ? -SCREEN_WIDTH : +SCREEN_WIDTH );
|
|
|
|
|
|
2003-03-02 01:43:33 +00:00
|
|
|
m_sprJoinMessage[p].BeginTweening( 0.5f, Actor::TWEEN_DECELERATE );
|
2003-04-12 06:16:12 +00:00
|
|
|
m_sprJoinMessage[p].SetX( m_sprJoinMessage[p].GetX()+fOffScreenOffset );
|
2003-03-02 01:43:33 +00:00
|
|
|
m_sprJoinFrame[p].BeginTweening( 0.5f, Actor::TWEEN_DECELERATE );
|
2003-04-12 06:16:12 +00:00
|
|
|
m_sprJoinFrame[p].SetX( m_sprJoinMessage[p].GetX()+fOffScreenOffset );
|
2002-09-29 18:09:38 +00:00
|
|
|
}
|
|
|
|
|
}
|