mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-02-10 21:43:06 +00:00
Merge pull request #331 from FunkinCrew/bugfix/countdown-pause-music
Fix issue with incorrect music after pausing during countdown
This commit is contained in:
commit
928f941c2f
|
@ -354,6 +354,11 @@ class PlayState extends MusicBeatSubState
|
||||||
*/
|
*/
|
||||||
var startingSong:Bool = false;
|
var startingSong:Bool = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* False if `FlxG.sound.music`
|
||||||
|
*/
|
||||||
|
var musicPausedBySubState:Bool = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* False until `create()` has completed.
|
* False until `create()` has completed.
|
||||||
*/
|
*/
|
||||||
|
@ -1042,6 +1047,7 @@ class PlayState extends MusicBeatSubState
|
||||||
// Pause the music.
|
// Pause the music.
|
||||||
if (FlxG.sound.music != null)
|
if (FlxG.sound.music != null)
|
||||||
{
|
{
|
||||||
|
musicPausedBySubState = FlxG.sound.music.playing;
|
||||||
FlxG.sound.music.pause();
|
FlxG.sound.music.pause();
|
||||||
if (vocals != null) vocals.pause();
|
if (vocals != null) vocals.pause();
|
||||||
}
|
}
|
||||||
|
@ -1049,7 +1055,6 @@ class PlayState extends MusicBeatSubState
|
||||||
// Pause the countdown.
|
// Pause the countdown.
|
||||||
Countdown.pauseCountdown();
|
Countdown.pauseCountdown();
|
||||||
}
|
}
|
||||||
else {}
|
|
||||||
|
|
||||||
super.openSubState(subState);
|
super.openSubState(subState);
|
||||||
}
|
}
|
||||||
|
@ -1069,7 +1074,10 @@ class PlayState extends MusicBeatSubState
|
||||||
if (event.eventCanceled) return;
|
if (event.eventCanceled) return;
|
||||||
|
|
||||||
// Resume
|
// Resume
|
||||||
|
if (musicPausedBySubState)
|
||||||
|
{
|
||||||
FlxG.sound.music.play(FlxG.sound.music.time);
|
FlxG.sound.music.play(FlxG.sound.music.time);
|
||||||
|
}
|
||||||
|
|
||||||
if (FlxG.sound.music != null && !startingSong && !isInCutscene) resyncVocals();
|
if (FlxG.sound.music != null && !startingSong && !isInCutscene) resyncVocals();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue