From 2504a2c4b55d6dfec5f645664a13d8b6b2654822 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Tue, 18 Jan 2011 11:49:27 -0500 Subject: [PATCH] Allow changing tickcounts in the editor. Next up: actually displaying the tickcount. --- Themes/_fallback/Languages/en.ini | 2 ++ src/ScreenEdit.cpp | 24 ++++++++++++++++++++++-- src/ScreenEdit.h | 1 + 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/Themes/_fallback/Languages/en.ini b/Themes/_fallback/Languages/en.ini index 53c47ca7b3..2c829d7245 100644 --- a/Themes/_fallback/Languages/en.ini +++ b/Themes/_fallback/Languages/en.ini @@ -835,6 +835,7 @@ Edit Timing Data=Edit Timing Data Edit time signature=Edit time signature (not working yet) Edit time signature (top)=Edit time signature (beats per measure) Edit time signature (bottom)=Edit time signature (single beat note value) +Edit tickcount=Edit tickcount Editor options=Options EditorShowBGChangesPlay=Show Backgrounds Effect=Effect @@ -1197,6 +1198,7 @@ Enter a new Stop value.=Enter a new Stop value. Enter a new Delay value.=Enter a new Delay value. Enter a new Time Signature numerator value.=Enter the number of beats per measure. Enter a new Time Signature denominator value.=Enter the note value that represents one beat. +Enter a new Tickcount value.=Enter a new Tickcount value. Enter a new artist transliteration.=Enter a new artist transliteration. Enter a new artist.=Enter a new artist. Enter a new genre.=Enter a new genre. diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 6b8d59180a..ca664c2762 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -77,6 +77,7 @@ AutoScreenMessage( SM_BackFromStopChange ); AutoScreenMessage( SM_BackFromDelayChange ); AutoScreenMessage( SM_BackFromTimeSignatureNumeratorChange ); AutoScreenMessage( SM_BackFromTimeSignatureDenominatorChange ); +AutoScreenMessage( SM_BackFromTickcountChange ); AutoScreenMessage( SM_DoSaveAndExit ); AutoScreenMessage( SM_DoExit ); AutoScreenMessage( SM_SaveSuccessful ); @@ -574,8 +575,8 @@ static MenuDef g_TimingDataInformation( MenuRowDef( ScreenEdit::stop, "Edit stop", true, EditMode_Full, true, true, 0, NULL ), MenuRowDef( ScreenEdit::delay, "Edit delay", true, EditMode_Full, true, true, 0, NULL ), MenuRowDef( ScreenEdit::time_signature_numerator, "Edit time signature (top)", true, EditMode_Full, true, true, 0, NULL ), - MenuRowDef( ScreenEdit::time_signature_denominator, "Edit time signature (bottom)", true, EditMode_Full, true, true, 0, NULL ) - + MenuRowDef( ScreenEdit::time_signature_denominator, "Edit time signature (bottom)", true, EditMode_Full, true, true, 0, NULL ), + MenuRowDef( ScreenEdit::tickcount, "Edit tickcount", true, EditMode_Full, true, true, 0, NULL ) ); enum { song_bganimation, song_movie, song_bitmap, global_bganimation, global_movie, global_movie_song_group, global_movie_song_group_and_genre, dynamic_random, baked_random, none }; @@ -2605,6 +2606,15 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) } SetDirty( true ); } + else if ( SM == SM_BackFromTickcountChange ) + { + int iTick = atoi( ScreenTextEntry::s_sLastAnswer ); + if ( iTick >= 1 && iTick <= ROWS_PER_BEAT ) + { + m_pSong->m_Timing.SetTickcountAtBeat( GAMESTATE->m_fSongBeat, iTick ); + } + SetDirty( true ); + } else if( SM == SM_BackFromBGChange ) { HandleBGChangeChoice( (BGChangeChoice)ScreenMiniMenu::s_iLastRowCode, ScreenMiniMenu::s_viLastAnswers ); @@ -3106,6 +3116,7 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector &iAns g_TimingDataInformation.rows[delay].SetOneUnthemedChoice( ssprintf("%.5f", pTime.GetDelayAtBeat( fBeat ) ) ); g_TimingDataInformation.rows[time_signature_numerator].SetOneUnthemedChoice( ssprintf("%d", pTime.GetTimeSignatureNumeratorAtBeat( fBeat ) ) ); g_TimingDataInformation.rows[time_signature_denominator].SetOneUnthemedChoice( ssprintf("%d", pTime.GetTimeSignatureDenominatorAtBeat( fBeat ) ) ); + g_TimingDataInformation.rows[tickcount].SetOneUnthemedChoice( ssprintf("%d", pTime.GetTickcountAtBeat( fBeat ) ) ); EditMiniMenu( &g_TimingDataInformation, SM_BackFromTimingDataInformation ); } @@ -3532,6 +3543,7 @@ static LocalizedString ENTER_STOP_VALUE ( "ScreenEdit", "Enter a new Stop val static LocalizedString ENTER_DELAY_VALUE ( "ScreenEdit", "Enter a new Delay value." ); static LocalizedString ENTER_TIME_SIGNATURE_NUMERATOR_VALUE ( "ScreenEdit", "Enter a new Time Signature numerator value." ); static LocalizedString ENTER_TIME_SIGNATURE_DENOMINATOR_VALUE ( "ScreenEdit", "Enter a new Time Signature denominator value." ); +static LocalizedString ENTER_TICKCOUNT_VALUE ( "ScreenEdit", "Enter a new Tickcount value." ); void ScreenEdit::HandleTimingDataInformationChoice( TimingDataInformationChoice c, const vector &iAnswers ) { switch( c ) @@ -3581,6 +3593,14 @@ void ScreenEdit::HandleTimingDataInformationChoice( TimingDataInformationChoice 3 ); break; + case tickcount: + ScreenTextEntry::TextEntry( + SM_BackFromTickcountChange, + ENTER_TICKCOUNT_VALUE, + ssprintf( "%d", m_pSong->m_Timing.GetTickcountAtBeat( GAMESTATE->m_fSongBeat ) ), + 2 + ); + break; } } diff --git a/src/ScreenEdit.h b/src/ScreenEdit.h index 3c30664f29..dd34e3d4e7 100644 --- a/src/ScreenEdit.h +++ b/src/ScreenEdit.h @@ -446,6 +446,7 @@ public: // time_signature, time_signature_numerator, time_signature_denominator, + tickcount, NUM_TIMING_DATA_INFORMATION_CHOICES };