From 99ed8b94d79c95c0b27c8eb50150e0ee3244861c Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Tue, 28 Nov 2023 21:44:09 -0500 Subject: [PATCH] Target the current time change rather than the first one. --- source/funkin/Conductor.hx | 8 ++++---- source/funkin/ui/debug/charting/ChartEditorState.hx | 6 +++--- source/funkin/ui/debug/latency/LatencyState.hx | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/funkin/Conductor.hx b/source/funkin/Conductor.hx index 10bf505f0..b8ded63da 100644 --- a/source/funkin/Conductor.hx +++ b/source/funkin/Conductor.hx @@ -35,15 +35,15 @@ class Conductor static var timeChanges:Array = []; /** - * The current time change. + * The most recent time change for the current song position. */ - static var currentTimeChange:SongTimeChange; + public static var currentTimeChange(default, null):SongTimeChange; /** * The current position in the song in milliseconds. - * Updated every frame based on the audio position. + * Update this every frame based on the audio position using `Conductor.update()`. */ - public static var songPosition:Float = 0; + public static var songPosition(default, null):Float = 0; /** * Beats per minute of the current song at the current time. diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index 6f0e55fb7..798631414 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -2103,13 +2103,13 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState } else { - currentSongMetadata.timeChanges[0].bpm += 1; + Conductor.currentTimeChange.bpm += 1; refreshMetadataToolbox(); } } playbarBPM.onRightClick = _ -> { - currentSongMetadata.timeChanges[0].bpm -= 1; + Conductor.currentTimeChange.bpm -= 1; refreshMetadataToolbox(); } @@ -4001,7 +4001,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState playbarNoteSnap.text = '1/${noteSnapQuant}'; playbarDifficulty.text = "Difficulty: " + selectedDifficulty.toTitleCase(); - playbarBPM.text = "BPM: " + currentSongMetadata.timeChanges[0].bpm; + playbarBPM.text = "BPM: " + Conductor.currentTimeChange.bpm; } function handlePlayhead():Void diff --git a/source/funkin/ui/debug/latency/LatencyState.hx b/source/funkin/ui/debug/latency/LatencyState.hx index 7cb18a3de..673b866f8 100644 --- a/source/funkin/ui/debug/latency/LatencyState.hx +++ b/source/funkin/ui/debug/latency/LatencyState.hx @@ -267,7 +267,7 @@ class LatencyState extends MusicBeatSubState function generateBeatStuff() { - Conductor.songPosition = swagSong.getTimeWithDiff(); + Conductor.update(swagSong.getTimeWithDiff()); var closestBeat:Int = Math.round(Conductor.songPosition / Conductor.beatLengthMs) % diffGrp.members.length; var getDiff:Float = Conductor.songPosition - (closestBeat * Conductor.beatLengthMs);