Simplify.

This commit is contained in:
Steve Checkoway
2006-08-10 06:39:08 +00:00
parent c82810b12b
commit 547920b6cd
7 changed files with 24 additions and 44 deletions
+2 -10
View File
@@ -634,11 +634,8 @@ void ScreenNameEntryTraditional::UpdateSelectionText( int pn )
m_textSelection[pn].SetText( WStringToRString(text) ); m_textSelection[pn].SetText( WStringToRString(text) );
} }
void ScreenNameEntryTraditional::MenuStart( const InputEventPlus &input ) void ScreenNameEntryTraditional::MenuStart( PlayerNumber pn )
{ {
if( input.type != IET_FIRST_PRESS )
return; // ignore
HandleStart( input.MenuI.player ); HandleStart( input.MenuI.player );
} }
@@ -686,15 +683,10 @@ void ScreenNameEntryTraditional::HandleStart( PlayerNumber pn )
} }
} }
void ScreenNameEntryTraditional::MenuSelect( const InputEventPlus &input ) void ScreenNameEntryTraditional::MenuSelect( PlayerNumber pn )
{ {
PlayerNumber pn = input.MenuI.player;
if( !m_bStillEnteringName[pn] ) if( !m_bStillEnteringName[pn] )
return; // ignore return; // ignore
if( input.type != IET_FIRST_PRESS )
return; // ignore
Backspace( pn ); Backspace( pn );
} }
+2 -2
View File
@@ -51,8 +51,8 @@ public:
void HandleScreenMessage( const ScreenMessage SM ); void HandleScreenMessage( const ScreenMessage SM );
void Input( const InputEventPlus &input ); void Input( const InputEventPlus &input );
void MenuStart( const InputEventPlus &input ); void MenuStart( PlayerNumber pn );
void MenuSelect( const InputEventPlus &input ); void MenuSelect( PlayerNumber pn );
void MenuLeft( const InputEventPlus &input ); void MenuLeft( const InputEventPlus &input );
void MenuRight( const InputEventPlus &input ); void MenuRight( const InputEventPlus &input );
+6 -12
View File
@@ -318,35 +318,29 @@ done:
ScreenNetSelectBase::HandleScreenMessage( SM ); ScreenNetSelectBase::HandleScreenMessage( SM );
} }
void ScreenNetSelectMusic::MenuLeft( const InputEventPlus &input ) void ScreenNetSelectMusic::MenuLeft( PlayerNumber pn )
{ {
bool bLeftPressed = INPUTMAPPER->IsButtonDown( MenuInput(input.MenuI.player, MENU_BUTTON_LEFT) ); bool bLeftPressed = INPUTMAPPER->IsButtonDown( MenuInput(pn, MENU_BUTTON_LEFT) );
bool bRightPressed = INPUTMAPPER->IsButtonDown( MenuInput(input.MenuI.player, MENU_BUTTON_RIGHT) ); bool bRightPressed = INPUTMAPPER->IsButtonDown( MenuInput(pn, MENU_BUTTON_RIGHT) );
bool bLeftAndRightPressed = bLeftPressed && bRightPressed; bool bLeftAndRightPressed = bLeftPressed && bRightPressed;
if( input.type == IET_FIRST_PRESS )
{
if ( bLeftAndRightPressed ) if ( bLeftAndRightPressed )
m_MusicWheel.ChangeSort( SORT_MODE_MENU ); m_MusicWheel.ChangeSort( SORT_MODE_MENU );
else else
m_MusicWheel.Move( -1 ); m_MusicWheel.Move( -1 );
} }
}
void ScreenNetSelectMusic::MenuRight( const InputEventPlus &input ) void ScreenNetSelectMusic::MenuRight( PlayerNumber pn )
{ {
bool bLeftPressed = INPUTMAPPER->IsButtonDown( MenuInput (input.MenuI.player, MENU_BUTTON_LEFT) ); bool bLeftPressed = INPUTMAPPER->IsButtonDown( MenuInput (pn, MENU_BUTTON_LEFT) );
bool bRightPressed = INPUTMAPPER->IsButtonDown( MenuInput(input.MenuI.player, MENU_BUTTON_RIGHT) ) ; bool bRightPressed = INPUTMAPPER->IsButtonDown( MenuInput(pn, MENU_BUTTON_RIGHT) ) ;
bool bLeftAndRightPressed = bLeftPressed && bRightPressed; bool bLeftAndRightPressed = bLeftPressed && bRightPressed;
if( input.type == IET_FIRST_PRESS )
{
if ( bLeftAndRightPressed ) if ( bLeftAndRightPressed )
m_MusicWheel.ChangeSort( SORT_MODE_MENU ); m_MusicWheel.ChangeSort( SORT_MODE_MENU );
else else
m_MusicWheel.Move( +1 ); m_MusicWheel.Move( +1 );
} }
}
void ScreenNetSelectMusic::MenuUp( const InputEventPlus &input ) void ScreenNetSelectMusic::MenuUp( const InputEventPlus &input )
{ {
+2 -2
View File
@@ -52,10 +52,10 @@ private:
protected: protected:
virtual void MenuStart( PlayerNumber pn ); virtual void MenuStart( PlayerNumber pn );
virtual void MenuLeft( const InputEventPlus &input ); virtual void MenuLeft( PlayerNumber pn );
virtual void MenuUp( const InputEventPlus &input ); virtual void MenuUp( const InputEventPlus &input );
virtual void MenuDown( const InputEventPlus &input ); virtual void MenuDown( const InputEventPlus &input );
virtual void MenuRight( const InputEventPlus &input ); virtual void MenuRight( PlayerNumber pn );
virtual void MenuBack( PlayerNumber pn ); virtual void MenuBack( PlayerNumber pn );
virtual void Update( float fDeltaTime ); virtual void Update( float fDeltaTime );
-3
View File
@@ -145,8 +145,6 @@ void ScreenNetworkOptions::HandleScreenMessage( const ScreenMessage SM )
void ScreenNetworkOptions::MenuStart( const InputEventPlus &input ) void ScreenNetworkOptions::MenuStart( const InputEventPlus &input )
{ {
#if defined( WITHOUT_NETWORKING )
#else
switch( GetCurrentRow() ) switch( GetCurrentRow() )
{ {
case PO_CONNECTION: case PO_CONNECTION:
@@ -201,7 +199,6 @@ void ScreenNetworkOptions::MenuStart( const InputEventPlus &input )
default: default:
ScreenOptions::MenuStart( input ); ScreenOptions::MenuStart( input );
} }
#endif
} }
void ScreenNetworkOptions::ImportOptions( int iRow, const vector<PlayerNumber> &vpns ) { } void ScreenNetworkOptions::ImportOptions( int iRow, const vector<PlayerNumber> &vpns ) { }
+1 -4
View File
@@ -72,13 +72,10 @@ void ScreenOptionsEditCourseSubMenu::Init()
ScreenOptions::Init(); ScreenOptions::Init();
} }
void ScreenOptionsEditCourseSubMenu::MenuSelect( const InputEventPlus &input ) void ScreenOptionsEditCourseSubMenu::MenuSelect( PlayerNumber pn )
{
if( input.type == IET_FIRST_PRESS )
{ {
SetNextCombination(); SetNextCombination();
m_soundDifficultyChanged.Play(); m_soundDifficultyChanged.Play();
}
} }
+1 -1
View File
@@ -15,7 +15,7 @@ public:
virtual void Init(); virtual void Init();
protected: protected:
virtual void MenuSelect( const InputEventPlus &input ); virtual void MenuSelect( PlayerNumber pn );
void WriteCourse(); void WriteCourse();
}; };