From 04adaa9a9e3114016ada28ccf504f22a4bf1d5b1 Mon Sep 17 00:00:00 2001 From: Aikoyori <12034280+Aikoyori@users.noreply.github.com> Date: Fri, 28 May 2021 12:19:33 +0700 Subject: [PATCH 1/4] fix note shifting not transferring mustHitSection --- source/ChartingState.hx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/ChartingState.hx b/source/ChartingState.hx index 38d2f92..cc206ea 100644 --- a/source/ChartingState.hx +++ b/source/ChartingState.hx @@ -1301,7 +1301,7 @@ class ChartingState extends MusicBeatState updateGrid(); } - private function newSection(lengthInSteps:Int = 16):SwagSection + private function newSection(lengthInSteps:Int = 16,mustHitSection:Bool = false):SwagSection { var sec:SwagSection = { lengthInSteps: lengthInSteps, @@ -1321,20 +1321,23 @@ class ChartingState extends MusicBeatState var newSong = []; var millisecadd = (((measure*4)+step/4)*(60000/_song.bpm))+ms; + var totaladdsection = Std.int(millisecadd/60000*4); + trace(millisecadd,totaladdsection); if(millisecadd > 0) { - for(i in 0...Std.int((measure/16+step+(ms/(60000/_song.bpm)*16)))) + for(i in 0...totaladdsection) { newSong.unshift(newSection()); } } for (daSection1 in 0..._song.notes.length) { - newSong.push(newSection()); + newSong.push(newSection(16,_song.notes[daSection1].mustHitSection)); } for (daSection in 0...(_song.notes.length)) { + newSong[daSection+Std.int(Math.max(0,totaladdsection))].mustHitSection = _song.notes[daSection].mustHitSection; //trace("section "+daSection); for(daNote in 0...(_song.notes[daSection].sectionNotes.length)) { From 3eb6147f6ea152125144acfeeece44a6981cea7f Mon Sep 17 00:00:00 2001 From: Aikoyori <12034280+Aikoyori@users.noreply.github.com> Date: Fri, 28 May 2021 12:22:37 +0700 Subject: [PATCH 2/4] also apply to altAnim --- source/ChartingState.hx | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/source/ChartingState.hx b/source/ChartingState.hx index cc206ea..0de1c5e 100644 --- a/source/ChartingState.hx +++ b/source/ChartingState.hx @@ -1301,16 +1301,16 @@ class ChartingState extends MusicBeatState updateGrid(); } - private function newSection(lengthInSteps:Int = 16,mustHitSection:Bool = false):SwagSection + private function newSection(lengthInSteps:Int = 16,mustHitSection:Bool = false,altAnim:Bool = true):SwagSection { var sec:SwagSection = { lengthInSteps: lengthInSteps, bpm: _song.bpm, changeBPM: false, - mustHitSection: true, + mustHitSection: mustHitSection, sectionNotes: [], typeOfSection: 0, - altAnim: false + altAnim: altAnim }; return sec; @@ -1322,7 +1322,6 @@ class ChartingState extends MusicBeatState var millisecadd = (((measure*4)+step/4)*(60000/_song.bpm))+ms; var totaladdsection = Std.int(millisecadd/60000*4); - trace(millisecadd,totaladdsection); if(millisecadd > 0) { for(i in 0...totaladdsection) @@ -1332,19 +1331,18 @@ class ChartingState extends MusicBeatState } for (daSection1 in 0..._song.notes.length) { - newSong.push(newSection(16,_song.notes[daSection1].mustHitSection)); + newSong.push(newSection(16,_song.notes[daSection1].mustHitSection,_song.notes[daSection1].altAnim)); } for (daSection in 0...(_song.notes.length)) { - newSong[daSection+Std.int(Math.max(0,totaladdsection))].mustHitSection = _song.notes[daSection].mustHitSection; + var aimtosetsection = daSection+Std.int(Math.max(0,totaladdsection)); + newSong[aimtosetsection].mustHitSection = _song.notes[daSection].mustHitSection; + newSong[aimtosetsection].altAnim = _song.notes[daSection].altAnim; //trace("section "+daSection); for(daNote in 0...(_song.notes[daSection].sectionNotes.length)) { - //trace("note #"+daNote+" with data "+_song.notes[daSection].sectionNotes[daNote]); var newtiming = _song.notes[daSection].sectionNotes[daNote][0]+millisecadd; - //trace("newtiming",newtiming); - //trace("future section",futureSection); if(newtiming<0) { newtiming = 0; From 1911f0c6be2c4bea0c925989909483bcd0d87752 Mon Sep 17 00:00:00 2001 From: Aikoyori <12034280+Aikoyori@users.noreply.github.com> Date: Fri, 28 May 2021 12:27:31 +0700 Subject: [PATCH 3/4] wrong math im sory --- source/ChartingState.hx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/ChartingState.hx b/source/ChartingState.hx index 0de1c5e..2de2954 100644 --- a/source/ChartingState.hx +++ b/source/ChartingState.hx @@ -1321,7 +1321,8 @@ class ChartingState extends MusicBeatState var newSong = []; var millisecadd = (((measure*4)+step/4)*(60000/_song.bpm))+ms; - var totaladdsection = Std.int(millisecadd/60000*4); + var totaladdsection = Std.int(60000/millisecadd*4); + trace(millisecadd,totaladdsection); if(millisecadd > 0) { for(i in 0...totaladdsection) From 565ab02eec8c37bd5aa2cfc31ec4092bff10b49d Mon Sep 17 00:00:00 2001 From: Aikoyori <12034280+Aikoyori@users.noreply.github.com> Date: Fri, 28 May 2021 12:53:57 +0700 Subject: [PATCH 4/4] finally seems to work --- source/ChartingState.hx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/ChartingState.hx b/source/ChartingState.hx index 2de2954..a347205 100644 --- a/source/ChartingState.hx +++ b/source/ChartingState.hx @@ -1321,7 +1321,7 @@ class ChartingState extends MusicBeatState var newSong = []; var millisecadd = (((measure*4)+step/4)*(60000/_song.bpm))+ms; - var totaladdsection = Std.int(60000/millisecadd*4); + var totaladdsection = Std.int((millisecadd/(60000/_song.bpm)/4)); trace(millisecadd,totaladdsection); if(millisecadd > 0) { @@ -1337,7 +1337,8 @@ class ChartingState extends MusicBeatState for (daSection in 0...(_song.notes.length)) { - var aimtosetsection = daSection+Std.int(Math.max(0,totaladdsection)); + var aimtosetsection = daSection+Std.int((totaladdsection)); + if(aimtosetsection<0) aimtosetsection = 0; newSong[aimtosetsection].mustHitSection = _song.notes[daSection].mustHitSection; newSong[aimtosetsection].altAnim = _song.notes[daSection].altAnim; //trace("section "+daSection); @@ -1359,6 +1360,7 @@ class ChartingState extends MusicBeatState //trace("DONE BITCH"); _song.notes = newSong; updateGrid(); + updateSectionUI(); updateNoteUI(); } private function addNote(?n:Note):Void