add AllowRepeatingInput

This commit is contained in:
Chris Danford
2005-04-04 02:34:56 +00:00
parent 6d2f449bcf
commit 446c8cb5ae
4 changed files with 78 additions and 58 deletions
+2
View File
@@ -63,6 +63,7 @@ ChoiceNames=1,2,3,4,5,6,7
DefaultChoice=1 DefaultChoice=1
NumChoicesOnPage1=100 NumChoicesOnPage1=100
WrapCursor=1 WrapCursor=1
AllowRepeatingInput=1
Choice1=@"ApplyDefaultOptions;screen,"..ScreenCautionBranch() Choice1=@"ApplyDefaultOptions;screen,"..ScreenCautionBranch()
Choice2=screen,ScreenSelectGame Choice2=screen,ScreenSelectGame
Choice3=screen,ScreenOptionsMenu Choice3=screen,ScreenOptionsMenu
@@ -2924,6 +2925,7 @@ AttackDurationSeconds=10
Fallback=ScreenSelect Fallback=ScreenSelect
Class=ScreenSelectMaster Class=ScreenSelectMaster
WrapCursor=0 WrapCursor=0
AllowRepeatingInput=0
PreSwitchPageSeconds=0 PreSwitchPageSeconds=0
PostSwitchPageSeconds=0 PostSwitchPageSeconds=0
ScrollerSecondsPerItem=0 ScrollerSecondsPerItem=0
+21 -4
View File
@@ -38,6 +38,7 @@ ScreenSelectMaster::ScreenSelectMaster( CString sClassName ) : ScreenSelect( sCl
SLEEP_AFTER_TWEEN_OFF_SECONDS(m_sName,"SleepAfterTweenOffSeconds"), SLEEP_AFTER_TWEEN_OFF_SECONDS(m_sName,"SleepAfterTweenOffSeconds"),
OPTION_ORDER(m_sName,OPTION_ORDER_NAME,NUM_MENU_DIRS), OPTION_ORDER(m_sName,OPTION_ORDER_NAME,NUM_MENU_DIRS),
WRAP_CURSOR(m_sName,"WrapCursor"), WRAP_CURSOR(m_sName,"WrapCursor"),
ALLOW_REPEATING_INPUT(m_sName,"AllowRepeatingInput"),
SHOW_SCROLLER(m_sName,"ShowScroller"), SHOW_SCROLLER(m_sName,"ShowScroller"),
SCROLLER_SECONDS_PER_ITEM(m_sName,"ScrollerSecondsPerItem"), SCROLLER_SECONDS_PER_ITEM(m_sName,"ScrollerSecondsPerItem"),
SCROLLER_NUM_ITEMS_TO_DRAW(m_sName,"ScrollerNumItemsToDraw"), SCROLLER_NUM_ITEMS_TO_DRAW(m_sName,"ScrollerNumItemsToDraw"),
@@ -391,34 +392,50 @@ bool ScreenSelectMaster::Move( PlayerNumber pn, MenuDir dir )
return ChangeSelection( pn, iSwitchToIndex ); return ChangeSelection( pn, iSwitchToIndex );
} }
void ScreenSelectMaster::MenuLeft( PlayerNumber pn ) void ScreenSelectMaster::MenuLeft( PlayerNumber pn, const InputEventType type )
{ {
if( m_fLockInputSecs > 0 || m_bChosen[pn] ) if( m_fLockInputSecs > 0 || m_bChosen[pn] )
return; return;
if( type == IET_RELEASE )
return;
if( !ALLOW_REPEATING_INPUT && type != IET_FIRST_PRESS )
return;
if( Move(pn, MENU_DIR_LEFT) ) if( Move(pn, MENU_DIR_LEFT) )
m_soundChange.Play(); m_soundChange.Play();
} }
void ScreenSelectMaster::MenuRight( PlayerNumber pn ) void ScreenSelectMaster::MenuRight( PlayerNumber pn, const InputEventType type )
{ {
if( m_fLockInputSecs > 0 || m_bChosen[pn] ) if( m_fLockInputSecs > 0 || m_bChosen[pn] )
return; return;
if( type == IET_RELEASE )
return;
if( !ALLOW_REPEATING_INPUT && type != IET_FIRST_PRESS )
return;
if( Move(pn, MENU_DIR_RIGHT) ) if( Move(pn, MENU_DIR_RIGHT) )
m_soundChange.Play(); m_soundChange.Play();
} }
void ScreenSelectMaster::MenuUp( PlayerNumber pn ) void ScreenSelectMaster::MenuUp( PlayerNumber pn, const InputEventType type )
{ {
if( m_fLockInputSecs > 0 || m_bChosen[pn] ) if( m_fLockInputSecs > 0 || m_bChosen[pn] )
return; return;
if( type == IET_RELEASE )
return;
if( !ALLOW_REPEATING_INPUT && type != IET_FIRST_PRESS )
return;
if( Move(pn, MENU_DIR_UP) ) if( Move(pn, MENU_DIR_UP) )
m_soundChange.Play(); m_soundChange.Play();
} }
void ScreenSelectMaster::MenuDown( PlayerNumber pn ) void ScreenSelectMaster::MenuDown( PlayerNumber pn, const InputEventType type )
{ {
if( m_fLockInputSecs > 0 || m_bChosen[pn] ) if( m_fLockInputSecs > 0 || m_bChosen[pn] )
return; return;
if( type == IET_RELEASE )
return;
if( !ALLOW_REPEATING_INPUT && type != IET_FIRST_PRESS )
return;
if( Move(pn, MENU_DIR_DOWN) ) if( Move(pn, MENU_DIR_DOWN) )
m_soundChange.Play(); m_soundChange.Play();
} }
+5 -4
View File
@@ -22,10 +22,10 @@ public:
virtual void Update( float fDelta ); virtual void Update( float fDelta );
virtual void MenuLeft( PlayerNumber pn ); virtual void MenuLeft( PlayerNumber pn, const InputEventType type );
virtual void MenuRight( PlayerNumber pn ); virtual void MenuRight( PlayerNumber pn, const InputEventType type );
virtual void MenuUp( PlayerNumber pn ); virtual void MenuUp( PlayerNumber pn, const InputEventType type );
virtual void MenuDown( PlayerNumber pn ); virtual void MenuDown( PlayerNumber pn, const InputEventType type );
virtual void MenuStart( PlayerNumber pn ); virtual void MenuStart( PlayerNumber pn );
void TweenOffScreen(); void TweenOffScreen();
void TweenOnScreen(); void TweenOnScreen();
@@ -52,6 +52,7 @@ protected:
ThemeMetric<float> SLEEP_AFTER_TWEEN_OFF_SECONDS; ThemeMetric<float> SLEEP_AFTER_TWEEN_OFF_SECONDS;
ThemeMetric1D<CString> OPTION_ORDER; ThemeMetric1D<CString> OPTION_ORDER;
ThemeMetric<bool> WRAP_CURSOR; ThemeMetric<bool> WRAP_CURSOR;
ThemeMetric<bool> ALLOW_REPEATING_INPUT;
ThemeMetric<bool> SHOW_SCROLLER; ThemeMetric<bool> SHOW_SCROLLER;
ThemeMetric<float> SCROLLER_SECONDS_PER_ITEM; ThemeMetric<float> SCROLLER_SECONDS_PER_ITEM;
ThemeMetric<float> SCROLLER_NUM_ITEMS_TO_DRAW; ThemeMetric<float> SCROLLER_NUM_ITEMS_TO_DRAW;
+49 -49
View File
@@ -112,63 +112,63 @@ void ScreenTitleMenu::Input( const DeviceInput& DeviceI, const InputEventType ty
{ {
LOG->Trace( "ScreenTitleMenu::Input( %d-%d )", DeviceI.device, DeviceI.button ); // debugging gameport joystick problem LOG->Trace( "ScreenTitleMenu::Input( %d-%d )", DeviceI.device, DeviceI.button ); // debugging gameport joystick problem
if( type != IET_FIRST_PRESS ) if( type == IET_FIRST_PRESS )
return;
/* If the CoinMode was changed, we need to reload this screen
* so that the right m_aGameCommands will show */
if( ScreenAttract::ChangeCoinModeInput( DeviceI, type, GameI, MenuI, StyleI ) )
{ {
SCREENMAN->SetNewScreen( COIN_MODE_CHANGE_SCREEN ); /* If the CoinMode was changed, we need to reload this screen
return; * so that the right m_aGameCommands will show */
} if( ScreenAttract::ChangeCoinModeInput( DeviceI, type, GameI, MenuI, StyleI ) )
{
SCREENMAN->SetNewScreen( COIN_MODE_CHANGE_SCREEN );
return;
}
if( m_In.IsTransitioning() || m_Cancel.IsTransitioning() ) /* not m_Out */ if( m_In.IsTransitioning() || m_Cancel.IsTransitioning() ) /* not m_Out */
return; return;
// //
// detect codes // detect codes
// //
if( CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_THEME) || if( CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_THEME) ||
CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_THEME2) ) CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_THEME2) )
{ {
THEME->NextTheme(); THEME->NextTheme();
ApplyGraphicOptions(); // update window title and icon ApplyGraphicOptions(); // update window title and icon
SCREENMAN->SystemMessage( "Theme: "+THEME->GetCurThemeName() ); SCREENMAN->SystemMessage( "Theme: "+THEME->GetCurThemeName() );
SCREENMAN->SetNewScreen( m_sName ); SCREENMAN->SetNewScreen( m_sName );
TEXTUREMAN->DoDelayedDelete(); TEXTUREMAN->DoDelayedDelete();
} }
if( CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_ANNOUNCER) || if( CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_ANNOUNCER) ||
CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_ANNOUNCER2) ) CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_ANNOUNCER2) )
{ {
ANNOUNCER->NextAnnouncer(); ANNOUNCER->NextAnnouncer();
CString sName = ANNOUNCER->GetCurAnnouncerName(); CString sName = ANNOUNCER->GetCurAnnouncerName();
if( sName=="" ) sName = "(none)"; if( sName=="" ) sName = "(none)";
SCREENMAN->SystemMessage( "Announcer: "+sName ); SCREENMAN->SystemMessage( "Announcer: "+sName );
SCREENMAN->SetNewScreen( m_sName ); SCREENMAN->SetNewScreen( m_sName );
} }
if( CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_GAME) || if( CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_GAME) ||
CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_GAME2) ) CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_GAME2) )
{ {
vector<const Game*> vGames; vector<const Game*> vGames;
GAMEMAN->GetEnabledGames( vGames ); GAMEMAN->GetEnabledGames( vGames );
ASSERT( !vGames.empty() ); ASSERT( !vGames.empty() );
vector<const Game*>::iterator iter = find(vGames.begin(),vGames.end(),GAMESTATE->m_pCurGame); vector<const Game*>::iterator iter = find(vGames.begin(),vGames.end(),GAMESTATE->m_pCurGame);
ASSERT( iter != vGames.end() ); ASSERT( iter != vGames.end() );
iter++; // move to the next game iter++; // move to the next game
// wrap // wrap
if( iter == vGames.end() ) if( iter == vGames.end() )
iter = vGames.begin(); iter = vGames.begin();
GAMESTATE->m_pCurGame = *iter; GAMESTATE->m_pCurGame = *iter;
/* Reload the theme if it's changed, but don't back to the initial screen. */ /* Reload the theme if it's changed, but don't back to the initial screen. */
ResetGame( false ); ResetGame( false );
SCREENMAN->SystemMessage( CString("Game: ") + GAMESTATE->GetCurrentGame()->m_szName ); SCREENMAN->SystemMessage( CString("Game: ") + GAMESTATE->GetCurrentGame()->m_szName );
SCREENMAN->SetNewScreen( m_sName ); SCREENMAN->SetNewScreen( m_sName );
}
} }
ScreenSelectMaster::Input( DeviceI, type, GameI, MenuI, StyleI ); ScreenSelectMaster::Input( DeviceI, type, GameI, MenuI, StyleI );