From ed47882d6c867b864a309345affd4ec393af8b01 Mon Sep 17 00:00:00 2001 From: js6pak Date: Sat, 6 Feb 2021 16:59:18 +0100 Subject: [PATCH] Reset input only if you click inside imgui --- Reactor/Extensions/GUIExtensions.cs | 2 +- Reactor/Patches/UiFocusPatch.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Reactor/Extensions/GUIExtensions.cs b/Reactor/Extensions/GUIExtensions.cs index ac97f5a..68116f1 100644 --- a/Reactor/Extensions/GUIExtensions.cs +++ b/Reactor/Extensions/GUIExtensions.cs @@ -117,7 +117,7 @@ namespace Reactor.Extensions Rect = Rect.ResetSize(); Rect = GUILayout.Window(Id, Rect, Func, Title, new Il2CppReferenceArray(0)); - if (Rect.Contains(new Vector2(Input.mousePosition.x, Screen.height - Input.mousePosition.y))) + if ((Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1)) && Rect.Contains(new Vector2(Input.mousePosition.x, Screen.height - Input.mousePosition.y))) { Input.ResetInputAxes(); } diff --git a/Reactor/Patches/UiFocusPatch.cs b/Reactor/Patches/UiFocusPatch.cs index 55094b9..eae3a22 100644 --- a/Reactor/Patches/UiFocusPatch.cs +++ b/Reactor/Patches/UiFocusPatch.cs @@ -8,7 +8,7 @@ namespace Reactor.Patches { internal static class UiFocusPatch { - // [HarmonyPatch(typeof(PassiveButtonManager), nameof(PassiveButtonManager.HandleFocus))] + // [HarmonyPatch(typeof(PassiveButtonManager), nameof(PassiveButtonManager.HandleMouseOver))] [HarmonyPatch] public static class HandleFocusPatch {