work on BeginScreen, TweenOnScreen. (screen isn't correct yet;

there's no way to reuse the screen with different available options, etc.,
only with the same settings)
This commit is contained in:
Glenn Maynard
2005-07-15 02:06:46 +00:00
parent 93ae621c58
commit ca74ac58d1
2 changed files with 40 additions and 20 deletions
+37 -20
View File
@@ -115,17 +115,6 @@ void ScreenOptions::Init()
// add everything to m_framePage so we can animate everything at once // add everything to m_framePage so we can animate everything at once
m_framePage.SetName( "Frame" ); m_framePage.SetName( "Frame" );
this->AddChild( &m_framePage ); this->AddChild( &m_framePage );
m_bMoreShown = false;
FOREACH_PlayerNumber( p )
{
m_iCurrentRow[p] = -1;
m_iFocusX[p] = -1;
m_bWasOnExit[p] = false;
m_bGotAtLeastOneStartPressed[p] = false;
}
ON_COMMAND( m_framePage );
} }
void ScreenOptions::LoadOptionIcon( PlayerNumber pn, int iRow, CString sText ) void ScreenOptions::LoadOptionIcon( PlayerNumber pn, int iRow, CString sText )
@@ -165,7 +154,7 @@ void ScreenOptions::InitMenu( InputMode im, const vector<OptionRowDefinition> &v
m_sprPage.Load( THEME->GetPathG(m_sName,"page") ); m_sprPage.Load( THEME->GetPathG(m_sName,"page") );
m_sprPage->SetName( "Page" ); m_sprPage->SetName( "Page" );
SET_XY_AND_ON_COMMAND( m_sprPage ); SET_XY( m_sprPage );
m_framePage.AddChild( m_sprPage ); m_framePage.AddChild( m_sprPage );
// init line line highlights // init line line highlights
@@ -175,7 +164,6 @@ void ScreenOptions::InitMenu( InputMode im, const vector<OptionRowDefinition> &v
m_sprLineHighlight[p].SetName( "LineHighlight" ); m_sprLineHighlight[p].SetName( "LineHighlight" );
m_sprLineHighlight[p].SetX( LINE_HIGHLIGHT_X ); m_sprLineHighlight[p].SetX( LINE_HIGHLIGHT_X );
m_framePage.AddChild( &m_sprLineHighlight[p] ); m_framePage.AddChild( &m_sprLineHighlight[p] );
ON_COMMAND( m_sprLineHighlight[p] );
} }
// init cursors // init cursors
@@ -225,8 +213,7 @@ void ScreenOptions::InitMenu( InputMode im, const vector<OptionRowDefinition> &v
m_sprMore.Load( THEME->GetPathG( m_sName,"more") ); m_sprMore.Load( THEME->GetPathG( m_sName,"more") );
m_sprMore->SetName( "More" ); m_sprMore->SetName( "More" );
SET_XY_AND_ON_COMMAND( m_sprMore ); SET_XY( m_sprMore );
COMMAND( m_sprMore, m_bMoreShown? "ShowMore":"HideMore" );
m_framePage.AddChild( m_sprMore ); m_framePage.AddChild( m_sprMore );
switch( m_InputMode ) switch( m_InputMode )
@@ -248,7 +235,7 @@ void ScreenOptions::InitMenu( InputMode im, const vector<OptionRowDefinition> &v
{ {
m_sprDisqualify[p].Load( THEME->GetPathG(m_sName,"disqualify") ); m_sprDisqualify[p].Load( THEME->GetPathG(m_sName,"disqualify") );
m_sprDisqualify[p]->SetName( ssprintf("DisqualifyP%i",p+1) ); m_sprDisqualify[p]->SetName( ssprintf("DisqualifyP%i",p+1) );
SET_XY_AND_ON_COMMAND( m_sprDisqualify[p] ); SET_XY( m_sprDisqualify[p] );
m_sprDisqualify[p]->SetHidden( true ); // unhide later if handicapping options are discovered m_sprDisqualify[p]->SetHidden( true ); // unhide later if handicapping options are discovered
m_framePage.AddChild( m_sprDisqualify[p] ); m_framePage.AddChild( m_sprDisqualify[p] );
} }
@@ -259,6 +246,24 @@ void ScreenOptions::InitMenu( InputMode im, const vector<OptionRowDefinition> &v
GetExplanationText( r ); GetExplanationText( r );
} }
this->SortByDrawOrder();
}
void ScreenOptions::BeginScreen()
{
ScreenWithMenuElements::BeginScreen();
ON_COMMAND( m_framePage );
m_bMoreShown = false;
FOREACH_PlayerNumber( p )
{
m_iCurrentRow[p] = -1;
m_iFocusX[p] = -1;
m_bWasOnExit[p] = false;
m_bGotAtLeastOneStartPressed[p] = false;
}
// put focus on the first enabled row // put focus on the first enabled row
FOREACH_PlayerNumber( p ) FOREACH_PlayerNumber( p )
{ {
@@ -275,8 +280,7 @@ void ScreenOptions::InitMenu( InputMode im, const vector<OptionRowDefinition> &v
// Hide highlight if no rows are enabled. // Hide highlight if no rows are enabled.
FOREACH_HumanPlayer( p ) FOREACH_HumanPlayer( p )
if( m_iCurrentRow[p] == -1 ) m_sprLineHighlight[p].SetHidden( m_iCurrentRow[p] == -1 );
m_sprLineHighlight[p].SetHidden( true );
CHECKPOINT; CHECKPOINT;
@@ -302,9 +306,22 @@ void ScreenOptions::InitMenu( InputMode im, const vector<OptionRowDefinition> &v
row.FinishTweening(); row.FinishTweening();
} }
m_sprMore->FinishTweening(); }
this->SortByDrawOrder(); void ScreenOptions::TweenOnScreen()
{
ScreenWithMenuElements::TweenOnScreen();
ON_COMMAND( m_sprPage );
FOREACH_HumanPlayer( p )
ON_COMMAND( m_sprLineHighlight[p] );
COMMAND( m_sprMore, m_bMoreShown? "ShowMore":"HideMore" );
m_sprMore->FinishTweening();
ON_COMMAND( m_sprMore );
FOREACH_PlayerNumber( p )
ON_COMMAND( m_sprDisqualify[p] );
} }
ScreenOptions::~ScreenOptions() ScreenOptions::~ScreenOptions()
+3
View File
@@ -28,6 +28,7 @@ class ScreenOptions : public ScreenWithMenuElements
public: public:
ScreenOptions( CString sClassName ); ScreenOptions( CString sClassName );
virtual void Init(); virtual void Init();
virtual void BeginScreen();
void InitMenu( InputMode im, const vector<OptionRowDefinition> &vDefs, const vector<OptionRowHandler*> &vHands ); void InitMenu( InputMode im, const vector<OptionRowDefinition> &vDefs, const vector<OptionRowHandler*> &vHands );
virtual ~ScreenOptions(); virtual ~ScreenOptions();
virtual void Update( float fDeltaTime ); virtual void Update( float fDeltaTime );
@@ -35,6 +36,8 @@ public:
virtual void HandleScreenMessage( const ScreenMessage SM ); virtual void HandleScreenMessage( const ScreenMessage SM );
protected: protected:
virtual void TweenOnScreen();
virtual void ImportOptions( int iRow, const vector<PlayerNumber> &vpns ) = 0; virtual void ImportOptions( int iRow, const vector<PlayerNumber> &vpns ) = 0;
virtual void ExportOptions( int iRow, const vector<PlayerNumber> &vpns ) = 0; virtual void ExportOptions( int iRow, const vector<PlayerNumber> &vpns ) = 0;