mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-23 08:07:54 -05:00
Fix an issue where changing focus would pause some sounds but not others.
This commit is contained in:
parent
dd64091a99
commit
80a558ac08
1 changed files with 8 additions and 1 deletions
|
@ -223,11 +223,12 @@ class FunkinSound extends FlxSound implements ICloneable<FunkinSound>
|
||||||
// already paused before we lost focus.
|
// already paused before we lost focus.
|
||||||
if (_lostFocus && !_alreadyPaused)
|
if (_lostFocus && !_alreadyPaused)
|
||||||
{
|
{
|
||||||
|
trace('Resuming audio (${this._label}) on focus!');
|
||||||
resume();
|
resume();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
trace('Not resuming audio on focus!');
|
trace('Not resuming audio (${this._label}) on focus!');
|
||||||
}
|
}
|
||||||
_lostFocus = false;
|
_lostFocus = false;
|
||||||
}
|
}
|
||||||
|
@ -402,6 +403,12 @@ class FunkinSound extends FlxSound implements ICloneable<FunkinSound>
|
||||||
sound.group = FlxG.sound.defaultSoundGroup;
|
sound.group = FlxG.sound.defaultSoundGroup;
|
||||||
sound.persist = true;
|
sound.persist = true;
|
||||||
|
|
||||||
|
// Make sure to add the sound to the list.
|
||||||
|
// If it's already in, it won't get re-added.
|
||||||
|
// If it's not in the list (it gets removed by FunkinSound.playMusic()),
|
||||||
|
// it will get re-added (then if this was called by playMusic(), removed again)
|
||||||
|
FlxG.sound.list.add(sound);
|
||||||
|
|
||||||
// Call onLoad() because the sound already loaded
|
// Call onLoad() because the sound already loaded
|
||||||
if (onLoad != null && sound._sound != null) onLoad();
|
if (onLoad != null && sound._sound != null) onLoad();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue