From d4417b02609887587d6eb46d7884e0c353df7399 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Fri, 14 Mar 2003 22:34:28 +0000 Subject: [PATCH] Fix ScreenJukebox, ScreenMusicScroll --- .../ScreenCompany background/white.png | Bin 1198 -> 1205 bytes .../BGAnimations/ScreenJukeboxMenu in.redir | 1 + .../BGAnimations/ScreenJukeboxMenu out.redir | 1 + .../BGAnimations/ScreenSelectGame in.redir | 2 +- stepmania/src/JukeboxMenu.cpp | 6 +- stepmania/src/ScreenEditMenu.cpp | 2 +- stepmania/src/ScreenEvaluation.cpp | 1 - stepmania/src/ScreenGameplay.cpp | 11 ++-- stepmania/src/ScreenJukebox.cpp | 53 +----------------- stepmania/src/ScreenJukeboxMenu.cpp | 2 +- stepmania/src/ScreenMusicScroll.cpp | 28 +++++---- stepmania/src/ScreenMusicScroll.h | 13 +++-- 12 files changed, 39 insertions(+), 81 deletions(-) create mode 100644 stepmania/Themes/default/BGAnimations/ScreenJukeboxMenu in.redir create mode 100644 stepmania/Themes/default/BGAnimations/ScreenJukeboxMenu out.redir diff --git a/stepmania/Themes/default/BGAnimations/ScreenCompany background/white.png b/stepmania/Themes/default/BGAnimations/ScreenCompany background/white.png index fd0b87f5c569c01362bf51d03c622435f4e58eb1..0d193e1f7f6c52cc3f9832a07a22d1d212fb5cd1 100644 GIT binary patch delta 83 zcmZ3-xs_9~Gr-TCmrII^fq{Y7)59eQNHc*j2Q!d#&G;*}Q89-_L)g>BF{I*FQbGy~ fhXR|MTLS}7T8M#l)28RVKy?hBu6{1-oD!MGetPathTo("Graphics",ssprintf("jukebox menu %s",(i==0?"left":"right"))) ); + m_sprArrows[i].Load( THEME->GetPathTo("Graphics",ssprintf("JukeboxMenu %s",(i==0?"left":"right"))) ); m_sprArrows[i].SetX( ARROWS_X(i) ); this->AddChild( &m_sprArrows[i] ); } @@ -59,8 +59,8 @@ JukeboxMenu::JukeboxMenu() this->AddChild( &m_textValue[i] ); } - m_soundChangeRow.Load( THEME->GetPathTo("sounds","jukebox menu row") ); - m_soundChangeValue.Load( THEME->GetPathTo("sounds","jukebox menu value") ); + m_soundChangeRow.Load( THEME->GetPathTo("sounds","JukeboxMenu row") ); + m_soundChangeValue.Load( THEME->GetPathTo("sounds","JukeboxMenu value") ); // fill in data structures diff --git a/stepmania/src/ScreenEditMenu.cpp b/stepmania/src/ScreenEditMenu.cpp index 31a82a024c..ab2fbeb386 100644 --- a/stepmania/src/ScreenEditMenu.cpp +++ b/stepmania/src/ScreenEditMenu.cpp @@ -44,7 +44,7 @@ ScreenEditMenu::ScreenEditMenu() // m_Selector.AllowNewNotes(); this->AddChild( &m_Selector ); - m_Menu.Load( "ScreenEditMenu", false ); + m_Menu.Load( "ScreenEditMenu", false ); // disable timer this->AddChild( &m_Menu ); diff --git a/stepmania/src/ScreenEvaluation.cpp b/stepmania/src/ScreenEvaluation.cpp index 792fd0f9c4..08064feb9e 100644 --- a/stepmania/src/ScreenEvaluation.cpp +++ b/stepmania/src/ScreenEvaluation.cpp @@ -831,7 +831,6 @@ void ScreenEvaluation::MenuStart( PlayerNumber pn ) /* Tween the screen out, but leave the MenuElements where they are. * Play the "swoosh" sound manually (would normally be played by the ME * tween out). */ - SOUNDMAN->PlayOnce( THEME->GetPathTo("Sounds","menu swoosh") ); TweenOffScreen(); SCREENMAN->SendMessageToTopScreen( SM_GoToFinalEvaluation, MENU_ELEMENTS_TWEEN_TIME ); } diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 285915932f..8a5c2d1e63 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -411,6 +411,10 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration ) m_Inventory.RefreshPossibleItems(); this->AddChild( &m_Inventory ); + m_textDebug.LoadFromFont( THEME->GetPathTo("Fonts","normal") ); + m_textDebug.SetXY( DEBUG_X, DEBUG_Y ); + m_textDebug.SetDiffuse( RageColor(1,1,1,1) ); + this->AddChild( &m_textDebug ); if( !bDemonstration ) // only load if we're going to use it @@ -455,13 +459,6 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration ) } - // Debug is drawn on top of all these things - m_textDebug.LoadFromFont( THEME->GetPathTo("Fonts","normal") ); - m_textDebug.SetXY( DEBUG_X, DEBUG_Y ); - m_textDebug.SetDiffuse( RageColor(1,1,1,1) ); - this->AddChild( &m_textDebug ); - - /* LoadNextSong first, since that positions some elements which need to be * positioned before we TweenOnScreen. */ LoadNextSong(); diff --git a/stepmania/src/ScreenJukebox.cpp b/stepmania/src/ScreenJukebox.cpp index 60f04cf017..d8f33f0129 100644 --- a/stepmania/src/ScreenJukebox.cpp +++ b/stepmania/src/ScreenJukebox.cpp @@ -156,66 +156,17 @@ void ScreenJukebox::Input( const DeviceInput& DeviceI, const InputEventType type //LOG->Trace( "ScreenJukebox::Input()" ); - // - // This should be the same as ScreenAttract::Input() - // - - if(type != IET_FIRST_PRESS) return; // don't care - - if( DeviceI.device == DEVICE_KEYBOARD && DeviceI.button == SDLK_F3 ) - { - (int&)PREFSMAN->m_CoinMode = (PREFSMAN->m_CoinMode+1) % PrefsManager::NUM_COIN_MODES; - - CString sMessage = "Coin Mode: "; - switch( PREFSMAN->m_CoinMode ) - { - case PrefsManager::COIN_HOME: sMessage += "HOME"; break; - case PrefsManager::COIN_PAY: sMessage += "PAY"; break; - case PrefsManager::COIN_FREE: sMessage += "FREE"; break; - } - SCREENMAN->RefreshCreditsMessages(); - SCREENMAN->SystemMessage( sMessage ); - return; - } - if( MenuI.IsValid() ) { switch( MenuI.button ) { + case MENU_BUTTON_START: case MENU_BUTTON_LEFT: case MENU_BUTTON_RIGHT: - if( !m_In.IsTransitioning() && !m_Out.IsTransitioning() ) - m_Out.StartTransitioning( SM_GoToNextScreen ); - break; - case MENU_BUTTON_COIN: - Screen::MenuCoin( MenuI.player ); // increment coins, play sound - m_soundMusic.Stop(); - SDL_Delay( 800 ); // do a little pause, like the arcade does - SCREENMAN->SetNewScreen( "ScreenTitleMenu" ); - break; - case MENU_BUTTON_START: - case MENU_BUTTON_BACK: - - 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: - m_soundMusic.Stop(); - SOUNDMAN->PlayOnce( THEME->GetPathTo("Sounds","insert coin") ); - SDL_Delay( 800 ); // do a little pause, like the arcade does - SCREENMAN->SetNewScreen( "ScreenTitleMenu" ); - break; - default: - ASSERT(0); - } + SCREENMAN->SendMessageToTopScreen( SM_NotesEnded, 0 ); break; } } - } void ScreenJukebox::HandleScreenMessage( const ScreenMessage SM ) diff --git a/stepmania/src/ScreenJukeboxMenu.cpp b/stepmania/src/ScreenJukeboxMenu.cpp index 0abe8591d5..e36ee96c37 100644 --- a/stepmania/src/ScreenJukeboxMenu.cpp +++ b/stepmania/src/ScreenJukeboxMenu.cpp @@ -42,7 +42,7 @@ ScreenJukeboxMenu::ScreenJukeboxMenu() // m_Selector.AllowNewNotes(); this->AddChild( &m_Selector ); - m_Menu.Load( "ScreenJukeboxMenu" ); + m_Menu.Load( "ScreenJukeboxMenu", false ); // disable timer this->AddChild( &m_Menu ); diff --git a/stepmania/src/ScreenMusicScroll.cpp b/stepmania/src/ScreenMusicScroll.cpp index 3439985c65..0c005f1f2a 100644 --- a/stepmania/src/ScreenMusicScroll.cpp +++ b/stepmania/src/ScreenMusicScroll.cpp @@ -147,7 +147,7 @@ ScreenMusicScroll::ScreenMusicScroll() GAMESTATE->Reset(); // so that credits message for both players will show - m_Background.LoadFromAniDir( THEME->GetPathTo("BGAnimations","music scroll") ); + m_Background.LoadFromAniDir( THEME->GetPathTo("BGAnimations","ScreenMusicScroll background") ); this->AddChild( &m_Background ); @@ -187,13 +187,16 @@ ScreenMusicScroll::ScreenMusicScroll() this->SendScreenMessage( SM_BeginFadingOut, 0.2f * i + 3.0f ); - this->AddChild( &m_Fade ); + m_In.Load( THEME->GetPathTo("BGAnimations","ScreenMusicScroll in") ); +// this->AddChild( &m_In ); // draw and update manually + m_In.StartTransitioning(); + + m_Out.Load( THEME->GetPathTo("BGAnimations","ScreenMusicScroll out") ); +// this->AddChild( &m_Out ); // draw and update manually SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("music scroll") ); SOUNDMAN->PlayMusic( THEME->GetPathTo("Sounds","ScreenMusicScroll music") ); - - m_Fade.OpenWipingRight(); } @@ -203,6 +206,9 @@ void ScreenMusicScroll::Update( float fDeltaTime ) for( unsigned i=0; iTrace( "ScreenMusicScroll::Input()" ); +// LOG->Trace( "ScreenMusicScroll::Input()" ); - if( m_Fade.IsClosing() ) + if( m_In.IsTransitioning() || m_Out.IsTransitioning() ) return; Screen::Input( DeviceI, type, GameI, MenuI, StyleI ); // default input handler @@ -236,7 +243,8 @@ void ScreenMusicScroll::HandleScreenMessage( const ScreenMessage SM ) switch( SM ) { case SM_BeginFadingOut: - m_Fade.CloseWipingRight( SM_GoToNextScreen ); + if( !m_Out.IsTransitioning() ) + m_Out.StartTransitioning( SM_GoToNextScreen ); break; case SM_GoToNextScreen: SONGMAN->SaveMachineScoresToDisk(); @@ -247,11 +255,11 @@ void ScreenMusicScroll::HandleScreenMessage( const ScreenMessage SM ) void ScreenMusicScroll::MenuStart( PlayerNumber pn ) { - m_Fade.CloseWipingRight( SM_GoToNextScreen ); + this->SendScreenMessage( SM_BeginFadingOut, 0 ); } void ScreenMusicScroll::MenuBack( PlayerNumber pn ) { - MenuStart( pn ); + this->SendScreenMessage( SM_BeginFadingOut, 0 ); } diff --git a/stepmania/src/ScreenMusicScroll.h b/stepmania/src/ScreenMusicScroll.h index eb047e4226..75dcd89e5d 100644 --- a/stepmania/src/ScreenMusicScroll.h +++ b/stepmania/src/ScreenMusicScroll.h @@ -11,7 +11,7 @@ #include "Screen.h" #include "Sprite.h" -#include "TransitionFade.h" +#include "TransitionBGAnimation.h" #include "RageSoundManager.h" #include "MenuElements.h" @@ -37,12 +37,13 @@ public: private: - BGAnimation m_Background; - BitmapText m_textLines[MAX_TOTAL_LINES]; - unsigned m_iNumLines; - float m_fTimeLeftInScreen; + BGAnimation m_Background; + BitmapText m_textLines[MAX_TOTAL_LINES]; + unsigned m_iNumLines; + float m_fTimeLeftInScreen; - TransitionFade m_Fade; + TransitionBGAnimation m_In; + TransitionBGAnimation m_Out; };