mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-12 03:37:27 +08:00
[O] better _isPlaying detection
This commit is contained in:
@@ -8,15 +8,21 @@ namespace AquaMai.UX;
|
|||||||
public class TouchToButtonInput
|
public class TouchToButtonInput
|
||||||
{
|
{
|
||||||
private static bool _isPlaying = false;
|
private static bool _isPlaying = false;
|
||||||
|
|
||||||
[HarmonyPostfix]
|
[HarmonyPostfix]
|
||||||
[HarmonyPatch(typeof(GameProcess),"OnUpdate")]
|
[HarmonyPatch(typeof(GameProcess), "OnStart")]
|
||||||
public static void OnUpdate(GameProcess __instance)
|
public static void OnGameProcessStart(GameProcess __instance)
|
||||||
{
|
{
|
||||||
var notesManager = new NotesManager();
|
_isPlaying = true;
|
||||||
_isPlaying = notesManager.IsPlaying();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HarmonyPostfix]
|
||||||
|
[HarmonyPatch(typeof(GameProcess), "OnRelease")]
|
||||||
|
public static void OnGameProcessRelease(GameProcess __instance)
|
||||||
|
{
|
||||||
|
_isPlaying = false;
|
||||||
|
}
|
||||||
|
|
||||||
[HarmonyPostfix]
|
[HarmonyPostfix]
|
||||||
[HarmonyPatch(typeof(Manager.InputManager), "GetButtonDown")]
|
[HarmonyPatch(typeof(Manager.InputManager), "GetButtonDown")]
|
||||||
public static void GetButtonDown(ref bool __result, int monitorId, ButtonSetting button)
|
public static void GetButtonDown(ref bool __result, int monitorId, ButtonSetting button)
|
||||||
@@ -47,4 +53,4 @@ public class TouchToButtonInput
|
|||||||
if (_isPlaying || __result) return;
|
if (_isPlaying || __result) return;
|
||||||
if (button.ToString().StartsWith("Button")) __result = GetTouchPanelAreaLongPush(monitorId, (TouchPanelArea)button, msec);
|
if (button.ToString().StartsWith("Button")) __result = GetTouchPanelAreaLongPush(monitorId, (TouchPanelArea)button, msec);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user