From 8b83205b0ae04885a20949b82fe2b80cf2175354 Mon Sep 17 00:00:00 2001 From: Clansty Date: Wed, 22 May 2024 12:04:36 +0800 Subject: [PATCH] [F] Mouse input with 1P mode --- AquaMai/UX/SinglePlayer.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/AquaMai/UX/SinglePlayer.cs b/AquaMai/UX/SinglePlayer.cs index d9a5e026..f2f18ccd 100644 --- a/AquaMai/UX/SinglePlayer.cs +++ b/AquaMai/UX/SinglePlayer.cs @@ -21,12 +21,10 @@ namespace AquaMai.UX [HarmonyPrefix] [HarmonyPatch(typeof(MeshButton), "IsPointInPolygon", new Type[] { typeof(Vector2[]), typeof(Vector2) })] - public static bool IsPointInPolygon(Vector2[] polygon, ref Vector2 point) + public static bool IsPointInPolygon(Vector2[] polygon, ref Vector2 point, MeshButton __instance, ref bool __result) { - var screenWidth = Screen.width; - point = new Vector2(point.x - (screenWidth / 2), point.y); - - return true; + __result = RectTransformUtility.RectangleContainsScreenPoint(__instance.GetComponent(), point, Camera.main); + return false; } } -} +} \ No newline at end of file