mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2025-04-21 19:31:52 -04:00
Merge 2cb32b3238
into d31ef12363
This commit is contained in:
commit
07ca0c9263
1 changed files with 35 additions and 3 deletions
|
@ -699,6 +699,11 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
|||
|
||||
// Audio
|
||||
|
||||
/**
|
||||
* This is used rather than the audiotrack time if it's higher. Low playspeeds cause the audiotrack's time to sometimes be set ~10ms before somehow.
|
||||
*/
|
||||
var oldTime:Float;
|
||||
|
||||
/**
|
||||
* Whether to play a metronome sound while the playhead is moving, and what volume.
|
||||
*/
|
||||
|
@ -3389,6 +3394,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
|||
{
|
||||
trace('Resetting instrumental time to ${- Conductor.instance.instrumentalOffset}ms');
|
||||
audioInstTrack.time = -Conductor.instance.instrumentalOffset;
|
||||
oldTime = audioInstTrack.time;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3405,14 +3411,27 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
|||
|
||||
var oldStepTime:Float = Conductor.instance.currentStepTime;
|
||||
var oldSongPosition:Float = Conductor.instance.songPosition + Conductor.instance.instrumentalOffset;
|
||||
Conductor.instance.update(audioInstTrack.time);
|
||||
// Don't go backwards in the song, only forwards
|
||||
if (oldTime < audioInstTrack.time)
|
||||
{
|
||||
Conductor.instance.update(audioInstTrack.time);
|
||||
oldTime = audioInstTrack.time;
|
||||
}
|
||||
else
|
||||
{
|
||||
Conductor.instance.update(oldTime);
|
||||
trace('oldTime was used! audioInstTrack.time ${audioInstTrack.time} < oldTime ${oldTime}');
|
||||
}
|
||||
handleHitsounds(oldSongPosition, Conductor.instance.songPosition + Conductor.instance.instrumentalOffset);
|
||||
// Resync vocals.
|
||||
if (Math.abs(audioInstTrack.time - audioVocalTrackGroup.time) > 100)
|
||||
{
|
||||
audioVocalTrackGroup.time = audioInstTrack.time;
|
||||
}
|
||||
var diffStepTime:Float = Conductor.instance.currentStepTime - oldStepTime;
|
||||
var diffStepTime:Float;
|
||||
if ((Conductor.instance.currentStepTime - oldStepTime) < 0) diffStepTime = oldStepTime - Conductor.instance.currentStepTime;
|
||||
else
|
||||
diffStepTime = Conductor.instance.currentStepTime - oldStepTime;
|
||||
|
||||
// Move the playhead.
|
||||
playheadPositionInPixels += diffStepTime * GRID_SIZE;
|
||||
|
@ -3423,7 +3442,18 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
|||
{
|
||||
// Else, move the entire view.
|
||||
var oldSongPosition:Float = Conductor.instance.songPosition + Conductor.instance.instrumentalOffset;
|
||||
Conductor.instance.update(audioInstTrack.time);
|
||||
// Don't go backwards in the song, only forwards
|
||||
if (oldTime < audioInstTrack.time)
|
||||
{
|
||||
Conductor.instance.update(audioInstTrack.time);
|
||||
oldTime = audioInstTrack.time;
|
||||
}
|
||||
else
|
||||
{
|
||||
Conductor.instance.update(oldTime);
|
||||
trace('oldTime was used! audioInstTrack.time ${audioInstTrack.time} < oldTime ${oldTime}');
|
||||
}
|
||||
|
||||
handleHitsounds(oldSongPosition, Conductor.instance.songPosition + Conductor.instance.instrumentalOffset);
|
||||
// Resync vocals.
|
||||
if (Math.abs(audioInstTrack.time - audioVocalTrackGroup.time) > 100)
|
||||
|
@ -6093,6 +6123,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
|||
// Update the songPosition in the Conductor.
|
||||
Conductor.instance.update(audioInstTrack.time);
|
||||
audioVocalTrackGroup.time = audioInstTrack.time;
|
||||
oldTime = audioInstTrack.time;
|
||||
}
|
||||
|
||||
// We need to update the note sprites because we changed the scroll position.
|
||||
|
@ -6283,6 +6314,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
|||
{
|
||||
if (audioInstTrack != null) audioInstTrack.pause();
|
||||
audioVocalTrackGroup.pause();
|
||||
oldTime = 0;
|
||||
|
||||
playbarPlay.text = '>';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue