Block snap left/right when textbox is active
This commit is contained in:
@@ -46,9 +46,7 @@ public static class ContextMenuShortcutPatches
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Settings.ItemContextBlocksTextInputs.Value &&
|
||||
EventSystem.current?.currentSelectedGameObject != null &&
|
||||
EventSystem.current.currentSelectedGameObject.GetComponent<TMP_InputField>() != null)
|
||||
if (!Settings.ItemContextBlocksTextInputs.Value && Plugin.TextboxActive())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@@ -73,6 +73,11 @@ public class GridWindowButtonsPatch : ModulePatch
|
||||
|
||||
public void Update()
|
||||
{
|
||||
if (Plugin.TextboxActive())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
bool isTopWindow = window.transform.GetSiblingIndex() == window.transform.parent.childCount - 1;
|
||||
if (Settings.SnapLeftKeybind.Value.IsDown() && isTopWindow)
|
||||
{
|
||||
|
@@ -223,9 +223,7 @@ public static class HideoutSearchPatches
|
||||
[PatchPrefix]
|
||||
public static bool Prefix(ECommand command, ref InputNode.ETranslateResult __result)
|
||||
{
|
||||
if (command == ECommand.Enter &&
|
||||
EventSystem.current?.currentSelectedGameObject != null &&
|
||||
EventSystem.current.currentSelectedGameObject.GetComponent<TMP_InputField>() != null)
|
||||
if (command == ECommand.Enter && Plugin.TextboxActive())
|
||||
{
|
||||
__result = InputNode.ETranslateResult.Block;
|
||||
return false;
|
||||
|
@@ -35,8 +35,7 @@ public static class ScrollPatches
|
||||
|
||||
private static bool HandleInput(ScrollRect scrollRect)
|
||||
{
|
||||
if (EventSystem.current?.currentSelectedGameObject != null &&
|
||||
EventSystem.current.currentSelectedGameObject.GetComponent<TMP_InputField>() != null)
|
||||
if (Plugin.TextboxActive())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@@ -2,6 +2,8 @@
|
||||
using BepInEx.Bootstrap;
|
||||
using Comfort.Common;
|
||||
using EFT;
|
||||
using TMPro;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
namespace UIFixes;
|
||||
|
||||
@@ -84,6 +86,12 @@ public class Plugin : BaseUnityPlugin
|
||||
return inRaid.HasValue && inRaid.Value;
|
||||
}
|
||||
|
||||
public static bool TextboxActive()
|
||||
{
|
||||
return EventSystem.current?.currentSelectedGameObject != null &&
|
||||
EventSystem.current.currentSelectedGameObject.GetComponent<TMP_InputField>() != null;
|
||||
}
|
||||
|
||||
private static bool? IsFikaPresent;
|
||||
|
||||
public static bool FikaPresent()
|
||||
|
Reference in New Issue
Block a user