OnChange -> AfterChangeValueOrRow
This commit is contained in:
@@ -76,9 +76,9 @@ void ScreenMiniMenu::LoadMenu( const MenuDef* pDef )
|
|||||||
ScreenOptions::InitMenu( vDefs, vHands );
|
ScreenOptions::InitMenu( vDefs, vHands );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenMiniMenu::OnChange( PlayerNumber pn )
|
void ScreenMiniMenu::AfterChangeValueOrRow( PlayerNumber pn )
|
||||||
{
|
{
|
||||||
ScreenOptions::OnChange( pn );
|
ScreenOptions::AfterChangeValueOrRow( pn );
|
||||||
|
|
||||||
vector<PlayerNumber> vpns;
|
vector<PlayerNumber> vpns;
|
||||||
vpns.push_back( GAMESTATE->m_MasterPlayerNumber );
|
vpns.push_back( GAMESTATE->m_MasterPlayerNumber );
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ public:
|
|||||||
void SetCancelMessage( ScreenMessage SM_SendOnCancel ) { m_SMSendOnCancel = SM_SendOnCancel; }
|
void SetCancelMessage( ScreenMessage SM_SendOnCancel ) { m_SMSendOnCancel = SM_SendOnCancel; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void OnChange( PlayerNumber pn );
|
virtual void AfterChangeValueOrRow( PlayerNumber pn );
|
||||||
virtual void ImportOptions( int iRow, const vector<PlayerNumber> &vpns );
|
virtual void ImportOptions( int iRow, const vector<PlayerNumber> &vpns );
|
||||||
virtual void ExportOptions( int iRow, const vector<PlayerNumber> &vpns );
|
virtual void ExportOptions( int iRow, const vector<PlayerNumber> &vpns );
|
||||||
|
|
||||||
|
|||||||
@@ -314,7 +314,7 @@ void ScreenOptions::BeginScreen()
|
|||||||
UpdateEnabledDisabled();
|
UpdateEnabledDisabled();
|
||||||
|
|
||||||
FOREACH_PlayerNumber( p )
|
FOREACH_PlayerNumber( p )
|
||||||
OnChange( p );
|
AfterChangeValueOrRow( p );
|
||||||
|
|
||||||
CHECKPOINT;
|
CHECKPOINT;
|
||||||
|
|
||||||
@@ -687,7 +687,7 @@ void ScreenOptions::PositionItems()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ScreenOptions::OnChange( PlayerNumber pn )
|
void ScreenOptions::AfterChangeValueOrRow( PlayerNumber pn )
|
||||||
{
|
{
|
||||||
if( !GAMESTATE->IsHumanPlayer(pn) )
|
if( !GAMESTATE->IsHumanPlayer(pn) )
|
||||||
return;
|
return;
|
||||||
@@ -1042,7 +1042,6 @@ void ScreenOptions::ChangeValueInRow( PlayerNumber pn, int iDelta, bool Repeat )
|
|||||||
|
|
||||||
UpdateText( iCurRow );
|
UpdateText( iCurRow );
|
||||||
|
|
||||||
OnChange( pn );
|
|
||||||
this->AfterChangeValueInRow( pn );
|
this->AfterChangeValueInRow( pn );
|
||||||
|
|
||||||
if( m_OptionsNavigation != NAV_THREE_KEY_MENU )
|
if( m_OptionsNavigation != NAV_THREE_KEY_MENU )
|
||||||
@@ -1057,6 +1056,10 @@ void ScreenOptions::ChangeValueInRow( PlayerNumber pn, int iDelta, bool Repeat )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScreenOptions::AfterChangeValueInRow( PlayerNumber pn )
|
||||||
|
{
|
||||||
|
AfterChangeValueOrRow( pn );
|
||||||
|
}
|
||||||
|
|
||||||
/* Up/down */
|
/* Up/down */
|
||||||
void ScreenOptions::MoveRowRelative( PlayerNumber pn, int iDir, bool Repeat )
|
void ScreenOptions::MoveRowRelative( PlayerNumber pn, int iDir, bool Repeat )
|
||||||
@@ -1115,7 +1118,7 @@ void ScreenOptions::MoveRowRelative( PlayerNumber pn, int iDir, bool Repeat )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
OnChange( p );
|
AfterChangeRow( p );
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
if( changed )
|
if( changed )
|
||||||
@@ -1127,6 +1130,11 @@ void ScreenOptions::MoveRowRelative( PlayerNumber pn, int iDir, bool Repeat )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScreenOptions::AfterChangeRow( PlayerNumber pn )
|
||||||
|
{
|
||||||
|
AfterChangeValueOrRow( pn );
|
||||||
|
}
|
||||||
|
|
||||||
void ScreenOptions::MoveRowAbsolute( PlayerNumber pn, int iRow, bool bRepeat )
|
void ScreenOptions::MoveRowAbsolute( PlayerNumber pn, int iRow, bool bRepeat )
|
||||||
{
|
{
|
||||||
int iDir = iRow - m_iCurrentRow[pn];
|
int iDir = iRow - m_iCurrentRow[pn];
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ protected:
|
|||||||
void UpdateText( int row );
|
void UpdateText( int row );
|
||||||
void UpdateEnabledDisabled();
|
void UpdateEnabledDisabled();
|
||||||
void UpdateEnabledDisabled( int row );
|
void UpdateEnabledDisabled( int row );
|
||||||
virtual void OnChange( PlayerNumber pn );
|
|
||||||
|
|
||||||
virtual void MenuBack( PlayerNumber pn );
|
virtual void MenuBack( PlayerNumber pn );
|
||||||
virtual void MenuStart( PlayerNumber pn, const InputEventType type );
|
virtual void MenuStart( PlayerNumber pn, const InputEventType type );
|
||||||
@@ -67,9 +66,11 @@ protected:
|
|||||||
virtual void BeginFadingOut() { this->PostScreenMessage( SM_BeginFadingOut, 0 ); }
|
virtual void BeginFadingOut() { this->PostScreenMessage( SM_BeginFadingOut, 0 ); }
|
||||||
|
|
||||||
void ChangeValueInRow( PlayerNumber pn, int iDelta, bool bRepeat );
|
void ChangeValueInRow( PlayerNumber pn, int iDelta, bool bRepeat );
|
||||||
virtual void AfterChangeValueInRow( PlayerNumber pn ) {} // override this to detect when the value in a row has changed
|
virtual void AfterChangeValueInRow( PlayerNumber pn ); // override this to detect when the value in a row has changed
|
||||||
void MoveRowRelative( PlayerNumber pn, int iDir, bool bRepeat );
|
void MoveRowRelative( PlayerNumber pn, int iDir, bool bRepeat );
|
||||||
void MoveRowAbsolute( PlayerNumber pn, int iRow, bool bRepeat );
|
void MoveRowAbsolute( PlayerNumber pn, int iRow, bool bRepeat );
|
||||||
|
virtual void AfterChangeRow( PlayerNumber pn ); // override this to detect when the row has changed
|
||||||
|
virtual void AfterChangeValueOrRow( PlayerNumber pn );
|
||||||
|
|
||||||
void MenuLeft( PlayerNumber pn, const InputEventType type ) { ChangeValueInRow(pn,-1,type != IET_FIRST_PRESS); }
|
void MenuLeft( PlayerNumber pn, const InputEventType type ) { ChangeValueInRow(pn,-1,type != IET_FIRST_PRESS); }
|
||||||
void MenuRight( PlayerNumber pn, const InputEventType type ) { ChangeValueInRow(pn,+1,type != IET_FIRST_PRESS); }
|
void MenuRight( PlayerNumber pn, const InputEventType type ) { ChangeValueInRow(pn,+1,type != IET_FIRST_PRESS); }
|
||||||
|
|||||||
Reference in New Issue
Block a user