From a4d07ae8ab5c8ddbc3f32da0478cef22dfcb9a18 Mon Sep 17 00:00:00 2001 From: Yoshman29 <81191621+YoshiCrafter29@users.noreply.github.com> Date: Thu, 8 Dec 2022 16:42:56 +0100 Subject: [PATCH] fixed --- buildnumber.txt | 2 +- source/funkin/game/PlayState.hx | 20 +++++++++++--------- source/funkin/system/Main.hx | 10 ++++++++++ 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/buildnumber.txt b/buildnumber.txt index 28bffb95..7625ffc2 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -1431 \ No newline at end of file +1437 \ No newline at end of file diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index 1c3caf2b..8c5e9eea 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -608,6 +608,8 @@ class PlayState extends MusicBeatState inst = FlxG.sound.load(Paths.inst(PlayState.SONG.song)); vocals = FlxG.sound.list.recycle(FlxSound); + @:privateAccess + vocals.reset(); if (SONG.needsVoices) vocals.loadEmbedded(Paths.voices(PlayState.SONG.song)); FlxG.sound.list.add(vocals); @@ -790,10 +792,10 @@ class PlayState extends MusicBeatState } } #end - if (__wasAutoPause && __songPlaying) { - inst.play(); - vocals.play(); - } + // if (__wasAutoPause && __songPlaying) { + // inst.play(); + // vocals.play(); + // } super.onFocus(); } @@ -807,11 +809,11 @@ class PlayState extends MusicBeatState DiscordClient.changePresence(detailsPausedText, SONG.song + " (" + difficultyText + ")", iconRPC); } #end - if (__wasAutoPause = FlxG.autoPause) { - __songPlaying = inst.playing; - inst.pause(); - vocals.pause(); - } + // if (__wasAutoPause = FlxG.autoPause) { + // __songPlaying = inst.playing; + // inst.pause(); + // vocals.pause(); + // } super.onFocusLost(); diff --git a/source/funkin/system/Main.hx b/source/funkin/system/Main.hx index eba8af5e..c1d286c9 100644 --- a/source/funkin/system/Main.hx +++ b/source/funkin/system/Main.hx @@ -113,7 +113,17 @@ class Main extends Sprite public static var audioDisconnected:Bool = false; public static var changeID:Int = 0; + + private static var __threadCycle:Int = 0; + public static function execAsync(func:Void->Void) { + #if sys + var thread = gameThreads[(__threadCycle++) % gameThreads.length]; + thread.events.run(func); + #else + func(); + #end + } public function loadGameSettings() { #if sys