From 476b14f9a079f958f7dcd5052acf275f6d6df03a Mon Sep 17 00:00:00 2001 From: Tyfon <29051038+tyfon7@users.noreply.github.com> Date: Fri, 26 Jul 2024 00:54:24 -0700 Subject: [PATCH] Disable scroll when in a textbox --- Patches/ScrollPatches.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Patches/ScrollPatches.cs b/Patches/ScrollPatches.cs index 9ea6d43..3093562 100644 --- a/Patches/ScrollPatches.cs +++ b/Patches/ScrollPatches.cs @@ -8,6 +8,7 @@ using SPT.Reflection.Patching; using System; using System.Collections.Generic; using System.Reflection; +using TMPro; using UnityEngine; using UnityEngine.Events; using UnityEngine.EventSystems; @@ -34,6 +35,12 @@ public static class ScrollPatches private static bool HandleInput(ScrollRect scrollRect) { + if (EventSystem.current?.currentSelectedGameObject != null && + EventSystem.current.currentSelectedGameObject.GetComponent() != null) + { + return false; + } + if (scrollRect != null) { if (Settings.UseHomeEnd.Value)