diff --git a/stepmania/src/CourseContentsFrame.cpp b/stepmania/src/CourseContentsFrame.cpp index 4cbf84ce5f..d248ea051d 100644 --- a/stepmania/src/CourseContentsFrame.cpp +++ b/stepmania/src/CourseContentsFrame.cpp @@ -126,13 +126,26 @@ CourseContentsFrame::CourseContentsFrame() ContentsBarWidth = m_CourseContentDisplays[0].m_sprFrame.GetTexture()->GetSourceFrameWidth(); } +void CourseContentsFrame::TweenInAfterChangedCourse() +{ + m_fItemAtTopOfList = 0; + m_fTimeUntilScroll = 3; + + for( int i=0; i vSongs; @@ -162,14 +175,11 @@ void CourseContentsFrame::SetFromCourse( Course* pCourse ) CString sModifiers = vsModifiers[i]; display.LoadFromSongAndNotes( m_iNumContents+1, pSong, pNotes ); } - - display.SetXY( 0, -((MAX_VISIBLE_CONTENTS-1)/2) * float(ContentsBarHeight) ); - display.StopTweening(); - display.BeginTweening( m_iNumContents*0.1f ); - display.SetTweenY( (-(MAX_VISIBLE_CONTENTS-1)/2 + m_iNumContents) * float(ContentsBarHeight) ); m_iNumContents ++; } + + m_fItemAtTopOfList = fmodf(m_fItemAtTopOfList, float(m_iNumContents)); } void CourseContentsFrame::Update( float fDeltaTime ) diff --git a/stepmania/src/CourseContentsFrame.h b/stepmania/src/CourseContentsFrame.h index 9a8fcc8b92..ac032781f7 100644 --- a/stepmania/src/CourseContentsFrame.h +++ b/stepmania/src/CourseContentsFrame.h @@ -52,6 +52,7 @@ public: virtual void DrawPrimitives(); void SetFromCourse( Course* pCourse ); + void TweenInAfterChangedCourse(); protected: diff --git a/stepmania/src/ScreenSelectCourse.cpp b/stepmania/src/ScreenSelectCourse.cpp index a6426718d7..0b579329fd 100644 --- a/stepmania/src/ScreenSelectCourse.cpp +++ b/stepmania/src/ScreenSelectCourse.cpp @@ -190,7 +190,18 @@ void ScreenSelectCourse::TweenOffScreen() void ScreenSelectCourse::Input( const DeviceInput& DeviceI, InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI ) { LOG->Trace( "ScreenSelectCourse::Input()" ); - + + if( DeviceI.device == DEVICE_KEYBOARD && DeviceI.button == SDLK_F9 ) + { + if( type != IET_FIRST_PRESS ) return; + PREFSMAN->m_bShowTranslations ^= 1; + m_MusicWheel.RebuildWheelItemDisplays(); + Course* pCourse = m_MusicWheel.GetSelectedCourse(); + if(pCourse) + m_CourseContentsFrame.SetFromCourse( pCourse ); + return; + } + if( MenuI.button == MENU_BUTTON_RIGHT || MenuI.button == MENU_BUTTON_LEFT ) { if( !MenuI.IsValid() ) return; @@ -354,6 +365,7 @@ void ScreenSelectCourse::AfterCourseChange() m_Banner.LoadFromCourse( pCourse ); m_CourseContentsFrame.SetFromCourse( pCourse ); + m_CourseContentsFrame.TweenInAfterChangedCourse(); } break; case TYPE_SECTION: // if we get here, there are no courses