From 114df1551a37e2a001cf50ece897c51da12b76a5 Mon Sep 17 00:00:00 2001 From: Tyfon <29051038+tyfon7@users.noreply.github.com> Date: Sat, 25 May 2024 04:36:36 -0700 Subject: [PATCH] Click market prices in add offer window to set that price; close window at max offers regardless of setting; clear old price --- Patches/AddOfferClickablePricesPatches.cs | 37 ++++++++++++++++++++++ Patches/FleaPrevSearchPatches.cs | 2 -- Patches/KeepOfferWindowOpenPatches.cs | 21 +++++++++++-- Plugin.cs | 1 + R.cs | 38 +++++++++++++++++++++++ Settings.cs | 2 +- 6 files changed, 95 insertions(+), 6 deletions(-) create mode 100644 Patches/AddOfferClickablePricesPatches.cs diff --git a/Patches/AddOfferClickablePricesPatches.cs b/Patches/AddOfferClickablePricesPatches.cs new file mode 100644 index 0000000..b61c564 --- /dev/null +++ b/Patches/AddOfferClickablePricesPatches.cs @@ -0,0 +1,37 @@ +using Aki.Reflection.Patching; +using EFT.UI.Ragfair; +using HarmonyLib; +using System.Linq; +using System.Reflection; +using UnityEngine.UI; + +namespace UIFixes +{ + public class AddOfferClickablePricesPatches : ModulePatch + { + protected override MethodBase GetTargetMethod() + { + return AccessTools.Method(typeof(AddOfferWindow), nameof(AddOfferWindow.Show)); + } + + [PatchPostfix] + public static void Postfix(ItemMarketPricesPanel ____pricesPanel, RequirementView[] ____requirementViews) + { + var panel = ____pricesPanel.R(); + + var rublesRequirement = ____requirementViews.First(rv => rv.name == "Requirement (RUB)"); + + Button lowestButton = panel.LowestLabel.GetOrAddComponent