From d144d137bbee3278b61e5e656d60975413878750 Mon Sep 17 00:00:00 2001 From: Andrew Livy Date: Tue, 21 Jan 2003 13:33:56 +0000 Subject: [PATCH] Now returns to the correct Difficulty on pump music select instead of whatever the first one is... --- stepmania/src/ActorFrame.h | 1 + stepmania/src/MusicBannerWheel.cpp | 1 - stepmania/src/ScreenEz2SelectMusic.cpp | 63 ++++++++++++++++++-------- 3 files changed, 45 insertions(+), 20 deletions(-) diff --git a/stepmania/src/ActorFrame.h b/stepmania/src/ActorFrame.h index c117cfe1f3..f8c12c09d0 100644 --- a/stepmania/src/ActorFrame.h +++ b/stepmania/src/ActorFrame.h @@ -19,6 +19,7 @@ public: virtual void AddChild( Actor* pActor ); virtual void MoveToTail( Actor* pActor ); virtual void MoveToHead( Actor* pActor ); + virtual void MoveToFront( Actor* pActor ) { MoveToHead( pActor ); } // hack! so many things call this... when they really mean move to head. virtual ~ActorFrame() { } virtual void Update( float fDeltaTime ); diff --git a/stepmania/src/MusicBannerWheel.cpp b/stepmania/src/MusicBannerWheel.cpp index 44502a4eee..b7d9989289 100644 --- a/stepmania/src/MusicBannerWheel.cpp +++ b/stepmania/src/MusicBannerWheel.cpp @@ -136,7 +136,6 @@ void MusicBannerWheel::InsertNewBanner(int direction) scrlistpos = 4 4 0 1 [2] [3] [4] [0] [1] 2 3 4 0 1 2 3 // we lost 2 and got a new one scrlistpos = 3 3 4 0 [1] [2] [3] [4] [0] 1 2 3 4 0 1 2 // we lost 1 and got a new one */ - if(currentPos-2 >= 0) pSong = arraySongs[currentPos-2]; else diff --git a/stepmania/src/ScreenEz2SelectMusic.cpp b/stepmania/src/ScreenEz2SelectMusic.cpp index 30d18e4e0c..28c22e14f0 100644 --- a/stepmania/src/ScreenEz2SelectMusic.cpp +++ b/stepmania/src/ScreenEz2SelectMusic.cpp @@ -55,7 +55,7 @@ const ScreenMessage SM_GoToNextScreen = ScreenMessage(SM_User+2); const ScreenMessage SM_NoSongs = ScreenMessage(SM_User+3); ScreenEz2SelectMusic::ScreenEz2SelectMusic() -{ +{ i_ErrorDetected=0; CodeDetector::RefreshCacheItems(); @@ -67,9 +67,9 @@ ScreenEz2SelectMusic::ScreenEz2SelectMusic() m_Menu.Load( - THEME->GetPathTo("BGAnimations","select music"), + THEME->GetPathTo("BGAnimations","select music"), THEME->GetPathTo("Graphics","select music top edge"), - HELP_TEXT, true, true, TIMER_SECONDS + HELP_TEXT, true, true, TIMER_SECONDS ); this->AddChild( &m_Menu ); @@ -96,7 +96,7 @@ ScreenEz2SelectMusic::ScreenEz2SelectMusic() m_ChoiceListHighlight.Load( THEME->GetPathTo("Graphics","select mode list highlight")); m_ChoiceListHighlight.SetXY( SCROLLING_LIST_X, SCROLLING_LIST_Y); - this->AddChild( &m_ChoiceListHighlight ); + this->AddChild( &m_ChoiceListHighlight ); #ifdef _DEBUG m_debugtext.LoadFromFont( THEME->GetPathTo("Fonts","small titles") ); @@ -138,7 +138,7 @@ ScreenEz2SelectMusic::ScreenEz2SelectMusic() m_PumpDifficultyRating.SetXY( PUMP_DIFF_X, PUMP_DIFF_Y ); this->AddChild(&m_PumpDifficultyRating); - + m_sprOptionsMessage.Load( THEME->GetPathTo("Graphics","select music options message") ); m_sprOptionsMessage.StopAnimating(); m_sprOptionsMessage.SetXY( CENTER_X, CENTER_Y ); @@ -223,18 +223,18 @@ void ScreenEz2SelectMusic::UpdateOptions(PlayerNumber pn, int nosound) if(asOptions.size() > 0) // check it's not empty! { - m_MirrorIcon[pn].SetDiffuse( RageColor(0,0,0,0) ); - m_ShuffleIcon[pn].SetDiffuse( RageColor(0,0,0,0) ); + m_MirrorIcon[pn].SetDiffuse( RageColor(0,0,0,0) ); + m_ShuffleIcon[pn].SetDiffuse( RageColor(0,0,0,0) ); for(unsigned i=0; iStopMusic(); } @@ -408,7 +409,8 @@ void ScreenEz2SelectMusic::EasierDifficulty( PlayerNumber pn ) void ScreenEz2SelectMusic::HarderDifficulty( PlayerNumber pn ) { - if( !GAMESTATE->IsPlayerEnabled(pn) ) + if( !GAMESTATE->IsPlayerEnabled(pn + ) ) return; if( m_arrayNotes[pn].empty() ) return; @@ -424,6 +426,8 @@ void ScreenEz2SelectMusic::HarderDifficulty( PlayerNumber pn ) if(PREVIEWMUSICMODE == 1 && iConfirmSelection == 1) { iConfirmSelection = 0; + + m_MusicBannerWheel.StopBouncing(); SOUNDMAN->StopMusic(); } @@ -434,6 +438,7 @@ void ScreenEz2SelectMusic::HarderDifficulty( PlayerNumber pn ) // m_soundChangeNotes.Play(); AfterNotesChange( pn ); + } @@ -454,13 +459,29 @@ void ScreenEz2SelectMusic::MusicChanged() m_arrayNotes[pn].clear(); - for( pn = 0; pn < NUM_PLAYERS; ++pn) + for( pn = 0; pn < NUM_PLAYERS; ++pn) { pSong->GetNotesThatMatch( GAMESTATE->GetCurrentStyleDef()->m_NotesType, m_arrayNotes[pn] ); SortNotesArrayByDifficulty( m_arrayNotes[pn] ); } for( int p=0; pIsPlayerEnabled( PlayerNumber(p) ) ) + continue; + for( unsigned i=0; iGetDifficulty() == GAMESTATE->m_PreferredDifficulty[p] ) + { + m_iSelection[p] = i; + break; + } + } + + m_iSelection[p] = clamp( m_iSelection[p], 0, int(m_arrayNotes[p].size()) ) ; + } + + for( p=0; pIsPlayerEnabled(pn) ) - return; + + m_iSelection[pn] = clamp( m_iSelection[pn], 0, int(m_arrayNotes[pn].size()-1) ); // bounds clamping + Notes* pNotes = m_arrayNotes[pn].empty()? NULL: m_arrayNotes[pn][m_iSelection[pn]]; - if( pNotes != NULL ) + GAMESTATE->m_pCurNotes[pn] = pNotes; + + + if( pNotes != NULL && pn == GAMESTATE->m_MasterPlayerNumber ) m_PumpDifficultyRating.SetText(ssprintf("Lv.%d",pNotes->GetMeter())); - GAMESTATE->m_pCurNotes[pn] = pNotes; +// GAMESTATE->m_pCurNotes[pn] = pNotes; // Notes* m_pNotes = GAMESTATE->m_pCurNotes[pn];