diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index 93af05977d..81e01eebf0 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -8,12 +8,21 @@ ________________________________________________________________________________ StepMania 5.0 ????????? | 20110??? -------------------------------------------------------------------------------- +2011/07/13 +---------- +* [Difficulty] Allow ALL StepsTypes to use CustomDifficulty properly. + There was some unfair targeting of Couple and Routine. [Wolfman2000] +* [Steps] Calculate accurate radar values for Couple charts. [Wolfman2000] + 2011/07/12 ---------- * [OptionRowHandler] Add a new metric to ScreenOptionsMaster: StepsUseChartName. Use this if you want your charts to have a unique name in the options menu. If there is no #CHARTNAME or it is "Blank", it reverts to the original behavior. This metric is false by default. [Wolfman2000] +* [ScreenEdit] Fixed a bug involving #ATTACKS. Now when you set an attack, + the mods are reverted back to how they were prior to the attack being set. + [Wolfman2000] 2011/07/09 ---------- diff --git a/Songs/StepMania 5/MechaTribe Assault/Mecha-Tribe Assault.ssc b/Songs/StepMania 5/MechaTribe Assault/Mecha-Tribe Assault.ssc index 2731a8a654..a053075757 100644 --- a/Songs/StepMania 5/MechaTribe Assault/Mecha-Tribe Assault.ssc +++ b/Songs/StepMania 5/MechaTribe Assault/Mecha-Tribe Assault.ssc @@ -4553,29 +4553,31 @@ MMMMMM ,288.000000=Verse 9B ,304.000000=Fin ; -#ATTACKS:TIME=101.194664:LEN=7.000000:MODS=*0.2399996928003932 Reverse, Overhead; +#ATTACKS: +TIME=101.194664: +LEN=7.000000: +MODS=*0.2399996928003932 Reverse, Overhead; #NOTES: -// measure 0 00000 00000 00000 00000 -, // measure 1 +, 00000 00000 00000 00000 -, // measure 2 +, 00000 00000 00000 00000 -, // measure 3 +, 00000 00000 00000 00000 -, // measure 4 +, 00110 00000 00010 @@ -4584,7 +4586,7 @@ MMMMMM 00000 00010 10100 -, // measure 5 +, 00010 10100 00010 @@ -4593,7 +4595,7 @@ MMMMMM 01100 00010 01000 -, // measure 6 +, 01100 00000 01000 @@ -4602,7 +4604,7 @@ MMMMMM 00000 01000 00101 -, // measure 7 +, 01000 00101 01000 @@ -4611,7 +4613,7 @@ MMMMMM 00110 01000 00010 -, // measure 8 +, 10100 00000 10000 @@ -4620,7 +4622,7 @@ MMMMMM 00000 10000 00110 -, // measure 9 +, 10000 00110 10000 @@ -4629,7 +4631,7 @@ MMMMMM 00101 10000 00001 -, // measure 10 +, 00101 00000 00001 @@ -4638,7 +4640,7 @@ MMMMMM 00000 00001 01100 -, // measure 11 +, 00001 01100 00001 @@ -4647,7 +4649,7 @@ MMMMMM 10100 00001 10000 -, // measure 12 +, 00101 10000 00010 @@ -4656,7 +4658,7 @@ MMMMMM 01000 00100 01001 -, // measure 13 +, 00100 00000 01001 @@ -4673,7 +4675,7 @@ MMMMMM 00100 01000 00100 -, // measure 14 +, 10000 10000 10100 @@ -4682,7 +4684,7 @@ MMMMMM 00001 00101 00001 -, // measure 15 +, 01000 00000 01000 @@ -4699,7 +4701,7 @@ MMMMMM 00100 00010 00100 -, // measure 16 +, 00001 00000 00100 @@ -4716,7 +4718,7 @@ MMMMMM 00000 10000 00010 -, // measure 17 +, 00100 00000 00010 @@ -4733,7 +4735,7 @@ MMMMMM 00100 01000 00010 -, // measure 18 +, 00100 00000 00001 @@ -4750,7 +4752,7 @@ MMMMMM 00000 00001 00000 -, // measure 19 +, 01101 00000 00000 @@ -4767,7 +4769,7 @@ MMMMMM 00000 01010 00000 -, // measure 20 +, 10010 00000 10000 @@ -4784,7 +4786,7 @@ MMMMMM 00000 00100 00001 -, // measure 21 +, 01000 00000 01000 @@ -4801,7 +4803,7 @@ MMMMMM 00100 01000 10000 -, // measure 22 +, 00010 00000 00010 @@ -4818,7 +4820,7 @@ MMMMMM 00000 00100 01000 -, // measure 23 +, 00001 00000 00001 @@ -4835,7 +4837,7 @@ MMMMMM 00000 00010 00100 -, // measure 24 +, 00001 00000 00001 @@ -4852,7 +4854,7 @@ MMMMMM 00000 00100 10000 -, // measure 25 +, 00010 00000 00010 @@ -4869,7 +4871,7 @@ MMMMMM 00100 00010 00001 -, // measure 26 +, 01000 00000 01000 @@ -4886,7 +4888,7 @@ MMMMMM 00000 00100 00000 -, // measure 27 +, 10110 00000 00000 @@ -4903,7 +4905,7 @@ MMMMMM 00000 01010 00000 -, // measure 28 +, 01001 00001 01101 @@ -4912,7 +4914,7 @@ MMMMMM 00001 01001 00001 -, // measure 29 +, 10010 10000 10110 @@ -4921,7 +4923,7 @@ MMMMMM 10000 10010 10000 -, // measure 30 +, 10010 00010 10110 @@ -4930,7 +4932,7 @@ MMMMMM 00010 10010 00010 -, // measure 31 +, 01001 00000 00100 @@ -4947,7 +4949,7 @@ MMMMMM 00010 00100 00001 -, // measure 32 +, 10001 10000 10101 @@ -4956,7 +4958,7 @@ MMMMMM 10000 10001 10000 -, // measure 33 +, 10001 00001 10101 @@ -4965,7 +4967,7 @@ MMMMMM 00001 10001 00001 -, // measure 34 +, 01010 01000 01110 @@ -4974,7 +4976,7 @@ MMMMMM 01000 01010 01000 -, // measure 35 +, 01010 00000 00100 @@ -4991,7 +4993,7 @@ MMMMMM 00010 01000 00100 -, // measure 36 +, 10000 00010 00110 @@ -5000,7 +5002,7 @@ MMMMMM 00110 10000 00010 -, // measure 37 +, 00110 01000 00001 @@ -5009,7 +5011,7 @@ MMMMMM 00001 01000 00001 -, // measure 38 +, 00101 01000 01100 @@ -5018,7 +5020,7 @@ MMMMMM 01100 00001 01000 -, // measure 39 +, 01100 00000 00010 @@ -5035,7 +5037,7 @@ MMMMMM 10000 00001 01000 -, // measure 40 +, 00010 10000 10100 @@ -5044,7 +5046,7 @@ MMMMMM 10100 00010 10000 -, // measure 41 +, 10100 00001 01000 @@ -5053,7 +5055,7 @@ MMMMMM 01000 00001 01000 -, // measure 42 +, 01100 00001 00101 @@ -5062,7 +5064,7 @@ MMMMMM 00101 01000 00001 -, // measure 43 +, 00101 00000 10000 @@ -5079,7 +5081,7 @@ MMMMMM 00010 01000 00001 -, // measure 44 +, 10000 00100 10000 @@ -5096,7 +5098,7 @@ MMMMMM 00100 00001 00000 -, // measure 45 +, 00010 00100 00010 @@ -5113,7 +5115,7 @@ MMMMMM 00100 00010 00000 -, // measure 46 +, 10000 00010 00100 @@ -5130,7 +5132,7 @@ MMMMMM 00100 00010 00000 -, // measure 47 +, 00001 00100 00001 @@ -5147,7 +5149,7 @@ MMMMMM 00100 00010 00001 -, // measure 48 +, 01000 00100 00010 @@ -5164,7 +5166,7 @@ MMMMMM 00100 00010 00000 -, // measure 49 +, 00001 00100 10000 @@ -5181,7 +5183,7 @@ MMMMMM 00100 10000 00000 -, // measure 50 +, 00010 00100 01000 @@ -5198,7 +5200,7 @@ MMMMMM 00100 00001 00000 -, // measure 51 +, 00010 01000 00010 @@ -5215,7 +5217,7 @@ MMMMMM 01000 00001 01000 -, // measure 52 +, 00020 00000 01130 @@ -5224,7 +5226,7 @@ MMMMMM 00100 02000 00000 -, // measure 53 +, 03002 00000 00100 @@ -5241,12 +5243,12 @@ MMMMMM 00010 01000 00100 -, // measure 54 +, 20000 30101 00002 02003 -, // measure 55 +, 03100 00000 00100 @@ -5255,7 +5257,7 @@ MMMMMM 00030 01010 01010 -, // measure 56 +, 02010 00100 03001 @@ -5264,7 +5266,7 @@ MMMMMM 00100 03001 01000 -, // measure 57 +, 01020 00100 10030 @@ -5273,7 +5275,7 @@ MMMMMM 00100 10030 00010 -, // measure 58 +, 20010 00100 30001 @@ -5282,7 +5284,7 @@ MMMMMM 00100 30001 10000 -, // measure 59 +, 01002 00000 00100 @@ -5299,7 +5301,7 @@ MMMMMM 00000 00001 10000 -, // measure 60 +, 00020 00000 00100 @@ -5308,12 +5310,12 @@ MMMMMM 00030 02000 00000 -, // measure 61 +, 03020 00100 20030 30002 -, // measure 62 +, 02003 03100 02000 @@ -5322,7 +5324,7 @@ MMMMMM 03100 20000 30000 -, // measure 63 +, 00002 00103 00002 @@ -5331,7 +5333,7 @@ MMMMMM 00130 00020 00130 -, // measure 64 +, 02001 00100 03010 @@ -5340,7 +5342,7 @@ MMMMMM 00100 03010 01000 -, // measure 65 +, 10020 00100 01030 @@ -5349,7 +5351,7 @@ MMMMMM 00100 01030 00010 -, // measure 66 +, 20001 00100 30010 @@ -5358,7 +5360,7 @@ MMMMMM 00100 30010 10000 -, // measure 67 +, 10002 00100 01003 @@ -5367,42 +5369,42 @@ MMMMMM 00100 01003 00001 -, // measure 68 +, 20101 00000 00000 00000 -, // measure 69 +, 30002 00000 00000 00000 -, // measure 70 +, 02003 00000 00000 03020 -, // measure 71 +, 00230 00000 00320 00000 -, // measure 72 +, 20030 00000 00000 00000 -, // measure 73 +, 30002 00000 00000 00000 -, // measure 74 +, 02003 00000 00000 00000 -, // measure 75 +, 03020 00000 00000 @@ -5419,7 +5421,7 @@ MMMMMM 00000 02000 M0000 -, // measure 76 +, 00M00 0000M 00M00 @@ -5436,7 +5438,7 @@ M0000 0000M 00M00 M0000 -, // measure 77 +, 00M00 0000M 00M00 @@ -5453,7 +5455,7 @@ M0000 0000M 00M00 M0000 -, // measure 78 +, 00M00 0000M 00M00 @@ -5470,7 +5472,7 @@ M0000 0000M 00M00 M0000 -, // measure 79 +, 03M30 00000 00000 @@ -7011,3 +7013,444 @@ M0000 00000 00000 ; + +//---------------dance-couple - Simple Chart---------------- +#NOTEDATA:; +#CHARTNAME:Small Tribe: +#STEPSTYPE:dance-couple; +#DESCRIPTION:Simple Chart; +#CHARTSTYLE:Pad; +#DIFFICULTY:Easy; +#METER:3; +#RADARVALUES:0.253,0.362,0.095,0.419,0.000,132.000,10.000,44.000,0.000,0.000,0.000,0.000,0.000,0.253,0.362,0.095,0.419,0.000,132.000,10.000,44.000,0.000,0.000,0.000,0.000,0.000; +#CREDIT:Jason Felds; +#OFFSET:-0.028000; +#BPMS:0.000000=180.000000 +; +#STOPS:; +#DELAYS:; +#WARPS:; +#TIMESIGNATURES:0.000000=4=4 +; +#TICKCOUNTS:0.000000=2 +; +#COMBOS:0.000000=1 +; +#SPEEDS:0.000000=1.000000=0.000000=0 +; +#SCROLLS:0.000000=1.000000 +; +#FAKES:; +#LABELS:0.000000=Song Start +,16.000000=Verse 1A +,32.000000=Verse 1B +,48.000000=Verse 2A +,64.000000=Verse 2B +,80.000000=Verse 3A +,96.000000=Verse 3B +,112.000000=Verse 4A +,128.000000=Verse 4B +,144.000000=Verse 5A +,160.000000=Verse 5B +,176.000000=Verse 6A +,192.000000=Verse 6B +,208.000000=Verse 7A +,224.000000=Verse 7B +,240.000000=Verse 8A +,256.000000=Verse 8B +,272.000000=Verse 9A +,288.000000=Verse 9B +,304.000000=Fin +; +#ATTACKS:; +#NOTES: +// measure 0 +00000000 +00000000 +00000000 +00000000 +, // measure 1 +00000000 +00000000 +00000000 +00000000 +, // measure 2 +00000000 +00000000 +00000000 +00000000 +, // measure 3 +00000000 +00000000 +00000000 +00000000 +, // measure 4 +10000001 +00000000 +00000000 +00000000 +, // measure 5 +01000010 +00000000 +00000000 +00000000 +, // measure 6 +00100100 +00000000 +00000000 +00000000 +, // measure 7 +00011000 +00000000 +00000000 +00000000 +, // measure 8 +01000010 +00000000 +00000000 +00000000 +, // measure 9 +00100100 +00000000 +00000000 +00000000 +, // measure 10 +10000001 +00000000 +00000000 +00000000 +, // measure 11 +00011000 +00000000 +00000000 +00000000 +, // measure 12 +10000001 +00000000 +00100001 +00000000 +, // measure 13 +10000001 +00000000 +00100001 +00000000 +, // measure 14 +01001000 +00000000 +00011000 +00000000 +, // measure 15 +01001000 +00000000 +00011000 +00000000 +, // measure 16 +00100010 +00000000 +01000010 +00000000 +, // measure 17 +00100010 +00000000 +01000010 +00000000 +, // measure 18 +10000100 +00000000 +00010100 +00000000 +, // measure 19 +20020200 +00000000 +00000000 +30030300 +, // measure 20 +10000001 +00000000 +10000100 +00000000 +, // measure 21 +10000001 +00000000 +10000100 +00000000 +, // measure 22 +00010010 +00000000 +00011000 +00000000 +, // measure 23 +00010010 +00000000 +00011000 +00000000 +, // measure 24 +01000100 +00000000 +01000010 +00000000 +, // measure 25 +01000100 +00000000 +01000010 +00000000 +, // measure 26 +00100001 +00000000 +00101000 +00000000 +, // measure 27 +00202002 +00000000 +00000000 +00303003 +, // measure 28 +00000001 +00100000 +00000100 +00010000 +, // measure 29 +00001000 +10000000 +00000100 +00100000 +, // measure 30 +00000001 +01000000 +00000010 +00010000 +, // measure 31 +20000002 +32000203 +03200320 +00322030 +, // measure 32 +10033000 +00000100 +00100000 +00001000 +, // measure 33 +00010000 +00000001 +00100000 +00000100 +, // measure 34 +10000000 +00000010 +01000000 +00001000 +, // measure 35 +20000002 +30200023 +02300230 +03022300 +, // measure 36 +10033010 +00000000 +00011000 +00000000 +, // measure 37 +00100100 +00000000 +01000001 +00000000 +, // measure 38 +10000010 +00000000 +01000100 +00000000 +, // measure 39 +02202000 +00000000 +00000000 +03303000 +, // measure 40 +01000001 +00000000 +00011000 +00000000 +, // measure 41 +00100100 +00000000 +10000010 +00000000 +, // measure 42 +01000001 +00000000 +00100010 +00000000 +, // measure 43 +00020220 +00000000 +00000000 +00030330 +, // measure 44 +10000001 +00001000 +00010100 +00010010 +, // measure 45 +01000100 +00001000 +00100010 +00100100 +, // measure 46 +10000001 +00000010 +01000100 +01000010 +, // measure 47 +00200002 +00000000 +00000000 +00300003 +, // measure 48 +10000001 +00010000 +00101000 +01001000 +, // measure 49 +00100010 +00010000 +01000100 +00100100 +, // measure 50 +10000001 +01000000 +00100010 +01000010 +, // measure 51 +20000200 +00000000 +00000000 +30000300 +, // measure 52 +00022000 +00000000 +00000000 +20033002 +, // measure 53 +30200203 +00000000 +02300320 +00000000 +, // measure 54 +03022030 +00000000 +00000000 +00100100 +, // measure 55 +00233200 +00000000 +00000000 +00000000 +, // measure 56 +02300320 +00000000 +23000032 +00000000 +, // measure 57 +30200203 +00000000 +02300320 +00000000 +, // measure 58 +03022030 +00000000 +20033002 +00000000 +, // measure 59 +32000023 +00000000 +03200230 +00000000 +, // measure 60 +00322300 +00000000 +00000000 +00000000 +, // measure 61 +20033002 +00000000 +00000000 +00000000 +, // measure 62 +30200203 +00000000 +00000000 +01000010 +, // measure 63 +02300320 +00000000 +00000000 +00000000 +, // measure 64 +03022030 +00000000 +20033002 +00000000 +, // measure 65 +30200203 +00000000 +02300320 +00000000 +, // measure 66 +03022030 +00000000 +00233200 +00000000 +, // measure 67 +02300320 +00000000 +23000032 +00000000 +, // measure 68 +30011003 +00000000 +00000000 +00000000 +, // measure 69 +01100110 +00000000 +00000000 +00000000 +, // measure 70 +10011001 +00000000 +00000000 +10011001 +, // measure 71 +10011001 +00000000 +00000000 +00000000 +, // measure 72 +01100110 +00000000 +00000000 +00000000 +, // measure 73 +10011001 +00000000 +00000000 +00000000 +, // measure 74 +01100110 +00000000 +00000000 +00000000 +00000000 +00000000 +00000000 +20022002 +, // measure 75 +00000000 +00000000 +00000000 +00000000 +, // measure 76 +30033003 +00000000 +00000000 +00000000 +; diff --git a/src/Difficulty.cpp b/src/Difficulty.cpp index e37c5a4745..c5e3390c98 100644 --- a/src/Difficulty.cpp +++ b/src/Difficulty.cpp @@ -67,49 +67,34 @@ RString GetCustomDifficulty( StepsType st, Difficulty dc, CourseType ct ) return DifficultyToString( dc ); } - const StepsTypeInfo &sti = GAMEMAN->GetStepsTypeInfo( st ); - - switch( sti.m_StepsTypeCategory ) + if( dc == Difficulty_Edit ) { - DEFAULT_FAIL(sti.m_StepsTypeCategory); - case StepsTypeCategory_Single: - case StepsTypeCategory_Double: - if( dc == Difficulty_Edit ) + return "Edit"; + } + // OPTIMIZATION OPPORTUNITY: cache these metrics and cache the splitting + vector vsNames; + split( NAMES, ",", vsNames ); + FOREACH( RString, vsNames, sName ) + { + ThemeMetric STEPS_TYPE("CustomDifficulty",(*sName)+"StepsType"); + if( STEPS_TYPE == StepsType_Invalid || st == STEPS_TYPE ) // match { - return "Edit"; - } - else - { - // OPTIMIZATION OPPORTUNITY: cache these metrics and cache the splitting - vector vsNames; - split( NAMES, ",", vsNames ); - FOREACH( RString, vsNames, sName ) + ThemeMetric DIFFICULTY("CustomDifficulty",(*sName)+"Difficulty"); + if( DIFFICULTY == Difficulty_Invalid || dc == DIFFICULTY ) // match { - ThemeMetric STEPS_TYPE("CustomDifficulty",(*sName)+"StepsType"); - if( STEPS_TYPE == StepsType_Invalid || st == STEPS_TYPE ) // match + ThemeMetric COURSE_TYPE("CustomDifficulty",(*sName)+"CourseType"); + if( COURSE_TYPE == CourseType_Invalid || ct == COURSE_TYPE ) // match { - ThemeMetric DIFFICULTY("CustomDifficulty",(*sName)+"Difficulty"); - if( DIFFICULTY == Difficulty_Invalid || dc == DIFFICULTY ) // match - { - ThemeMetric COURSE_TYPE("CustomDifficulty",(*sName)+"CourseType"); - if( COURSE_TYPE == CourseType_Invalid || ct == COURSE_TYPE ) // match - { - ThemeMetric STRING("CustomDifficulty",(*sName)+"String"); - return STRING.GetValue(); - } - } + ThemeMetric STRING("CustomDifficulty",(*sName)+"String"); + return STRING.GetValue(); } } - // no matching CustomDifficulty, so use a regular difficulty name - if( dc == Difficulty_Invalid ) - return RString(); - return DifficultyToString( dc ); } - case StepsTypeCategory_Couple: - return "Couple"; - case StepsTypeCategory_Routine: - return "Routine"; } + // no matching CustomDifficulty, so use a regular difficulty name + if( dc == Difficulty_Invalid ) + return RString(); + return DifficultyToString( dc ); } LuaFunction( GetCustomDifficulty, GetCustomDifficulty(Enum::Check(L,1), Enum::Check(L, 2), Enum::Check(L, 3, true)) ); diff --git a/src/NotesLoaderKSF.cpp b/src/NotesLoaderKSF.cpp index 32971b9774..133096ce5d 100644 --- a/src/NotesLoaderKSF.cpp +++ b/src/NotesLoaderKSF.cpp @@ -34,7 +34,7 @@ static bool LoadFromKSFFile( const RString &sPath, Steps &out, const Song &song, // this is the value we read for TICKCOUNT int iTickCount = -1; // used to adapt weird tickcounts - float fScrollRatio = 1.0f; + //float fScrollRatio = 1.0f; -- uncomment when ready to use. vector vNoteRows; // According to Aldo_MX, there is a default BPM and it's 60. -aj diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 6009c77d02..346aaa5e11 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -757,6 +757,11 @@ static MenuDef g_InsertCourseAttack( MenuRowDef( ScreenEdit::remove, "Remove", true, EditMode_Practice, true, true, 0, "Press Start" ) ); +static MenuDef g_InsertStepAttack("ScreenMiniMenuInsertCourseAttack", + MenuRowDef( ScreenEdit::sa_duration, "Duration seconds", true, EditMode_Practice, true, false, 3, "5","10","15","20","25","30","35","40","45" ), + MenuRowDef( ScreenEdit::sa_set_mods, "Set modifiers", true, EditMode_Practice, true, true, 0, "Press Start" ), + MenuRowDef( ScreenEdit::sa_remove, "Remove", true, EditMode_Practice, true, true, 0, "Press Start" )); + static MenuDef g_CourseMode( "ScreenMiniMenuCourseDisplay", MenuRowDef( -1, "Play mods from course", true, EditMode_Practice, true, false, 0, NULL ) @@ -879,6 +884,8 @@ void ScreenEdit::Init() PO_GROUP_ASSIGN( m_PlayerStateEdit.m_PlayerOptions, ModsLevel_Stage, m_sNoteSkin, GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions.GetStage().m_sNoteSkin ); } m_PlayerStateEdit.m_PlayerOptions.FromString( ModsLevel_Stage, EDIT_MODIFIERS ); + + this->originalPlayerOptions.FromString(ModsLevel_Stage, EDIT_MODIFIERS); m_pSteps->GetNoteData( m_NoteDataEdit ); m_NoteFieldEdit.SetXY( EDIT_X, EDIT_Y ); @@ -1973,6 +1980,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) else { GAMESTATE->m_pCurSong->m_Attacks.UpdateStartTimes(fDelta); + GAMESTATE->m_pCurSong->m_fMusicSampleStartSeconds += fDelta; } SetDirty( true ); } @@ -2168,20 +2176,20 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) { const RString sDuration = ssprintf( "%.6f", attacks[index].fSecsRemaining ); - g_InsertCourseAttack.rows[remove].bEnabled = true; - if( g_InsertCourseAttack.rows[duration].choices.size() == 9 ) - g_InsertCourseAttack.rows[duration].choices.push_back( sDuration ); + g_InsertStepAttack.rows[sa_remove].bEnabled = true; + if( g_InsertStepAttack.rows[sa_duration].choices.size() == 9 ) + g_InsertStepAttack.rows[sa_duration].choices.push_back( sDuration ); else - g_InsertCourseAttack.rows[duration].choices.back() = sDuration; - g_InsertCourseAttack.rows[duration].iDefaultChoice = 9; + g_InsertStepAttack.rows[sa_duration].choices.back() = sDuration; + g_InsertStepAttack.rows[sa_duration].iDefaultChoice = 9; } else { - if( g_InsertCourseAttack.rows[duration].choices.size() == 10 ) - g_InsertCourseAttack.rows[duration].choices.pop_back(); - g_InsertCourseAttack.rows[duration].iDefaultChoice = 3; + if( g_InsertStepAttack.rows[sa_duration].choices.size() == 10 ) + g_InsertStepAttack.rows[sa_duration].choices.pop_back(); + g_InsertStepAttack.rows[sa_duration].iDefaultChoice = 3; } - EditMiniMenu( &g_InsertCourseAttack, SM_BackFromInsertStepAttack ); + EditMiniMenu( &g_InsertStepAttack, SM_BackFromInsertStepAttack ); break; } @@ -2248,9 +2256,11 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) } } + ModsGroup &toEdit = GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions; + this->originalPlayerOptions.Assign(ModsLevel_Preferred, toEdit.GetPreferred()); g_fLastInsertAttackPositionSeconds = start; g_fLastInsertAttackDurationSeconds = end - start; - GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions.Assign( ModsLevel_Stage, po ); + toEdit.Assign( ModsLevel_Stage, po ); SCREENMAN->AddNewScreenToTop( "ScreenPlayerOptions", SM_BackFromInsertStepAttackPlayerOptions ); break; } @@ -2603,6 +2613,10 @@ void ScreenEdit::InputPlay( const InputEventPlus &input, EditButton EditB ) } GetAppropriateTiming().m_fBeat0OffsetInSeconds += fOffsetDelta; + if (!GAMESTATE->m_bIsUsingStepTiming) + { + GAMESTATE->m_pCurSong->m_fMusicSampleStartSeconds += fOffsetDelta; + } } break; } @@ -3156,7 +3170,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) int iDurationChoice = ScreenMiniMenu::s_viLastAnswers[0]; TimingData &timing = GetAppropriateTiming(); g_fLastInsertAttackPositionSeconds = timing.GetElapsedTimeFromBeat( GetBeat() ); - g_fLastInsertAttackDurationSeconds = StringToFloat( g_InsertCourseAttack.rows[0].choices[iDurationChoice] ); + g_fLastInsertAttackDurationSeconds = StringToFloat( g_InsertStepAttack.rows[0].choices[iDurationChoice] ); AttackArray &attacks = GAMESTATE->m_bIsUsingStepTiming ? m_pSteps->m_Attacks : m_pSong->m_Attacks; int iAttack = FindAttackAtTime(attacks, g_fLastInsertAttackPositionSeconds); @@ -3167,11 +3181,13 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) } else { + ModsGroup &toEdit = GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions; + this->originalPlayerOptions.Assign(ModsLevel_Preferred, toEdit.GetPreferred()); PlayerOptions po; if (iAttack >= 0) po.FromString(attacks[iAttack].sModifiers); - GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions.Assign( ModsLevel_Preferred, po ); + toEdit.Assign( ModsLevel_Preferred, po ); SCREENMAN->AddNewScreenToTop( "ScreenPlayerOptions", SM_BackFromInsertStepAttackPlayerOptions ); } } @@ -3206,7 +3222,8 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) } else if (SM == SM_BackFromInsertStepAttackPlayerOptions) { - PlayerOptions poChosen = GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions.GetPreferred(); + ModsGroup &toRestore = GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions; + PlayerOptions poChosen = toRestore.GetPreferred(); RString mods = poChosen.GetString(); if (g_fLastInsertAttackPositionSeconds >= 0) @@ -3224,6 +3241,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) else attacks.push_back(a); } + toRestore.Assign(ModsLevel_Preferred, this->originalPlayerOptions.GetPreferred()); } else if( SM == SM_BackFromInsertCourseAttackPlayerOptions ) { @@ -3490,6 +3508,7 @@ static void ChangeBeat0Offset( const RString &sNew ) else { GAMESTATE->m_pCurSong->m_Attacks.UpdateStartTimes(delta); + GAMESTATE->m_pCurSong->m_fMusicSampleStartSeconds += delta; } } @@ -4134,11 +4153,13 @@ void ScreenEdit::HandleAlterMenuChoice(AlterMenuChoice c, const vector &iAn m_pSteps->m_Attacks : m_pSong->m_Attacks; int iAttack = FindAttackAtTime(attacks, start); + ModsGroup &toEdit = GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions; + this->originalPlayerOptions.Assign(ModsLevel_Preferred, toEdit.GetPreferred()); PlayerOptions po; if (iAttack >= 0) po.FromString(attacks[iAttack].sModifiers); - GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions.Assign( ModsLevel_Preferred, po ); + toEdit.Assign( ModsLevel_Preferred, po ); SCREENMAN->AddNewScreenToTop( "ScreenPlayerOptions", SM_BackFromInsertStepAttackPlayerOptions ); SetDirty(true); break; diff --git a/src/ScreenEdit.h b/src/ScreenEdit.h index 5df94954ce..6aa9954500 100644 --- a/src/ScreenEdit.h +++ b/src/ScreenEdit.h @@ -266,6 +266,9 @@ protected: BitmapText m_textInputTips; + /** @brief The player options before messing with attacks. */ + ModsGroup originalPlayerOptions; + /** * @brief Keep a backup of the present Step TimingData when * entering a playing or recording state. @@ -507,11 +510,11 @@ public: { difficulty, /**< What is the difficulty of this chart? */ meter, /**< What is the numerical rating of this chart? */ + predict_meter, /**< What does the game think this chart's rating should be? */ chartname, /**< What is the name of this chart? */ description, /**< What is the description of this chart? */ chartstyle, /**< How is this chart meant to be played? */ step_credit, /**< Who wrote this individual chart? */ - predict_meter, /**< What does the game think this chart's rating should be? */ step_display_bpm, step_min_bpm, step_max_bpm, @@ -634,6 +637,14 @@ public: remove, NUM_CourseAttackChoice }; + + enum StepAttackChoice + { + sa_duration, + sa_set_mods, + sa_remove, + NUM_StepAttackChoice + }; void InitEditMappings(); EditButton DeviceToEdit( const DeviceInput &DeviceI ) const; diff --git a/src/Song.cpp b/src/Song.cpp index 7ec55849c0..5a93c27078 100644 --- a/src/Song.cpp +++ b/src/Song.cpp @@ -41,7 +41,7 @@ * @brief The internal version of the cache for StepMania. * * Increment this value to invalidate the current cache. */ -const int FILE_CACHE_VERSION = 190; +const int FILE_CACHE_VERSION = 191; /** @brief How long does a song sample last by default? */ const float DEFAULT_MUSIC_SAMPLE_LENGTH = 12.f; diff --git a/src/Steps.cpp b/src/Steps.cpp index 3ff6c97499..5961172f93 100644 --- a/src/Steps.cpp +++ b/src/Steps.cpp @@ -225,6 +225,22 @@ void Steps::CalculateRadarValues( float fMusicLengthSeconds ) for( size_t pn = 0; pn < min(vParts.size(), size_t(NUM_PLAYERS)); ++pn ) NoteDataUtil::CalculateRadarValues( vParts[pn], fMusicLengthSeconds, m_CachedRadarValues[pn] ); } + else if (GAMEMAN->GetStepsTypeInfo(this->m_StepsType).m_StepsTypeCategory == StepsTypeCategory_Couple) + { + NoteData p1 = tempNoteData; + // XXX: Assumption that couple will always have an even number of notes. + const int tracks = tempNoteData.GetNumTracks() / 2; + p1.SetNumTracks(tracks); + NoteDataUtil::CalculateRadarValues(p1, + fMusicLengthSeconds, + m_CachedRadarValues[PLAYER_1]); + // at this point, p2 is tempNoteData. + NoteDataUtil::ShiftTracks(tempNoteData, tracks); + tempNoteData.SetNumTracks(tracks); + NoteDataUtil::CalculateRadarValues(tempNoteData, + fMusicLengthSeconds, + m_CachedRadarValues[PLAYER_2]); + } else { NoteDataUtil::CalculateRadarValues( tempNoteData, fMusicLengthSeconds, m_CachedRadarValues[0] );