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()