From 05d0339b626378adc718c5621ae845098addaff2 Mon Sep 17 00:00:00 2001 From: Tyfon <29051038+tyfon7@users.noreply.github.com> Date: Sun, 2 Jun 2024 15:47:02 -0700 Subject: [PATCH] Block clicks around flea purchase button; use transform.find --- Patches/FixFleaPatches.cs | 27 +++++++++++++++++++++------ Patches/FleaPrevSearchPatches.cs | 4 ++-- Patches/InspectWindowResizePatches.cs | 18 ++++++++---------- 3 files changed, 31 insertions(+), 18 deletions(-) diff --git a/Patches/FixFleaPatches.cs b/Patches/FixFleaPatches.cs index d2304c5..dbd713e 100644 --- a/Patches/FixFleaPatches.cs +++ b/Patches/FixFleaPatches.cs @@ -1,12 +1,6 @@ using Aki.Reflection.Patching; -using EFT.InventoryLogic; -using EFT.Quests; -using EFT.UI; using EFT.UI.Ragfair; using HarmonyLib; -using System; -using System.Collections.Generic; -using System.Linq; using System.Reflection; using TMPro; using UnityEngine; @@ -23,6 +17,7 @@ namespace UIFixes new ToggleOnOpenPatch().Enable(); new OfferItemFixMaskPatch().Enable(); + new BlockActionsClickThroughPatch().Enable(); } public class DoNotToggleOnMouseOverPatch : ModulePatch @@ -76,5 +71,25 @@ namespace UIFixes } } } + + public class BlockActionsClickThroughPatch : ModulePatch + { + protected override MethodBase GetTargetMethod() + { + return AccessTools.Method(typeof(OfferView), nameof(OfferView.Awake)); + } + + [PatchPostfix] + public static void Postfix(OfferView __instance) + { + // Intercept clicks on the actions area + var blocker = __instance.transform.Find("Actions").gameObject.GetOrAddComponent