1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-08-20 07:25:59 +00:00

Target the current time change rather than the first one.

This commit is contained in:
EliteMasterEric 2023-11-28 21:44:09 -05:00
parent 21b79c0b83
commit 99ed8b94d7
3 changed files with 8 additions and 8 deletions

View file

@ -35,15 +35,15 @@ class Conductor
static var timeChanges:Array<SongTimeChange> = [];
/**
* 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.

View file

@ -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

View file

@ -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);