diff --git a/AquaMai/UX/TouchToButtonInput.cs b/AquaMai/UX/TouchToButtonInput.cs index 8e62c82d..6d0c09fe 100644 --- a/AquaMai/UX/TouchToButtonInput.cs +++ b/AquaMai/UX/TouchToButtonInput.cs @@ -8,15 +8,21 @@ namespace AquaMai.UX; public class TouchToButtonInput { private static bool _isPlaying = false; - + [HarmonyPostfix] - [HarmonyPatch(typeof(GameProcess),"OnUpdate")] - public static void OnUpdate(GameProcess __instance) + [HarmonyPatch(typeof(GameProcess), "OnStart")] + public static void OnGameProcessStart(GameProcess __instance) { - var notesManager = new NotesManager(); - _isPlaying = notesManager.IsPlaying(); + _isPlaying = true; } - + + [HarmonyPostfix] + [HarmonyPatch(typeof(GameProcess), "OnRelease")] + public static void OnGameProcessRelease(GameProcess __instance) + { + _isPlaying = false; + } + [HarmonyPostfix] [HarmonyPatch(typeof(Manager.InputManager), "GetButtonDown")] public static void GetButtonDown(ref bool __result, int monitorId, ButtonSetting button) @@ -47,4 +53,4 @@ public class TouchToButtonInput if (_isPlaying || __result) return; if (button.ToString().StartsWith("Button")) __result = GetTouchPanelAreaLongPush(monitorId, (TouchPanelArea)button, msec); } -} \ No newline at end of file +}