diff --git a/Patches/ItemPanelResizePatches.cs b/Patches/ItemPanelResizePatches.cs index eb829c0..1ff8af0 100644 --- a/Patches/ItemPanelResizePatches.cs +++ b/Patches/ItemPanelResizePatches.cs @@ -1,7 +1,9 @@ using Aki.Reflection.Patching; +using EFT.InputSystem; using EFT.InventoryLogic; using EFT.UI; using HarmonyLib; +using System.Collections.Generic; using System.Linq; using System.Reflection; using UnityEngine; @@ -14,16 +16,19 @@ namespace UIFixes private static float SavedPreferredWidth = -1f; private static float SavedPreferredHeight = -1f; - // Seems like this is the default for everything? + // Seems like this is the always the default for ItemSpecificationPanels private const float DefaultPreferredWidth = 670f; private const float DefaultPreferredHeight = 500f; private const string RestoreButtonName = "Restore"; + private const float ButtonPadding = 3f; + public static void Enable() { new ResizeWindowPatch().Enable(); new ShowPatch().Enable(); + new ItemUiContextInspectPatch().Enable(); } private class ResizeWindowPatch : ModulePatch @@ -65,7 +70,7 @@ namespace UIFixes { if (Settings.RememberInspectSize.Value) { - Resize(___layoutElement_0); + RestoreSavedSize(___layoutElement_0); } } @@ -84,41 +89,100 @@ namespace UIFixes Button closeButton = __instance.GetComponentsInChildren