Files
Tarkov-UIFixes/Patches/FocusFleaOfferNumberPatches.cs
2024-05-27 14:17:54 -07:00

52 lines
1.5 KiB
C#

using Aki.Reflection.Patching;
using EFT.InventoryLogic;
using EFT.UI.Ragfair;
using HarmonyLib;
using System.Linq;
using System.Reflection;
using TMPro;
namespace UIFixes
{
public static class FocusFleaOfferNumberPatches
{
public static void Enable()
{
new MoneyPatch().Enable();
new BarterPatch().Enable();
}
public class MoneyPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return AccessTools.DeclaredMethod(typeof(HandoverRagfairMoneyWindow), nameof(HandoverRagfairMoneyWindow.Show));
}
[PatchPostfix]
public static void Postfix(TMP_InputField ____inputField)
{
____inputField.contentType = TMP_InputField.ContentType.IntegerNumber;
____inputField.ActivateInputField();
____inputField.Select();
}
}
public class BarterPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return AccessTools.DeclaredMethod(typeof(HandoverExchangeableItemsWindow), nameof(HandoverExchangeableItemsWindow.Show));
}
[PatchPostfix]
public static void Postfix(TMP_InputField ____inputField)
{
____inputField.contentType = TMP_InputField.ContentType.IntegerNumber;
____inputField.ActivateInputField();
____inputField.Select();
}
}
}
}