From d7e032b478cb0fb9d5dfeeadd04625864f4d96f8 Mon Sep 17 00:00:00 2001 From: Kyzentun Date: Sat, 4 Apr 2015 22:38:18 -0600 Subject: [PATCH] Added 1, 2, and 4 measure choices to shift menus in edit mode. --- Docs/Changelog_language.txt | 8 +++- Themes/_fallback/Languages/en.ini | 4 ++ src/ScreenEdit.cpp | 76 +++++++++++++++++++++++++------ 3 files changed, 74 insertions(+), 14 deletions(-) diff --git a/Docs/Changelog_language.txt b/Docs/Changelog_language.txt index 4de4c315ae..fb622fa8a6 100644 --- a/Docs/Changelog_language.txt +++ b/Docs/Changelog_language.txt @@ -16,8 +16,14 @@ Example: This means that three strings were added to the "ScreenDebugOverlay" section, "Mute actions", "Mute actions on", and "Mute actions off". -Day not found + + +2015/04/04 (Day not found) ---------- +* [OptionNames] 1m + 2m + 2nd + 4m * [OptionTitles] All timing BPM changes Combo segments diff --git a/Themes/_fallback/Languages/en.ini b/Themes/_fallback/Languages/en.ini index ca40353005..091d55a73c 100644 --- a/Themes/_fallback/Languages/en.ini +++ b/Themes/_fallback/Languages/en.ini @@ -647,11 +647,14 @@ x2.5=2.5x 16bit=16bit 16th=16th 192nd=192nd +1m=1m 2=2 2 Players for 1 Credit=2 Players for 1 Credit 2 Times=2 Times 2.0x=2.0x 24th=24th +2m=2m +2nd=2nd 3=3 3 Times=3 Times 32bit=32bit @@ -660,6 +663,7 @@ x2.5=2.5x 4 Times=4 Times 48th=48th 4th=4th +4m=4m 5=5 5 Times=5 Times 6=6 diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 5f3bc3948c..faa3f9fb70 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -700,6 +700,63 @@ const MapEditButtonToMenuButton *ScreenEdit::GetCurrentMenuButtonMap() const } } +enum RowCountChoice +{ + RCC_4M, + RCC_2M, + RCC_1M, + RCC_2ND, + RCC_4TH, + RCC_8TH, + RCC_12TH, + RCC_16TH, + RCC_24TH, + RCC_32ND, + RCC_48TH, + RCC_64TH, + RCC_192ND, +}; + +#define RCC_CHOICES RCC_4TH, "4m", "2m", "1m", "2nd", "4th","8th","12th","16th","24th","32nd","48th","64th","192nd" + +int GetRowsFromAnswers(int choice, const vector& answers); +int GetRowsFromAnswers(int choice, const vector& answers) +{ + if(answers.empty()) + { + return 192 / 8; + } + switch(answers[choice]) + { + case RCC_4M: + return 192 * 4; + case RCC_2M: + return 192 * 2; + case RCC_1M: + return 192; + case RCC_2ND: + return 192 / 2; + case RCC_4TH: + default: + return 192 / 4; + case RCC_8TH: + return 192 / 8; + case RCC_12TH: + return 192 / 12; + case RCC_16TH: + return 192 / 16; + case RCC_24TH: + return 192 / 24; + case RCC_32ND: + return 192 / 32; + case RCC_48TH: + return 192 / 48; + case RCC_64TH: + return 3; + case RCC_192ND: + return 1; + } +} static MenuDef g_EditHelp( "ScreenMiniMenuEditHelp" @@ -852,16 +909,16 @@ static MenuDef g_AreaMenu( true, EditMode_Practice, true, true, 0, NULL ), MenuRowDef(ScreenEdit::insert_and_shift, "Insert beat and shift down", - true, EditMode_Practice, true, true, 0, "4th","8th","12th","16th","24th","32nd","48th","64th","192nd" ), + true, EditMode_Practice, true, true, RCC_CHOICES ), MenuRowDef(ScreenEdit::delete_and_shift, "Delete beat and shift up", - true, EditMode_Practice, true, true, 0, "4th","8th","12th","16th","24th","32nd","48th","64th","192nd" ), + true, EditMode_Practice, true, true, RCC_CHOICES ), MenuRowDef(ScreenEdit::shift_pauses_forward, "Shift all timing changes down", - true, EditMode_Full, true, true, 0, "4th","8th","12th","16th","24th","32nd","48th","64th","192nd" ), + true, EditMode_Full, true, true, RCC_CHOICES ), MenuRowDef(ScreenEdit::shift_pauses_backward, "Shift all timing changes up", - true, EditMode_Full, true, true, 0, "4th","8th","12th","16th","24th","32nd","48th","64th","192nd" ), + true, EditMode_Full, true, true, RCC_CHOICES ), MenuRowDef(ScreenEdit::convert_pause_to_beat, "Convert pause to beats", true, @@ -1036,10 +1093,10 @@ static MenuDef g_TimingDataInformation( true, EditMode_Full, true, true, 0, NULL ), MenuRowDef(ScreenEdit::shift_timing_in_region_down, "Shift timing in region down", - true, EditMode_Full, true, true, 0, "4th","8th","12th","16th","24th","32nd","48th","64th","192nd"), + true, EditMode_Full, true, true, RCC_CHOICES), MenuRowDef(ScreenEdit::shift_timing_in_region_up, "Shift timing in region up", - true, EditMode_Full, true, true, 0, "4th","8th","12th","16th","24th","32nd","48th","64th","192nd"), + true, EditMode_Full, true, true, RCC_CHOICES), MenuRowDef(ScreenEdit::copy_timing_in_region, "Copy timing in region", true, EditMode_Full, true, true, 0, NULL), @@ -5367,13 +5424,6 @@ void ScreenEdit::HandleAlterMenuChoice(AlterMenuChoice c, const vector &iAn } -int GetRowsFromAnswers(int choice, const vector& answers); -int GetRowsFromAnswers(int choice, const vector& answers) -{ - // Logic courtesy of someone else, not me. Just deduplicating it. -Kyz - return answers.size() > 0 ? NoteTypeToRow((NoteType)answers[choice]) : 48; -} - void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, const vector &iAnswers, bool bAllowUndo ) { bool bSaveUndo = true;