From 12c7a14dfe397fc726c9be2ff10547368ed26b65 Mon Sep 17 00:00:00 2001 From: Andrew Livy Date: Wed, 29 Apr 2009 20:59:03 +0000 Subject: [PATCH] Makes sure MenuTimer triggers start correctly if using Double Press on a ScreenSelect. --- stepmania/src/ScreenSelectMaster.cpp | 24 ++++++++++++++++++++++-- stepmania/src/ScreenSelectMaster.h | 1 + 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/stepmania/src/ScreenSelectMaster.cpp b/stepmania/src/ScreenSelectMaster.cpp index a08238ff13..760097f38c 100644 --- a/stepmania/src/ScreenSelectMaster.cpp +++ b/stepmania/src/ScreenSelectMaster.cpp @@ -80,7 +80,9 @@ void ScreenSelectMaster::Init() GetActiveElementPlayerNumbers( vpns ); #define PLAYER_APPEND_NO_SPACE(p) (SHARED_SELECTION ? RString() : ssprintf("P%d",(p)+1)) - + this->SubscribeToMessage( SM_MenuTimer ); + + // init cursor if( SHOW_CURSOR ) { @@ -229,6 +231,8 @@ void ScreenSelectMaster::Init() } } } + + m_bDoubleChoiceNoSound = true; } RString ScreenSelectMaster::GetDefaultChoice() @@ -308,10 +312,26 @@ void ScreenSelectMaster::HandleScreenMessage( const ScreenMessage SM ) int iChoice = m_iChoice[*p]; m_vsprScroll[*p][iChoice]->HandleMessage( msg ); } + + } m_fLockInputSecs = POST_SWITCH_PAGE_SECONDS; } + else if( SM == SM_MenuTimer ) + { + if(DOUBLE_PRESS_TO_SELECT) + { + FOREACH_HumanPlayer(p) + { + m_bDoubleChoice[p] = true; + InputEventPlus iep; + iep.pn = p; + MenuStart( iep ); + } + } + + } } int ScreenSelectMaster::GetSelectionIndex( PlayerNumber pn ) @@ -780,7 +800,7 @@ void ScreenSelectMaster::MenuStart( const InputEventPlus &input ) SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo(ssprintf("%s comment %s",m_sName.c_str(), mc.m_sName.c_str())) ); /* Play a copy of the sound, so it'll finish playing even if we leave the screen immediately. */ - if( mc.m_sSoundPath.empty() ) + if( mc.m_sSoundPath.empty() && !m_bDoubleChoiceNoSound ) m_soundStart.PlayCopy(); if( mc.m_sScreen.empty() ) diff --git a/stepmania/src/ScreenSelectMaster.h b/stepmania/src/ScreenSelectMaster.h index 598909a442..346544f07b 100644 --- a/stepmania/src/ScreenSelectMaster.h +++ b/stepmania/src/ScreenSelectMaster.h @@ -100,6 +100,7 @@ protected: int m_iChoice[NUM_PLAYERS]; bool m_bChosen[NUM_PLAYERS]; bool m_bDoubleChoice[NUM_PLAYERS]; + bool m_bDoubleChoiceNoSound; GameButton m_TrackingRepeatingInput; };