diff --git a/stepmania/src/ScreenEz2SelectPlayer.cpp b/stepmania/src/ScreenEz2SelectPlayer.cpp index 5aa6e047a6..fccc791b70 100644 --- a/stepmania/src/ScreenEz2SelectPlayer.cpp +++ b/stepmania/src/ScreenEz2SelectPlayer.cpp @@ -242,7 +242,7 @@ void ScreenEz2SelectPlayer::MenuStart( PlayerNumber p ) m_sprControllers[p].SetTweenZoomY( 0 ); bool bBothSidesJoined = true; - for( int pn=0; pm_bSideIsJoined[pn] ) bBothSidesJoined = false; diff --git a/stepmania/src/ScreenEz2SelectStyle.cpp b/stepmania/src/ScreenEz2SelectStyle.cpp index ff6fca2dc0..7d83a285b7 100644 --- a/stepmania/src/ScreenEz2SelectStyle.cpp +++ b/stepmania/src/ScreenEz2SelectStyle.cpp @@ -44,6 +44,20 @@ enum DStyles { DS_CLUB }; +const float OPT_X[NUM_EZ2STYLE_GRAPHICS] = { + CENTER_X+200, // This is the pad X + CENTER_X-200, // This is the pad X + CENTER_X-198, // This is the 1p X + CENTER_X+195, // This is the 2p X +}; // tells us the default X position +const float OPT_Y[NUM_EZ2STYLE_GRAPHICS] = { + CENTER_Y+130, + CENTER_Y+130, + CENTER_Y+115, + CENTER_Y+115, +}; // tells us the default Y position + + const float TWEEN_TIME = 0.35f; @@ -71,6 +85,7 @@ ScreenEz2SelectStyle::ScreenEz2SelectStyle() this->AddSubActor( &m_sprBackground[i] ); } + /* Setup The 1Player Scrolling List */ m_ScrList.SetNumberVisibleElements( 3 ); m_ScrList.CreateNewElement( "select style info game 2 style 1" ); m_ScrList.CreateNewElement( "select style info game 2 style 2" ); @@ -87,7 +102,48 @@ ScreenEz2SelectStyle::ScreenEz2SelectStyle() m_ScrList.SetXY(CENTER_X, CENTER_Y); m_ScrList.SetCurrentPosition( DS_EASY ); + /* Setup the 2Player Scrolling List */ + m_ScrList_2ply.SetNumberVisibleElements( 3 ); + m_ScrList_2ply.CreateNewElement( "select style info game 2 style 1" ); + m_ScrList_2ply.CreateNewElement( "select style info game 2 style 2" ); + m_ScrList_2ply.CreateNewElement( "select style info game 2 style 3" ); // Excess so that the user is tricked into thinking + m_ScrList_2ply.CreateNewElement( "select style info game 2 style 1" ); // the list is infinite + m_ScrList_2ply.CreateNewElement( "select style info game 2 style 2" ); + m_ScrList_2ply.CreateNewElement( "select style info game 2 style 3" ); + m_ScrList_2ply.CreateNewElement( "select style info game 2 style 1" ); + m_ScrList_2ply.CreateNewElement( "select style info game 2 style 2" ); + m_ScrList_2ply.CreateNewElement( "select style info game 2 style 3" ); + m_ScrList_2ply.SetXY(CENTER_X, CENTER_Y); + m_ScrList_2ply.SetCurrentPosition( DS_EASY ); + this->AddSubActor( &m_ScrList ); + this->AddSubActor( &m_ScrList_2ply ); + + // figure out on load which list we should put up. + if (GAMESTATE->m_CurStyle == STYLE_EZ2_SINGLE_VERSUS) // if we are using two players + { + m_ScrList.SetZoom( 0 ); // Hide the list for just 1 player + } + else + { + m_ScrList_2ply.SetZoom( 0 ); // Otherwise hide the 2 player list. + } + +// Load in the sprites we will be working with. + for( i=0; iGetPathTo("Graphics",sOptFileName) ); + m_sprOpt[i].SetXY( OPT_X[i], OPT_Y[i] ); + this->AddSubActor( &m_sprOpt[i] ); + } m_Menu.Load( THEME->GetPathTo("Graphics","select style background"), @@ -394,6 +450,24 @@ void ScreenEz2SelectStyle::AnimateBackground() } +/************************************ +Update +Desc: Animates the 1p/2p selection +************************************/ +void ScreenEz2SelectStyle::Update( float fDeltaTime ) +{ + Screen::Update( fDeltaTime ); + + fDeltaTime /= .01f; + + ez2_bounce = fmod((ez2_bounce+fDeltaTime), 20); + + /* 0..10..19 -> 10..0..9 */ + int offset = abs(10-ez2_bounce); + m_sprOpt[2].SetXY( OPT_X[2], OPT_Y[2] - offset); + m_sprOpt[3].SetXY( OPT_X[3], OPT_Y[3] - offset); +} + /************************************ TweenPlyOffScreen Desc: Squashes Player Graphics off screen diff --git a/stepmania/src/ScreenEz2SelectStyle.h b/stepmania/src/ScreenEz2SelectStyle.h index 88031b21f9..1be2b9827a 100644 --- a/stepmania/src/ScreenEz2SelectStyle.h +++ b/stepmania/src/ScreenEz2SelectStyle.h @@ -44,6 +44,8 @@ public: private: /* Private Function Prototypes */ + + void Update( float fDeltaTime ); void AnimateGraphics(); void AnimateBackground(); // void BeforeChange(); @@ -52,12 +54,15 @@ private: /* Variable Declarations */ MenuElements m_Menu; -// Sprite m_sprOpt[NUM_EZ2STYLE_GRAPHICS]; + Sprite m_sprOpt[NUM_EZ2STYLE_GRAPHICS]; // Sprite m_sprPly[NUM_EZ2P_GRAPHICS]; Sprite m_sprBackground[NUM_EZ2STYLE_GRAPHICS]; - ScrollingList m_ScrList; + // used for the bouncing of the '1p' and '2p' images + float ez2_bounce; + ScrollingList m_ScrList; + ScrollingList m_ScrList_2ply; int m_iSelectedStyle; int m_iSelectedPlayer; diff --git a/stepmania/src/ScreenStage.cpp b/stepmania/src/ScreenStage.cpp index fe8bbae753..24f17dafb5 100644 --- a/stepmania/src/ScreenStage.cpp +++ b/stepmania/src/ScreenStage.cpp @@ -437,7 +437,8 @@ ScreenStage::ScreenStage() for( i=0; i