Skip to content

Commit fbc0d33

Browse files
committed
[+] AntiLag allow running in background
1 parent b34599b commit fbc0d33

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

AquaMai.Mods/Utils/AntiLag.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ namespace AquaMai.Mods.Utils;
1212
zh: "奇妙的防掉帧,如果你有莫名其妙的掉帧,可以试试这个")]
1313
public class AntiLag : MonoBehaviour
1414
{
15+
[ConfigEntry(zh: "游戏未取得焦点时也运行")]
16+
private static readonly bool activateWhileBackground = false;
17+
1518
[HarmonyPostfix]
1619
[HarmonyPatch(typeof(GameMainObject), "Awake")]
1720
public static void OnGameMainObjectAwake()
@@ -34,7 +37,7 @@ private void Awake()
3437

3538
private void OnTimer()
3639
{
37-
if (!Application.isFocused) return;
40+
if (!Application.isFocused && !activateWhileBackground) return;
3841
#if DEBUG
3942
MelonLogger.Msg("[AntiLag] Trigger");
4043
#endif

0 commit comments

Comments
 (0)