make textbox behavior configurable

This commit is contained in:
Tyfon
2024-07-03 00:01:36 -07:00
parent 7762ee05d8
commit d9c9225b2c
2 changed files with 28 additions and 0 deletions

View File

@@ -44,6 +44,14 @@ namespace UIFixes
return;
}
if (!Settings.ItemContextBlocksTextInputs.Value &&
EventSystem.current?.currentSelectedGameObject != null &&
EventSystem.current.currentSelectedGameObject.GetComponent<TMP_InputField>() != null)
{
return;
}
var interactions = __instance.GetItemContextInteractions(itemContext, null);
if (Settings.InspectKeyBind.Value.IsDown())
{
@@ -167,6 +175,11 @@ namespace UIFixes
[PatchPostfix]
public static void Postfix()
{
if (!Settings.ItemContextBlocksTextInputs.Value)
{
return;
}
if (EventSystem.current?.currentSelectedGameObject != null)
{
LastSelectedInput = EventSystem.current.currentSelectedGameObject.GetComponent<TMP_InputField>();
@@ -188,6 +201,11 @@ namespace UIFixes
[PatchPostfix]
public static void Postfix()
{
if (!Settings.ItemContextBlocksTextInputs.Value)
{
return;
}
if (LastSelectedInput != null)
{
LastSelectedInput.readOnly = false;

View File

@@ -64,6 +64,7 @@ namespace UIFixes
public static ConfigEntry<KeyboardShortcut> LinkedSearchKeyBind { get; set; }
public static ConfigEntry<bool> UseRaidMouseScrollMulti { get; set; } // Advanced
public static ConfigEntry<int> MouseScrollMultiInRaid { get; set; } // Advanced
public static ConfigEntry<bool> ItemContextBlocksTextInputs { get; set; } // Advanced
// Inventory
public static ConfigEntry<bool> EnableMultiSelect { get; set; }
@@ -300,6 +301,15 @@ namespace UIFixes
new AcceptableValueRange<int>(1, 10),
new ConfigurationManagerAttributes { IsAdvanced = true })));
configEntries.Add(ItemContextBlocksTextInputs = config.Bind(
InputSection,
"Block Text Inputs on Item Mouseover",
true,
new ConfigDescription(
"In order for keybinds to work and not get mixed up with textboxes, key presses while mousing over an item will not be sent to the currently focused textbox",
null,
new ConfigurationManagerAttributes { IsAdvanced = true })));
// Inventory
configEntries.Add(EnableMultiSelect = config.Bind(
InventorySection,