[O] better _isPlaying detection
Build AquaMai / build (SDEZ) (push) Has been cancelled Details
Build AquaMai / build (SDGA145) (push) Has been cancelled Details

pull/66/head
Clansty 2024-10-13 23:54:53 +08:00
parent 4006438d93
commit bf9855abd1
No known key found for this signature in database
GPG Key ID: 3A6BE8BAF2EDE134
1 changed files with 13 additions and 7 deletions

View File

@ -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);
}
}
}