mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-11-25 21:55:55 +00:00
Merge branch 'ninjamuffin99/funk-250' into rewrite/master
This commit is contained in:
commit
6334d16984
|
|
@ -357,6 +357,11 @@ class FunkinSound extends FlxSound implements ICloneable<FunkinSound>
|
||||||
|
|
||||||
var shouldLoadPartial = params.partialParams?.loadPartial ?? false;
|
var shouldLoadPartial = params.partialParams?.loadPartial ?? false;
|
||||||
|
|
||||||
|
// even if we arent' trying to partial load a song, we want to error out any songs in progress,
|
||||||
|
// so we don't get overlapping music if someone were to load a new song while a partial one is loading!
|
||||||
|
|
||||||
|
emptyPartialQueue();
|
||||||
|
|
||||||
if (shouldLoadPartial)
|
if (shouldLoadPartial)
|
||||||
{
|
{
|
||||||
var music = FunkinSound.loadPartial(pathToUse, params.partialParams?.start ?? 0.0, params.partialParams?.end ?? 1.0, params?.startingVolume ?? 1.0,
|
var music = FunkinSound.loadPartial(pathToUse, params.partialParams?.start ?? 0.0, params.partialParams?.end ?? 1.0, params?.startingVolume ?? 1.0,
|
||||||
|
|
@ -364,12 +369,6 @@ class FunkinSound extends FlxSound implements ICloneable<FunkinSound>
|
||||||
|
|
||||||
if (music != null)
|
if (music != null)
|
||||||
{
|
{
|
||||||
while (partialQueue.length > 0)
|
|
||||||
{
|
|
||||||
@:nullSafety(Off)
|
|
||||||
partialQueue.pop().error("Cancel loading partial sound");
|
|
||||||
}
|
|
||||||
|
|
||||||
partialQueue.push(music);
|
partialQueue.push(music);
|
||||||
|
|
||||||
@:nullSafety(Off)
|
@:nullSafety(Off)
|
||||||
|
|
@ -406,6 +405,15 @@ class FunkinSound extends FlxSound implements ICloneable<FunkinSound>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function emptyPartialQueue():Void
|
||||||
|
{
|
||||||
|
while (partialQueue.length > 0)
|
||||||
|
{
|
||||||
|
@:nullSafety(Off)
|
||||||
|
partialQueue.pop().error("Cancel loading partial sound");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static var partialQueue:Array<Promise<Null<FunkinSound>>> = [];
|
static var partialQueue:Array<Promise<Null<FunkinSound>>> = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1769,6 +1769,8 @@ class FreeplayState extends MusicBeatSubState
|
||||||
funnyScroll3.visible = false;
|
funnyScroll3.visible = false;
|
||||||
|
|
||||||
new FlxTimer().start(1, function(tmr:FlxTimer) {
|
new FlxTimer().start(1, function(tmr:FlxTimer) {
|
||||||
|
FunkinSound.emptyPartialQueue();
|
||||||
|
|
||||||
Paths.setCurrentLevel(cap.songData.levelId);
|
Paths.setCurrentLevel(cap.songData.levelId);
|
||||||
LoadingState.loadPlayState(
|
LoadingState.loadPlayState(
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue