From 344fd9334a1a41ca083f258cd5ed2c6ce486f27f Mon Sep 17 00:00:00 2001 From: Tyfon <29051038+tyfon7@users.noreply.github.com> Date: Sat, 17 Aug 2024 00:14:30 -0700 Subject: [PATCH] Fix add offer fat scrollbar --- Patches/FixFleaPatches.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Patches/FixFleaPatches.cs b/Patches/FixFleaPatches.cs index 5190e59..c2364cf 100644 --- a/Patches/FixFleaPatches.cs +++ b/Patches/FixFleaPatches.cs @@ -19,6 +19,8 @@ public static class FixFleaPatches new ToggleOnOpenPatch().Enable(); new DropdownHeightPatch().Enable(); + new AddOfferWindowDoubleScrollPatch().Enable(); + new OfferItemFixMaskPatch().Enable(); new OfferViewTweaksPatch().Enable(); @@ -101,6 +103,28 @@ public static class FixFleaPatches } } + public class AddOfferWindowDoubleScrollPatch : ModulePatch + { + protected override MethodBase GetTargetMethod() + { + return AccessTools.Method(typeof(AddOfferWindow), nameof(AddOfferWindow.Awake)); + } + + [PatchPostfix] + public static void Postfix(AddOfferWindow __instance, GameObject ____noOfferPanel, GameObject ____selectedItemPanel) + { + // Not sure how they messed it this up, but the widths on some of these are hardcoded + // badly, so things move around + Transform stashPart = __instance.transform.Find("Inner/Contents/StashPart"); + var stashLayout = stashPart.gameObject.GetComponent(); + stashLayout.preferredWidth = 644f; + + var noItemLayout = ____noOfferPanel.GetComponent(); + var requirementLayout = ____selectedItemPanel.GetComponent(); + requirementLayout.preferredWidth = noItemLayout.preferredWidth = 450f; + } + } + public class SearchPatch : ModulePatch { protected override MethodBase GetTargetMethod()