From 1dd6fb8dd49d661292e2db8a1e2b89f61ad391ae Mon Sep 17 00:00:00 2001 From: MoonDroid <81515012+moondroidcoder@users.noreply.github.com> Date: Mon, 23 Jun 2025 03:10:20 +0700 Subject: [PATCH] chore: Use `Preferences.autoPause` instead of `FlxG.autoPause` --- source/funkin/play/PlayState.hx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index 890f4bc0c..5394669d7 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -1537,14 +1537,13 @@ class PlayState extends MusicBeatSubState */ public override function onFocus():Void { - if (VideoCutscene.isPlaying() && FlxG.autoPause && isGamePaused) VideoCutscene.pauseVideo(); + if (VideoCutscene.isPlaying() && Preferences.autoPause && isGamePaused) VideoCutscene.pauseVideo(); #if html5 - else - VideoCutscene.resumeVideo(); + else if (Preferences.autoPause) VideoCutscene.resumeVideo(); #end #if FEATURE_DISCORD_RPC - if (health > Constants.HEALTH_MIN && !isGamePaused && FlxG.autoPause) + if (health > Constants.HEALTH_MIN && !isGamePaused && Preferences.autoPause) { if (Conductor.instance.songPosition > 0.0) { @@ -1582,11 +1581,11 @@ class PlayState extends MusicBeatSubState public override function onFocusLost():Void { #if html5 - if (FlxG.autoPause) VideoCutscene.pauseVideo(); + if (Preferences.autoPause) VideoCutscene.pauseVideo(); #end #if FEATURE_DISCORD_RPC - if (health > Constants.HEALTH_MIN && !isGamePaused && FlxG.autoPause) + if (health > Constants.HEALTH_MIN && !isGamePaused && Preferences.autoPause) { DiscordClient.instance.setPresence( { @@ -1722,6 +1721,10 @@ class PlayState extends MusicBeatSubState funkin.util.plugins.TouchPointerPlugin.enabled = true; #end + #if !mobile + FlxG.autoPause = Preferences.autoPause; + #end + super.destroy(); }