From fbc0d33d4037f3cd8879ca72ce75acf4ed522883 Mon Sep 17 00:00:00 2001 From: Clansty Date: Fri, 2 May 2025 18:02:46 +0800 Subject: [PATCH] [+] AntiLag allow running in background --- AquaMai.Mods/Utils/AntiLag.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/AquaMai.Mods/Utils/AntiLag.cs b/AquaMai.Mods/Utils/AntiLag.cs index a5ef174a..1266b254 100644 --- a/AquaMai.Mods/Utils/AntiLag.cs +++ b/AquaMai.Mods/Utils/AntiLag.cs @@ -12,6 +12,9 @@ namespace AquaMai.Mods.Utils; zh: "奇妙的防掉帧,如果你有莫名其妙的掉帧,可以试试这个")] public class AntiLag : MonoBehaviour { + [ConfigEntry(zh: "游戏未取得焦点时也运行")] + private static readonly bool activateWhileBackground = false; + [HarmonyPostfix] [HarmonyPatch(typeof(GameMainObject), "Awake")] public static void OnGameMainObjectAwake() @@ -34,7 +37,7 @@ public class AntiLag : MonoBehaviour private void OnTimer() { - if (!Application.isFocused) return; + if (!Application.isFocused && !activateWhileBackground) return; #if DEBUG MelonLogger.Msg("[AntiLag] Trigger"); #endif