add AllowRepeatingInput
This commit is contained in:
@@ -63,6 +63,7 @@ ChoiceNames=1,2,3,4,5,6,7
|
||||
DefaultChoice=1
|
||||
NumChoicesOnPage1=100
|
||||
WrapCursor=1
|
||||
AllowRepeatingInput=1
|
||||
Choice1=@"ApplyDefaultOptions;screen,"..ScreenCautionBranch()
|
||||
Choice2=screen,ScreenSelectGame
|
||||
Choice3=screen,ScreenOptionsMenu
|
||||
@@ -2924,6 +2925,7 @@ AttackDurationSeconds=10
|
||||
Fallback=ScreenSelect
|
||||
Class=ScreenSelectMaster
|
||||
WrapCursor=0
|
||||
AllowRepeatingInput=0
|
||||
PreSwitchPageSeconds=0
|
||||
PostSwitchPageSeconds=0
|
||||
ScrollerSecondsPerItem=0
|
||||
|
||||
@@ -38,6 +38,7 @@ ScreenSelectMaster::ScreenSelectMaster( CString sClassName ) : ScreenSelect( sCl
|
||||
SLEEP_AFTER_TWEEN_OFF_SECONDS(m_sName,"SleepAfterTweenOffSeconds"),
|
||||
OPTION_ORDER(m_sName,OPTION_ORDER_NAME,NUM_MENU_DIRS),
|
||||
WRAP_CURSOR(m_sName,"WrapCursor"),
|
||||
ALLOW_REPEATING_INPUT(m_sName,"AllowRepeatingInput"),
|
||||
SHOW_SCROLLER(m_sName,"ShowScroller"),
|
||||
SCROLLER_SECONDS_PER_ITEM(m_sName,"ScrollerSecondsPerItem"),
|
||||
SCROLLER_NUM_ITEMS_TO_DRAW(m_sName,"ScrollerNumItemsToDraw"),
|
||||
@@ -391,34 +392,50 @@ bool ScreenSelectMaster::Move( PlayerNumber pn, MenuDir dir )
|
||||
return ChangeSelection( pn, iSwitchToIndex );
|
||||
}
|
||||
|
||||
void ScreenSelectMaster::MenuLeft( PlayerNumber pn )
|
||||
void ScreenSelectMaster::MenuLeft( PlayerNumber pn, const InputEventType type )
|
||||
{
|
||||
if( m_fLockInputSecs > 0 || m_bChosen[pn] )
|
||||
return;
|
||||
if( type == IET_RELEASE )
|
||||
return;
|
||||
if( !ALLOW_REPEATING_INPUT && type != IET_FIRST_PRESS )
|
||||
return;
|
||||
if( Move(pn, MENU_DIR_LEFT) )
|
||||
m_soundChange.Play();
|
||||
}
|
||||
|
||||
void ScreenSelectMaster::MenuRight( PlayerNumber pn )
|
||||
void ScreenSelectMaster::MenuRight( PlayerNumber pn, const InputEventType type )
|
||||
{
|
||||
if( m_fLockInputSecs > 0 || m_bChosen[pn] )
|
||||
return;
|
||||
if( type == IET_RELEASE )
|
||||
return;
|
||||
if( !ALLOW_REPEATING_INPUT && type != IET_FIRST_PRESS )
|
||||
return;
|
||||
if( Move(pn, MENU_DIR_RIGHT) )
|
||||
m_soundChange.Play();
|
||||
}
|
||||
|
||||
void ScreenSelectMaster::MenuUp( PlayerNumber pn )
|
||||
void ScreenSelectMaster::MenuUp( PlayerNumber pn, const InputEventType type )
|
||||
{
|
||||
if( m_fLockInputSecs > 0 || m_bChosen[pn] )
|
||||
return;
|
||||
if( type == IET_RELEASE )
|
||||
return;
|
||||
if( !ALLOW_REPEATING_INPUT && type != IET_FIRST_PRESS )
|
||||
return;
|
||||
if( Move(pn, MENU_DIR_UP) )
|
||||
m_soundChange.Play();
|
||||
}
|
||||
|
||||
void ScreenSelectMaster::MenuDown( PlayerNumber pn )
|
||||
void ScreenSelectMaster::MenuDown( PlayerNumber pn, const InputEventType type )
|
||||
{
|
||||
if( m_fLockInputSecs > 0 || m_bChosen[pn] )
|
||||
return;
|
||||
if( type == IET_RELEASE )
|
||||
return;
|
||||
if( !ALLOW_REPEATING_INPUT && type != IET_FIRST_PRESS )
|
||||
return;
|
||||
if( Move(pn, MENU_DIR_DOWN) )
|
||||
m_soundChange.Play();
|
||||
}
|
||||
|
||||
@@ -22,10 +22,10 @@ public:
|
||||
|
||||
virtual void Update( float fDelta );
|
||||
|
||||
virtual void MenuLeft( PlayerNumber pn );
|
||||
virtual void MenuRight( PlayerNumber pn );
|
||||
virtual void MenuUp( PlayerNumber pn );
|
||||
virtual void MenuDown( PlayerNumber pn );
|
||||
virtual void MenuLeft( PlayerNumber pn, const InputEventType type );
|
||||
virtual void MenuRight( PlayerNumber pn, const InputEventType type );
|
||||
virtual void MenuUp( PlayerNumber pn, const InputEventType type );
|
||||
virtual void MenuDown( PlayerNumber pn, const InputEventType type );
|
||||
virtual void MenuStart( PlayerNumber pn );
|
||||
void TweenOffScreen();
|
||||
void TweenOnScreen();
|
||||
@@ -52,6 +52,7 @@ protected:
|
||||
ThemeMetric<float> SLEEP_AFTER_TWEEN_OFF_SECONDS;
|
||||
ThemeMetric1D<CString> OPTION_ORDER;
|
||||
ThemeMetric<bool> WRAP_CURSOR;
|
||||
ThemeMetric<bool> ALLOW_REPEATING_INPUT;
|
||||
ThemeMetric<bool> SHOW_SCROLLER;
|
||||
ThemeMetric<float> SCROLLER_SECONDS_PER_ITEM;
|
||||
ThemeMetric<float> SCROLLER_NUM_ITEMS_TO_DRAW;
|
||||
|
||||
@@ -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
|
||||
|
||||
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 ) )
|
||||
if( type == IET_FIRST_PRESS )
|
||||
{
|
||||
SCREENMAN->SetNewScreen( COIN_MODE_CHANGE_SCREEN );
|
||||
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 );
|
||||
return;
|
||||
}
|
||||
|
||||
if( m_In.IsTransitioning() || m_Cancel.IsTransitioning() ) /* not m_Out */
|
||||
return;
|
||||
|
||||
//
|
||||
// detect codes
|
||||
//
|
||||
if( CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_THEME) ||
|
||||
CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_THEME2) )
|
||||
{
|
||||
THEME->NextTheme();
|
||||
ApplyGraphicOptions(); // update window title and icon
|
||||
SCREENMAN->SystemMessage( "Theme: "+THEME->GetCurThemeName() );
|
||||
SCREENMAN->SetNewScreen( m_sName );
|
||||
TEXTUREMAN->DoDelayedDelete();
|
||||
}
|
||||
if( CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_ANNOUNCER) ||
|
||||
CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_ANNOUNCER2) )
|
||||
{
|
||||
ANNOUNCER->NextAnnouncer();
|
||||
CString sName = ANNOUNCER->GetCurAnnouncerName();
|
||||
if( sName=="" ) sName = "(none)";
|
||||
SCREENMAN->SystemMessage( "Announcer: "+sName );
|
||||
SCREENMAN->SetNewScreen( m_sName );
|
||||
}
|
||||
if( CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_GAME) ||
|
||||
CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_GAME2) )
|
||||
{
|
||||
vector<const Game*> vGames;
|
||||
GAMEMAN->GetEnabledGames( vGames );
|
||||
ASSERT( !vGames.empty() );
|
||||
vector<const Game*>::iterator iter = find(vGames.begin(),vGames.end(),GAMESTATE->m_pCurGame);
|
||||
ASSERT( iter != vGames.end() );
|
||||
if( m_In.IsTransitioning() || m_Cancel.IsTransitioning() ) /* not m_Out */
|
||||
return;
|
||||
|
||||
//
|
||||
// detect codes
|
||||
//
|
||||
if( CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_THEME) ||
|
||||
CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_THEME2) )
|
||||
{
|
||||
THEME->NextTheme();
|
||||
ApplyGraphicOptions(); // update window title and icon
|
||||
SCREENMAN->SystemMessage( "Theme: "+THEME->GetCurThemeName() );
|
||||
SCREENMAN->SetNewScreen( m_sName );
|
||||
TEXTUREMAN->DoDelayedDelete();
|
||||
}
|
||||
if( CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_ANNOUNCER) ||
|
||||
CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_ANNOUNCER2) )
|
||||
{
|
||||
ANNOUNCER->NextAnnouncer();
|
||||
CString sName = ANNOUNCER->GetCurAnnouncerName();
|
||||
if( sName=="" ) sName = "(none)";
|
||||
SCREENMAN->SystemMessage( "Announcer: "+sName );
|
||||
SCREENMAN->SetNewScreen( m_sName );
|
||||
}
|
||||
if( CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_GAME) ||
|
||||
CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_GAME2) )
|
||||
{
|
||||
vector<const Game*> vGames;
|
||||
GAMEMAN->GetEnabledGames( vGames );
|
||||
ASSERT( !vGames.empty() );
|
||||
vector<const Game*>::iterator iter = find(vGames.begin(),vGames.end(),GAMESTATE->m_pCurGame);
|
||||
ASSERT( iter != vGames.end() );
|
||||
|
||||
iter++; // move to the next game
|
||||
iter++; // move to the next game
|
||||
|
||||
// wrap
|
||||
if( iter == vGames.end() )
|
||||
iter = vGames.begin();
|
||||
// wrap
|
||||
if( iter == vGames.end() )
|
||||
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. */
|
||||
ResetGame( false );
|
||||
/* Reload the theme if it's changed, but don't back to the initial screen. */
|
||||
ResetGame( false );
|
||||
|
||||
SCREENMAN->SystemMessage( CString("Game: ") + GAMESTATE->GetCurrentGame()->m_szName );
|
||||
SCREENMAN->SetNewScreen( m_sName );
|
||||
SCREENMAN->SystemMessage( CString("Game: ") + GAMESTATE->GetCurrentGame()->m_szName );
|
||||
SCREENMAN->SetNewScreen( m_sName );
|
||||
}
|
||||
}
|
||||
|
||||
ScreenSelectMaster::Input( DeviceI, type, GameI, MenuI, StyleI );
|
||||
|
||||
Reference in New Issue
Block a user