From 83c0c4dda556af96e29182b0cc60b034b0037c21 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Fri, 14 May 2004 07:14:45 +0000 Subject: [PATCH] make Start exit ScreenEnding --- stepmania/src/ScreenEnding.cpp | 32 ++++++++++++++++++++++++-------- stepmania/src/ScreenEnding.h | 1 + 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/stepmania/src/ScreenEnding.cpp b/stepmania/src/ScreenEnding.cpp index d6eace8399..a6fd61575d 100644 --- a/stepmania/src/ScreenEnding.cpp +++ b/stepmania/src/ScreenEnding.cpp @@ -26,6 +26,7 @@ #include "StyleDef.h" #include "GameManager.h" #include "SongUtil.h" +#include "ScreenManager.h" #define SCROLL_DELAY THEME->GetMetricF("ScreenEnding","ScrollDelay") @@ -137,20 +138,35 @@ void ScreenEnding::Update( float fDeltaTime ) { ScreenAttract::Update( fDeltaTime ); - if( !m_In.IsTransitioning() && !m_Out.IsTransitioning() ) + if( m_In.IsTransitioning() && m_Out.IsTransitioning() ) + return; + + FOREACH_PlayerNumber( p ) { - FOREACH_PlayerNumber( p ) + if( m_bWaitingForRemoveCard[p] ) { - if( m_bWaitingForRemoveCard[p] ) - { - m_bWaitingForRemoveCard[p] = MEMCARDMAN->GetCardState((PlayerNumber)p)!=MEMORY_CARD_STATE_NO_CARD; - if( !m_bWaitingForRemoveCard[p] ) - m_sprRemoveMemoryCard[p].SetHidden( true ); - } + m_bWaitingForRemoveCard[p] = MEMCARDMAN->GetCardState((PlayerNumber)p)!=MEMORY_CARD_STATE_NO_CARD; + if( !m_bWaitingForRemoveCard[p] ) + m_sprRemoveMemoryCard[p].SetHidden( true ); } } } +void ScreenEnding::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI ) +{ + if( MenuI.IsValid() ) + { + switch( MenuI.button ) + { + case MENU_BUTTON_START: + SCREENMAN->PostMessageToTopScreen( SM_BeginFadingOut, 0 ); + break; + } + } + + ScreenAttract::Input( DeviceI, type, GameI, MenuI, StyleI ); +} + void ScreenEnding::HandleScreenMessage( const ScreenMessage SM ) { ScreenAttract::HandleScreenMessage( SM ); diff --git a/stepmania/src/ScreenEnding.h b/stepmania/src/ScreenEnding.h index 9b66343f3b..acd6075155 100644 --- a/stepmania/src/ScreenEnding.h +++ b/stepmania/src/ScreenEnding.h @@ -29,6 +29,7 @@ public: ~ScreenEnding(); void Update( float fDeltaTime ); + virtual void Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI ); void HandleScreenMessage( const ScreenMessage SM ); private: