From a50069efa2481179c8d073514a9b2f72afb9b5c8 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Tue, 28 Jun 2011 12:25:32 -0400 Subject: [PATCH] Add the requested copy timing data functionality. I don't know of a good way to copy timing data across different styles, though. --- Docs/Changelog_sm5.txt | 7 +++++++ Themes/_fallback/Languages/en.ini | 2 ++ src/ScreenEdit.cpp | 22 ++++++++++++++++++++++ src/ScreenEdit.h | 8 ++++++++ 4 files changed, 39 insertions(+) diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index 330b897df1..3becdfa38c 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -8,6 +8,13 @@ ________________________________________________________________________________ StepMania 5.0 Preview 2 | 201106?? -------------------------------------------------------------------------------- +2011/06/28 +---------- +* [ScreenEdit] Add a function to copy/paste the TimingData of a player's + choice. Remember to be in the appropriate mode when copying and pasting. + By default, the song timing is already located in the clipboard, ready for + use. [Wolfman2000] + 2011/06/27 ---------- * [Steps] Make sure #ATTACKS are copied when requested. [Wolfman2000] diff --git a/Themes/_fallback/Languages/en.ini b/Themes/_fallback/Languages/en.ini index e94e6b0482..1c796abc6b 100644 --- a/Themes/_fallback/Languages/en.ini +++ b/Themes/_fallback/Languages/en.ini @@ -821,6 +821,7 @@ Convert selection to delay=Convert selection to delay Convert selection to warp=Convert selection to Warp Segment Convert selection to fake=Convert selection to Fake Segment Copy=Copy +Copy timing data=Copy timing data CourseSortOrder=Course Sort Create New=Create New Create New Course=Create New @@ -944,6 +945,7 @@ OsMountPlayer1=OS Mount Player1 OsMountPlayer2=OS Mount Player2 Paste at begin marker=Paste at begin marker Paste at current beat=Paste at current beat +Paste timing data=Paste timing data Persp=Persp Play current beat to end=Play current beat to end Play preview music=Play preview music diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 4d2a584b0c..55660d2c05 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -643,6 +643,8 @@ static MenuDef g_TimingDataInformation( MenuRowDef( ScreenEdit::speed_mode, "Edit speed (mode)", true, EditMode_Full, true, true, 0, "Beats", "Seconds" ), MenuRowDef( ScreenEdit::scroll, "Edit scrolling factor", true, EditMode_Full, true, true, 0, NULL ), MenuRowDef( ScreenEdit::fake, "Edit fake", true, EditMode_Full, true, true, 0, NULL ), + MenuRowDef( ScreenEdit::copy_timing, "Copy timing data", true, EditMode_Full, true, true, 0, NULL ), + MenuRowDef( ScreenEdit::paste_timing, "Paste timing data", true, EditMode_Full, true, true, 0, NULL ), MenuRowDef( ScreenEdit::erase_step_timing, "Erase step timing", true, EditMode_Full, true, true, 0, NULL ) ); @@ -873,6 +875,8 @@ void ScreenEdit::Init() m_bRemoveNoteButtonDown = false; m_Clipboard.SetNumTracks( m_NoteDataEdit.GetNumTracks() ); + + clipboardTiming = GAMESTATE->m_pCurSong->m_SongTiming; // always have a backup. m_bHasUndo = false; m_Undo.SetNumTracks( m_NoteDataEdit.GetNumTracks() ); @@ -4404,6 +4408,24 @@ void ScreenEdit::HandleTimingDataInformationChoice( TimingDataInformationChoice ); break; } + case copy_timing: + { + clipboardTiming = GetAppropriateTiming(); + break; + } + case paste_timing: + { + if (GAMESTATE->m_bIsUsingStepTiming) + { + GAMESTATE->m_pCurSteps[PLAYER_1]->m_Timing = clipboardTiming; + } + else + { + GAMESTATE->m_pCurSong->m_SongTiming = clipboardTiming; + } + SetDirty(true); + break; + } case erase_step_timing: ScreenPrompt::Prompt( SM_DoEraseStepTiming, CONFIRM_TIMING_ERASE , PROMPT_YES_NO, ANSWER_NO ); break; diff --git a/src/ScreenEdit.h b/src/ScreenEdit.h index bdfbdc71f4..255cf2b425 100644 --- a/src/ScreenEdit.h +++ b/src/ScreenEdit.h @@ -273,6 +273,12 @@ protected: * This is mainly to allow playing a chart with Song Timing. */ TimingData backupStepTiming; + /** + * @brief Have a backup of the TimingData of the player's choice. + * + * This will be used for copying and pasting as required. */ + TimingData clipboardTiming; + /** @brief The current TapNote that would be inserted. */ TapNote m_selectedTap; @@ -550,6 +556,8 @@ public: speed_mode, scroll, fake, + copy_timing, + paste_timing, erase_step_timing, NUM_TIMING_DATA_INFORMATION_CHOICES };