From f04507a017ba2919f1488c577b0435af7da4b22f Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 17 Mar 2003 04:17:30 +0000 Subject: [PATCH] don't trap users in the jukebox also, the jukebox could be used as an alternate "attract sequence", so let's handle the attract coin logic there, too --- stepmania/src/ScreenJukebox.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/stepmania/src/ScreenJukebox.cpp b/stepmania/src/ScreenJukebox.cpp index d8f33f0129..decefdc1fb 100644 --- a/stepmania/src/ScreenJukebox.cpp +++ b/stepmania/src/ScreenJukebox.cpp @@ -160,11 +160,33 @@ void ScreenJukebox::Input( const DeviceInput& DeviceI, const InputEventType type { switch( MenuI.button ) { - case MENU_BUTTON_START: case MENU_BUTTON_LEFT: case MENU_BUTTON_RIGHT: SCREENMAN->SendMessageToTopScreen( SM_NotesEnded, 0 ); break; + /* XXX: this is a copy-and-paste from ScreenAttract */ + case MENU_BUTTON_START: + case MENU_BUTTON_BACK: + case MENU_BUTTON_COIN: + switch( PREFSMAN->m_CoinMode ) + { + case PrefsManager::COIN_PAY: + if( GAMESTATE->m_iCoins < PREFSMAN->m_iCoinsPerCredit ) + break; // don't fall through + // fall through + case PrefsManager::COIN_FREE: + case PrefsManager::COIN_HOME: + SOUNDMAN->StopMusic(); + /* We already played the it was a coin was inserted. Don't play it again. */ + if( MenuI.button != MENU_BUTTON_COIN ) + SOUNDMAN->PlayOnce( THEME->GetPathTo("Sounds","Common coin") ); + SDL_Delay( 800 ); // do a little pause, like the arcade does + SCREENMAN->SetNewScreen( "ScreenTitleMenu" ); + break; + default: + ASSERT(0); + } + break; } } }