From ab948419c5a48b86c9642f37dde1a9ad649af17c Mon Sep 17 00:00:00 2001 From: KadeDeveloper Date: Wed, 11 Aug 2021 21:18:49 -0700 Subject: [PATCH] convert fnf bpm changes to ke bpm changes --- source/MusicBeatState.hx | 3 --- source/PlayState.hx | 30 +++++++++++++++++++++++++++++- source/Section.hx | 2 ++ 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/source/MusicBeatState.hx b/source/MusicBeatState.hx index dec5264..202f5ba 100644 --- a/source/MusicBeatState.hx +++ b/source/MusicBeatState.hx @@ -86,9 +86,6 @@ class MusicBeatState extends FlxUIState var step = ((60 / data.bpm) * 1000) / 4; var startInMS = (data.startTime * 1000); - - var percent = (Conductor.songPosition - startInMS) / (data.length * 1000); - curDecimalBeat = data.startBeat + (((Conductor.songPosition/1000) - data.startTime) * (data.bpm / 60)); var ste:Int = Math.floor(data.startStep + ((Conductor.songPosition - startInMS) / step)); if (ste >= 0) diff --git a/source/PlayState.hx b/source/PlayState.hx index 79d0ba6..a7f8760 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -456,6 +456,34 @@ class PlayState extends MusicBeatState SONG.eventObjects = convertedStuff; + var ba = SONG.bpm; + + var index = 0; + + trace("conversion stuff " + SONG.song + " " + SONG.notes.length); + + for(i in SONG.notes) + { + var currentBeat = 4 * index; + + var currentSeg = TimingStruct.getTimingAtBeat(currentBeat); + + if (currentSeg == null) + continue; + + var beat:Float = currentSeg.startBeat + (currentBeat - currentSeg.startBeat); + + if (i.changeBPM && i.bpm != ba) + { + trace("converting changebpm for section " + index); + ba = i.bpm; + SONG.eventObjects.push(new Song.Event("FNF BPM Change " + index,beat,i.bpm,"BPM Change")); + } + + index++; + } + + trace('INFORMATION ABOUT WHAT U PLAYIN WIT:\nFRAMES: ' + PlayStateChangeables.safeFrames + '\nZONE: ' + Conductor.safeZoneOffset + '\nTS: ' + Conductor.timeScale + '\nBotPlay : ' + PlayStateChangeables.botPlay); @@ -3748,8 +3776,8 @@ class PlayState extends MusicBeatState { if (!visibleCombos.contains(numScore)) { - numScore.destroy(); tween.cancel(); + numScore.destroy(); } }, startDelay: Conductor.crochet * 0.002 diff --git a/source/Section.hx b/source/Section.hx index fcb574a..48b1f14 100644 --- a/source/Section.hx +++ b/source/Section.hx @@ -18,6 +18,8 @@ class Section public var startTime:Float = 0; public var endTime:Float = 0; public var sectionNotes:Array> = []; + public var changeBPM:Bool = false; + public var bpm:Float = 0; public var lengthInSteps:Int = 16; public var typeOfSection:Int = 0;