implement F9 in the course menu
only toggles song translations, not courses (we don't store translits for those)
This commit is contained in:
@@ -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<m_iNumContents; i++ )
|
||||
{
|
||||
CourseContentDisplay& display = m_CourseContentDisplays[i];
|
||||
|
||||
display.SetXY( 0, -((MAX_VISIBLE_CONTENTS-1)/2) * float(ContentsBarHeight) );
|
||||
display.StopTweening();
|
||||
display.BeginTweening( i*0.1f );
|
||||
display.SetTweenY( (-(MAX_VISIBLE_CONTENTS-1)/2 + i) * float(ContentsBarHeight) );
|
||||
}
|
||||
}
|
||||
|
||||
void CourseContentsFrame::SetFromCourse( Course* pCourse )
|
||||
{
|
||||
ASSERT( pCourse != NULL );
|
||||
|
||||
m_fTimeUntilScroll = 3;
|
||||
m_fItemAtTopOfList = 0;
|
||||
|
||||
m_iNumContents = 0;
|
||||
|
||||
vector<Song*> 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 )
|
||||
|
||||
@@ -52,6 +52,7 @@ public:
|
||||
virtual void DrawPrimitives();
|
||||
|
||||
void SetFromCourse( Course* pCourse );
|
||||
void TweenInAfterChangedCourse();
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user