add ScreenOptions::RestartOptions, to allow changing option rows
without restarting the screen completely
This commit is contained in:
@@ -249,10 +249,9 @@ void ScreenOptions::InitMenu( const vector<OptionRowHandler*> &vHands )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenOptions::BeginScreen()
|
/* Call when option rows have been re-initialized. */
|
||||||
|
void ScreenOptions::RestartOptions( bool bTweenIn )
|
||||||
{
|
{
|
||||||
ScreenWithMenuElements::BeginScreen();
|
|
||||||
|
|
||||||
for( unsigned r=0; r<m_pRows.size(); r++ ) // foreach row
|
for( unsigned r=0; r<m_pRows.size(); r++ ) // foreach row
|
||||||
{
|
{
|
||||||
OptionRow *pRow = m_pRows[r];
|
OptionRow *pRow = m_pRows[r];
|
||||||
@@ -268,14 +267,12 @@ void ScreenOptions::BeginScreen()
|
|||||||
pRow->AfterImportOptions( p );
|
pRow->AfterImportOptions( p );
|
||||||
}
|
}
|
||||||
|
|
||||||
ON_COMMAND( m_framePage );
|
|
||||||
|
|
||||||
FOREACH_PlayerNumber( p )
|
FOREACH_PlayerNumber( p )
|
||||||
{
|
{
|
||||||
m_iCurrentRow[p] = -1;
|
m_iCurrentRow[p] = -1;
|
||||||
m_iFocusX[p] = -1;
|
m_iFocusX[p] = -1;
|
||||||
m_bWasOnExit[p] = false;
|
m_bWasOnExit[p] = false;
|
||||||
m_bGotAtLeastOneStartPressed[p] = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// put focus on the first enabled row
|
// put focus on the first enabled row
|
||||||
@@ -292,11 +289,6 @@ void ScreenOptions::BeginScreen()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FOREACH_PlayerNumber( p )
|
|
||||||
{
|
|
||||||
m_sprLineHighlight[p]->SetHidden( !GAMESTATE->IsHumanPlayer(p) );
|
|
||||||
m_Cursor[p].SetHidden( !GAMESTATE->IsHumanPlayer(p) );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Hide highlight if no rows are enabled.
|
// Hide highlight if no rows are enabled.
|
||||||
FOREACH_HumanPlayer( p )
|
FOREACH_HumanPlayer( p )
|
||||||
@@ -317,6 +309,24 @@ void ScreenOptions::BeginScreen()
|
|||||||
CHECKPOINT;
|
CHECKPOINT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScreenOptions::BeginScreen()
|
||||||
|
{
|
||||||
|
ScreenWithMenuElements::BeginScreen();
|
||||||
|
|
||||||
|
RestartOptions( true );
|
||||||
|
|
||||||
|
FOREACH_PlayerNumber( p )
|
||||||
|
m_bGotAtLeastOneStartPressed[p] = false;
|
||||||
|
|
||||||
|
ON_COMMAND( m_framePage );
|
||||||
|
|
||||||
|
FOREACH_PlayerNumber( p )
|
||||||
|
{
|
||||||
|
m_sprLineHighlight[p]->SetHidden( !GAMESTATE->IsHumanPlayer(p) );
|
||||||
|
m_Cursor[p].SetHidden( !GAMESTATE->IsHumanPlayer(p) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ScreenOptions::TweenOnScreen()
|
void ScreenOptions::TweenOnScreen()
|
||||||
{
|
{
|
||||||
ScreenWithMenuElements::TweenOnScreen();
|
ScreenWithMenuElements::TweenOnScreen();
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ protected:
|
|||||||
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;
|
||||||
|
|
||||||
|
void RestartOptions( bool bTweenIn );
|
||||||
void GetWidthXY( PlayerNumber pn, int iRow, int iChoiceOnRow, int &iWidthOut, int &iXOut, int &iYOut ) const;
|
void GetWidthXY( PlayerNumber pn, int iRow, int iChoiceOnRow, int &iWidthOut, int &iXOut, int &iYOut ) const;
|
||||||
RString GetExplanationText( int iRow ) const;
|
RString GetExplanationText( int iRow ) const;
|
||||||
void PositionIcons();
|
void PositionIcons();
|
||||||
|
|||||||
Reference in New Issue
Block a user