From fa0d4857c136b73599f42811ea88f65ec4032817 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sun, 16 Jan 2011 14:19:59 -0500 Subject: [PATCH] TimeSignatureSegment editing works via 2 menus. Improvements may follow. --- Themes/_fallback/Languages/en.ini | 2 ++ src/ScreenEdit.cpp | 29 ++++++++++++++++++++++++++--- src/ScreenEdit.h | 4 +++- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/Themes/_fallback/Languages/en.ini b/Themes/_fallback/Languages/en.ini index 22613d3c9e..ae2cce24f7 100644 --- a/Themes/_fallback/Languages/en.ini +++ b/Themes/_fallback/Languages/en.ini @@ -832,6 +832,8 @@ Exit Edit Mode=Exit Edit Mode Edit stop=Edit stop Edit delay=Edit delay 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) Editor options=Options EditorShowBGChangesPlay=Show Backgrounds Effect=Effect diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index db9cff2e42..092f06cedb 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -509,7 +509,9 @@ static MenuDef g_MainMenu( MenuRowDef( ScreenEdit::edit_bpm, "Edit BPM change", true, EditMode_Full, true, true, 0, NULL ), MenuRowDef( ScreenEdit::edit_stop, "Edit stop", true, EditMode_Full, true, true, 0, NULL ), MenuRowDef( ScreenEdit::edit_delay, "Edit delay", true, EditMode_Full, true, true, 0, NULL ), - MenuRowDef( ScreenEdit::edit_time_signature, "Edit time signature", true, EditMode_Full, true, true, 0, NULL ), + //MenuRowDef( ScreenEdit::edit_time_signature, "Edit time signature", true, EditMode_Full, true, true, 0, NULL ), + MenuRowDef( ScreenEdit::edit_time_signature_numerator, "Edit time signature (top)", true, EditMode_Full, true, true, 0, NULL ), + MenuRowDef( ScreenEdit::edit_time_signature_denominator,"Edit time signature (bottom)", true, EditMode_Full, true, true, 0, NULL ), MenuRowDef( ScreenEdit::play_preview_music, "Play preview music", true, EditMode_Full, true, true, 0, NULL ), MenuRowDef( ScreenEdit::exit, "Exit Edit Mode", true, EditMode_Practice, true, true, 0, NULL ) ); @@ -2580,7 +2582,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) int iNum = atoi( ScreenTextEntry::s_sLastAnswer ); if( iNum > 0 ) { - m_pSong->m_Timing.SetTimeSignatureAtBeat( GAMESTATE->m_fSongBeat, iNum, 99 ); + m_pSong->m_Timing.SetTimeSignatureNumeratorAtBeat( GAMESTATE->m_fSongBeat, iNum ); } SetDirty( true ); } @@ -3117,7 +3119,11 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector &iAns 10 ); break; - case edit_time_signature: + /* + The following code does not work due to problems with having two + ScreenTextEntry's at the same time. A proper fix is not known + at the time of this comment. -wolfman2000 + case edit_time_signature: // These need to be in reverse order due to the stack nature. ScreenTextEntry::TextEntry( SM_BackFromTimeSignatureDenominatorChange, @@ -3132,6 +3138,23 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector &iAns 3 ); break; + */ + case edit_time_signature_numerator: + ScreenTextEntry::TextEntry( + SM_BackFromTimeSignatureNumeratorChange, + ENTER_TIME_SIGNATURE_NUMERATOR_VALUE, + ssprintf( "%d", m_pSong->m_Timing.GetTimeSignatureSegmentAtBeat( GAMESTATE->m_fSongBeat ).m_iNumerator ), + 3 + ); + break; + case edit_time_signature_denominator: + ScreenTextEntry::TextEntry( + SM_BackFromTimeSignatureDenominatorChange, + ENTER_TIME_SIGNATURE_DENOMINATOR_VALUE, + ssprintf( "%d", m_pSong->m_Timing.GetTimeSignatureSegmentAtBeat( GAMESTATE->m_fSongBeat ).m_iDenominator ), + 3 + ); + break; case play_preview_music: PlayPreviewMusic(); break; diff --git a/src/ScreenEdit.h b/src/ScreenEdit.h index 7943047770..426c3d5c20 100644 --- a/src/ScreenEdit.h +++ b/src/ScreenEdit.h @@ -313,7 +313,9 @@ public: edit_bpm, edit_stop, edit_delay, - edit_time_signature, + // edit_time_signature, + edit_time_signature_numerator, + edit_time_signature_denominator, play_preview_music, exit, save_on_exit,