From a3c85da54e1a1dc3c4662253c69c293f0800f0e4 Mon Sep 17 00:00:00 2001 From: Tyfon <29051038+tyfon7@users.noreply.github.com> Date: Mon, 20 May 2024 02:45:56 -0700 Subject: [PATCH] Rename patches for clarity --- Patches/ConfirmationDialogKeysPatch.cs | 37 ++++++++++ Patches/DialogPatches.cs | 69 ------------------- ...eAllPatch.cs => FixMailRecieveAllPatch.cs} | 2 +- .../{TooltipPatch.cs => FixTooltipPatch.cs} | 2 +- ...Patch.cs => FixWeaponBindsDisplayPatch.cs} | 2 +- Patches/FocusFleaOfferNumberPatch.cs | 29 ++++++++ ...uctionPatch.cs => HideoutSearchPatches.cs} | 26 +++---- ...tches.cs => InspectWindowResizePatches.cs} | 15 ++-- ...atches.cs => InspectWindowStatsPatches.cs} | 14 ++-- ...ionsPatch.cs => RemoveDoorActionsPatch.cs} | 2 +- Patches/ScrollPatches.cs | 20 +++--- ...nerStackPatch.cs => StackFirItemsPatch.cs} | 2 +- Patches/{SwapPatch.cs => SwapPatches.cs} | 34 ++++----- ...atches.cs => SyncScrollPositionPatches.cs} | 14 ++-- ...Patch.cs => WeaponPresetConfirmPatches.cs} | 10 +-- ...eaponZoomPatch.cs => WeaponZoomPatches.cs} | 2 +- Plugin.cs | 29 ++++---- UIFixes.Test/UnitTests.cs | 2 +- 18 files changed, 154 insertions(+), 157 deletions(-) create mode 100644 Patches/ConfirmationDialogKeysPatch.cs delete mode 100644 Patches/DialogPatches.cs rename Patches/{MailReceiveAllPatch.cs => FixMailRecieveAllPatch.cs} (92%) rename Patches/{TooltipPatch.cs => FixTooltipPatch.cs} (92%) rename Patches/{WeaponBindingPatch.cs => FixWeaponBindsDisplayPatch.cs} (96%) create mode 100644 Patches/FocusFleaOfferNumberPatch.cs rename Patches/{ProductionPatch.cs => HideoutSearchPatches.cs} (89%) rename Patches/{ItemPanelResizePatches.cs => InspectWindowResizePatches.cs} (96%) rename Patches/{ItemPanelPatches.cs => InspectWindowStatsPatches.cs} (98%) rename Patches/{DisabledActionsPatch.cs => RemoveDoorActionsPatch.cs} (95%) rename Patches/{ContainerStackPatch.cs => StackFirItemsPatch.cs} (97%) rename Patches/{SwapPatch.cs => SwapPatches.cs} (95%) rename Patches/{ScrollSyncPatches.cs => SyncScrollPositionPatches.cs} (86%) rename Patches/{EditBuildScreenPatch.cs => WeaponPresetConfirmPatches.cs} (86%) rename Patches/{WeaponZoomPatch.cs => WeaponZoomPatches.cs} (98%) diff --git a/Patches/ConfirmationDialogKeysPatch.cs b/Patches/ConfirmationDialogKeysPatch.cs new file mode 100644 index 0000000..09a3f4b --- /dev/null +++ b/Patches/ConfirmationDialogKeysPatch.cs @@ -0,0 +1,37 @@ +using Aki.Reflection.Patching; +using EFT.UI; +using HarmonyLib; +using System; +using System.Reflection; +using UnityEngine; + +namespace UIFixes +{ + public class ConfirmationDialogKeysPatch : ModulePatch + { + private static MethodInfo AcceptMethod; + + protected override MethodBase GetTargetMethod() + { + Type dialogWindowType = typeof(MessageWindow).BaseType; + AcceptMethod = AccessTools.Method(dialogWindowType, "Accept"); + + return AccessTools.Method(dialogWindowType, "Update"); + } + + [PatchPostfix] + public static void Postfix(object __instance, bool ___bool_0) + { + if (!___bool_0) + { + return; + } + + if (Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter) || Input.GetKeyDown(KeyCode.Space)) + { + AcceptMethod.Invoke(__instance, []); + return; + } + } + } +} diff --git a/Patches/DialogPatches.cs b/Patches/DialogPatches.cs deleted file mode 100644 index 7b85b7c..0000000 --- a/Patches/DialogPatches.cs +++ /dev/null @@ -1,69 +0,0 @@ -using Aki.Reflection.Patching; -using EFT.InventoryLogic; -using EFT.UI; -using EFT.UI.Ragfair; -using HarmonyLib; -using System; -using System.Linq; -using System.Reflection; -using TMPro; -using UnityEngine; - -namespace UIFixes -{ - public class DialogPatches - { - public static void Enable() - { - new DialogWindowPatch().Enable(); - new FleaPurchaseDialogPatch().Enable(); - } - - private class DialogWindowPatch : ModulePatch - { - private static MethodInfo AcceptMethod; - - protected override MethodBase GetTargetMethod() - { - Type dialogWindowType = typeof(MessageWindow).BaseType; - AcceptMethod = AccessTools.Method(dialogWindowType, "Accept"); - - return AccessTools.Method(dialogWindowType, "Update"); - } - - [PatchPostfix] - public static void Postfix(object __instance, bool ___bool_0) - { - if (!___bool_0) - { - return; - } - - if (Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter) || Input.GetKeyDown(KeyCode.Space)) - { - AcceptMethod.Invoke(__instance, []); - return; - } - } - } - - private class FleaPurchaseDialogPatch : ModulePatch - { - protected override MethodBase GetTargetMethod() - { - // The parent has a Show() so need to be specific - return AccessTools.GetDeclaredMethods(typeof(HandoverRagfairMoneyWindow)).First( - m => m.Name == nameof(HandoverRagfairMoneyWindow.Show) && - m.GetParameters()[0].ParameterType == typeof(Inventory)); - } - - [PatchPostfix] - public static void Postfix(TMP_InputField ____inputField) - { - ____inputField.contentType = TMP_InputField.ContentType.IntegerNumber; - ____inputField.ActivateInputField(); - ____inputField.Select(); - } - } - } -} diff --git a/Patches/MailReceiveAllPatch.cs b/Patches/FixMailRecieveAllPatch.cs similarity index 92% rename from Patches/MailReceiveAllPatch.cs rename to Patches/FixMailRecieveAllPatch.cs index fe7b364..0d946e5 100644 --- a/Patches/MailReceiveAllPatch.cs +++ b/Patches/FixMailRecieveAllPatch.cs @@ -6,7 +6,7 @@ using System.Reflection; namespace UIFixes { - public class MailReceiveAllPatch : ModulePatch + public class FixMailRecieveAllPatch : ModulePatch { protected override MethodBase GetTargetMethod() { diff --git a/Patches/TooltipPatch.cs b/Patches/FixTooltipPatch.cs similarity index 92% rename from Patches/TooltipPatch.cs rename to Patches/FixTooltipPatch.cs index 2b55b10..9544bdc 100644 --- a/Patches/TooltipPatch.cs +++ b/Patches/FixTooltipPatch.cs @@ -5,7 +5,7 @@ using System.Reflection; namespace UIFixes { - public class TooltipPatch : ModulePatch + public class FixTooltipPatch : ModulePatch { protected override MethodBase GetTargetMethod() { diff --git a/Patches/WeaponBindingPatch.cs b/Patches/FixWeaponBindsDisplayPatch.cs similarity index 96% rename from Patches/WeaponBindingPatch.cs rename to Patches/FixWeaponBindsDisplayPatch.cs index 71c4d48..9520db0 100644 --- a/Patches/WeaponBindingPatch.cs +++ b/Patches/FixWeaponBindsDisplayPatch.cs @@ -9,7 +9,7 @@ using System.Reflection; namespace UIFixes { - public class WeaponBindingPatch : ModulePatch + public class FixWeaponBindsDisplayPatch : ModulePatch { private static Type ControlSettingsClass; private static MethodInfo GetKeyNameMethod; diff --git a/Patches/FocusFleaOfferNumberPatch.cs b/Patches/FocusFleaOfferNumberPatch.cs new file mode 100644 index 0000000..20a0439 --- /dev/null +++ b/Patches/FocusFleaOfferNumberPatch.cs @@ -0,0 +1,29 @@ +using Aki.Reflection.Patching; +using EFT.InventoryLogic; +using EFT.UI.Ragfair; +using HarmonyLib; +using System.Linq; +using System.Reflection; +using TMPro; + +namespace UIFixes +{ + public class FocusFleaOfferNumberPatch : ModulePatch + { + protected override MethodBase GetTargetMethod() + { + // The parent has a Show() so need to be specific + return AccessTools.GetDeclaredMethods(typeof(HandoverRagfairMoneyWindow)).First( + m => m.Name == nameof(HandoverRagfairMoneyWindow.Show) && + m.GetParameters()[0].ParameterType == typeof(Inventory)); + } + + [PatchPostfix] + public static void Postfix(TMP_InputField ____inputField) + { + ____inputField.contentType = TMP_InputField.ContentType.IntegerNumber; + ____inputField.ActivateInputField(); + ____inputField.Select(); + } + } +} diff --git a/Patches/ProductionPatch.cs b/Patches/HideoutSearchPatches.cs similarity index 89% rename from Patches/ProductionPatch.cs rename to Patches/HideoutSearchPatches.cs index 7ae96f4..81b7717 100644 --- a/Patches/ProductionPatch.cs +++ b/Patches/HideoutSearchPatches.cs @@ -10,7 +10,7 @@ using UnityEngine.UI; namespace UIFixes { - public class ProductionPanelPatches + public class HideoutSearchPatches { private static FieldInfo ProductionPanelSearch; private static FieldInfo SubstrateContentLayoutField; @@ -22,16 +22,16 @@ namespace UIFixes ProductionPanelSearch = AccessTools.Field(typeof(ProductionPanel), "_searchInputField"); SubstrateContentLayoutField = AccessTools.Field(typeof(AreaScreenSubstrate), "_contentLayout"); - new LazyShowPatch().Enable(); - new ShowContentsPatch().Enable(); - new ClosePatch().Enable(); - new ReturnToPreviousStatePatch().Enable(); - new GetSortedProductsPatch().Enable(); - new OnSearchChangePatch().Enable(); + new FixHideoutSearchPatch().Enable(); + new RestoreHideoutSearchPatch().Enable(); + new SaveHideoutSearchPatch().Enable(); + new CloseHideoutSearchPatch().Enable(); + new FastHideoutSearchPatch().Enable(); + new FixHideoutSearchAgainPatch().Enable(); } // Deactivate ProduceViews as they lazy load if they don't match the search - public class LazyShowPatch : ModulePatch + public class FixHideoutSearchPatch : ModulePatch { protected override MethodBase GetTargetMethod() { @@ -56,7 +56,7 @@ namespace UIFixes } // Populate the search box, and force the window to render - public class ShowContentsPatch : ModulePatch + public class RestoreHideoutSearchPatch : ModulePatch { protected override MethodBase GetTargetMethod() @@ -91,7 +91,7 @@ namespace UIFixes } // method_4 gets the sorted list of products. If there's a search term, prioritize the matching items so they load first - public class GetSortedProductsPatch : ModulePatch + public class FastHideoutSearchPatch : ModulePatch { protected override MethodBase GetTargetMethod() { @@ -114,7 +114,7 @@ namespace UIFixes } // method_9 activates/deactivates the product game objects based on the search. Need to resort the list due to above patch - public class OnSearchChangePatch : ModulePatch + public class FixHideoutSearchAgainPatch : ModulePatch { protected override MethodBase GetTargetMethod() { @@ -129,7 +129,7 @@ namespace UIFixes } // Save the search as the window closes - public class ClosePatch : ModulePatch + public class SaveHideoutSearchPatch : ModulePatch { protected override MethodBase GetTargetMethod() { @@ -149,7 +149,7 @@ namespace UIFixes } // Clear the search stuff when you exit out - public class ReturnToPreviousStatePatch : ModulePatch + public class CloseHideoutSearchPatch : ModulePatch { protected override MethodBase GetTargetMethod() { diff --git a/Patches/ItemPanelResizePatches.cs b/Patches/InspectWindowResizePatches.cs similarity index 96% rename from Patches/ItemPanelResizePatches.cs rename to Patches/InspectWindowResizePatches.cs index 4765c69..7b1140a 100644 --- a/Patches/ItemPanelResizePatches.cs +++ b/Patches/InspectWindowResizePatches.cs @@ -11,7 +11,7 @@ using UnityEngine.UI; namespace UIFixes { - internal class ItemPanelResizePatches + internal class InspectWindowResizePatches { private static float SavedPreferredWidth = -1f; private static float SavedPreferredHeight = -1f; @@ -26,12 +26,12 @@ namespace UIFixes public static void Enable() { - new ResizeWindowPatch().Enable(); - new ShowPatch().Enable(); - new ItemUiContextInspectPatch().Enable(); + new SaveInspectWindowSizePatch().Enable(); + new AddInspectWindowButtonsPatch().Enable(); + new GrowInspectWindowDescriptionPatch().Enable(); } - private class ResizeWindowPatch : ModulePatch + private class SaveInspectWindowSizePatch : ModulePatch { protected override MethodBase GetTargetMethod() { @@ -57,9 +57,8 @@ namespace UIFixes } } - private class ShowPatch : ModulePatch + private class AddInspectWindowButtonsPatch : ModulePatch { - protected override MethodBase GetTargetMethod() { return AccessTools.Method(typeof(ItemSpecificationPanel), nameof(ItemSpecificationPanel.Show)); @@ -213,7 +212,7 @@ namespace UIFixes } } - private class ItemUiContextInspectPatch : ModulePatch + private class GrowInspectWindowDescriptionPatch : ModulePatch { protected override MethodBase GetTargetMethod() { diff --git a/Patches/ItemPanelPatches.cs b/Patches/InspectWindowStatsPatches.cs similarity index 98% rename from Patches/ItemPanelPatches.cs rename to Patches/InspectWindowStatsPatches.cs index 0bec153..c64a40d 100644 --- a/Patches/ItemPanelPatches.cs +++ b/Patches/InspectWindowStatsPatches.cs @@ -14,7 +14,7 @@ using UnityEngine; namespace UIFixes { - public class ItemPanelPatches + public class InspectWindowStatsPatches { private static FieldInfo AttributeCompactPanelDictionaryField; private static FieldInfo AttributeCompactDropdownDictionaryField; @@ -30,14 +30,14 @@ namespace UIFixes CompactCharacteristicPanelItemAttributeField = AccessTools.Field(typeof(CompactCharacteristicPanel), "ItemAttribute"); CompactCharacteristicPanelCompareItemAttributeField = AccessTools.Field(typeof(CompactCharacteristicPanel), "CompareItemAttribute"); - new InjectButtonPatch().Enable(); - new LoadModStatsPatch().Enable(); - new CompareModPatch().Enable(); + new AddShowHideModStatsButtonPatch().Enable(); + new CalculateModStatsPatch().Enable(); + new CompareModStatsPatch().Enable(); new FormatCompactValuesPatch().Enable(); new FormatFullValuesPatch().Enable(); } - private class LoadModStatsPatch : ModulePatch + private class CalculateModStatsPatch : ModulePatch { protected override MethodBase GetTargetMethod() { @@ -102,7 +102,7 @@ namespace UIFixes // I wish I could prefix method_6 and update the compare item with the deep attributes, but that only works when adding a mod // When removing, current item and compare item end up the same since current item never considers the mod anyway // So I have to forcably call the refresh values method - private class CompareModPatch : ModulePatch + private class CompareModStatsPatch : ModulePatch { private static MethodInfo RefreshStaticMethod; @@ -158,7 +158,7 @@ namespace UIFixes } } - private class InjectButtonPatch : ModulePatch + private class AddShowHideModStatsButtonPatch : ModulePatch { private static FieldInfo InteractionsButtonsContainerButtonTemplateField; private static FieldInfo InteractionsButtonsContainerContainerField; diff --git a/Patches/DisabledActionsPatch.cs b/Patches/RemoveDoorActionsPatch.cs similarity index 95% rename from Patches/DisabledActionsPatch.cs rename to Patches/RemoveDoorActionsPatch.cs index e7ef687..39eb04d 100644 --- a/Patches/DisabledActionsPatch.cs +++ b/Patches/RemoveDoorActionsPatch.cs @@ -6,7 +6,7 @@ using System.Reflection; namespace UIFixes { - public class DisabledActionsPatch : ModulePatch + public class RemoveDoorActionsPatch : ModulePatch { private static readonly string[] UnimplementedActions = ["Bang & clear", "Flash & clear", "Move in"]; diff --git a/Patches/ScrollPatches.cs b/Patches/ScrollPatches.cs index 3ee50bb..4174d87 100644 --- a/Patches/ScrollPatches.cs +++ b/Patches/ScrollPatches.cs @@ -17,11 +17,11 @@ namespace UIFixes { public static void Enable() { - new SimpleStashPanelPatch().Enable(); - new TraderDealScreenPatch().Enable(); - new OfferViewListPatch().Enable(); - new MessagesContainerPatch().Enable(); - new MouseScrollSpeedPatch().Enable(); + new EnhanceStashScrollingPatch().Enable(); + new EnchanceTraderStashScrollingPatch().Enable(); + new EnhanceFleaScrollingPatch().Enable(); + new EnhanceMailScrollingPatch().Enable(); + new MouseScrollingSpeedPatch().Enable(); } protected static void HandleInput(ScrollRect scrollRect) @@ -122,7 +122,7 @@ namespace UIFixes } } - public class SimpleStashPanelPatch : ModulePatch + public class EnhanceStashScrollingPatch : ModulePatch { protected override MethodBase GetTargetMethod() { @@ -148,7 +148,7 @@ namespace UIFixes } } - public class TraderDealScreenPatch : ModulePatch + public class EnchanceTraderStashScrollingPatch : ModulePatch { protected override MethodBase GetTargetMethod() { @@ -173,7 +173,7 @@ namespace UIFixes } } - public class OfferViewListPatch : ModulePatch + public class EnhanceFleaScrollingPatch : ModulePatch { protected override MethodBase GetTargetMethod() { @@ -198,7 +198,7 @@ namespace UIFixes } } - public class MessagesContainerPatch : ModulePatch + public class EnhanceMailScrollingPatch : ModulePatch { protected override MethodBase GetTargetMethod() { @@ -223,7 +223,7 @@ namespace UIFixes } } - public class MouseScrollSpeedPatch : ModulePatch + public class MouseScrollingSpeedPatch : ModulePatch { protected override MethodBase GetTargetMethod() { diff --git a/Patches/ContainerStackPatch.cs b/Patches/StackFirItemsPatch.cs similarity index 97% rename from Patches/ContainerStackPatch.cs rename to Patches/StackFirItemsPatch.cs index dae5ae5..810feea 100644 --- a/Patches/ContainerStackPatch.cs +++ b/Patches/StackFirItemsPatch.cs @@ -8,7 +8,7 @@ using System.Reflection; namespace UIFixes { - public class ContainerStackPatch : ModulePatch + public class StackFirItemsPatch : ModulePatch { private static Type MergeableItemType; diff --git a/Patches/SwapPatch.cs b/Patches/SwapPatches.cs similarity index 95% rename from Patches/SwapPatch.cs rename to Patches/SwapPatches.cs index 9893309..e1f6692 100644 --- a/Patches/SwapPatch.cs +++ b/Patches/SwapPatches.cs @@ -15,7 +15,7 @@ using UnityEngine.EventSystems; namespace UIFixes { - public class SwapPatch + public class SwapPatches { // Types needed private static Type GridItemAddressType; // GClass2769 @@ -66,15 +66,15 @@ namespace UIFixes GridViewNonInteractableField = AccessTools.Field(typeof(GridView), "_nonInteractable"); - new ItemViewOnDragPatch().Enable(); - new GridViewCanAcceptPatch().Enable(); - new GridGetHightLightColorPatch().Enable(); - new SlotGetHightLightColorPatch().Enable(); - new ItemContextClassCanAcceptPatch().Enable(); - new CheckItemFilterPatch().Enable(); + new DetectSwapSourceContainerPatch().Enable(); + new GridViewCanAcceptSwapPatch().Enable(); + new DetectGridHighlightPrecheckPatch().Enable(); + new DetectSlotHighlightPrecheckPatch().Enable(); + new SlotCanAcceptSwapPatch().Enable(); + new DetectFilterForSwapPatch().Enable(); new SwapOperationRaiseEventsPatch().Enable(); - new GridItemViewOnPointerEnterPatch().Enable(); - new DraggedItemContextUpdateTargetPatch().Enable(); + new RememberSwapGridHoverPatch().Enable(); + new InspectWindowUpdateStatsOnSwapPatch().Enable(); } private static bool InRaid() { @@ -166,7 +166,7 @@ namespace UIFixes return false; } - public class ItemViewOnDragPatch : ModulePatch + public class DetectSwapSourceContainerPatch : ModulePatch { protected override MethodBase GetTargetMethod() { @@ -180,7 +180,7 @@ namespace UIFixes } } - public class GridViewCanAcceptPatch : ModulePatch + public class GridViewCanAcceptSwapPatch : ModulePatch { private static FieldInfo GridViewTraderControllerClassField; @@ -364,7 +364,7 @@ namespace UIFixes } } - public class GridItemViewOnPointerEnterPatch : ModulePatch + public class RememberSwapGridHoverPatch : ModulePatch { protected override MethodBase GetTargetMethod() { @@ -380,7 +380,7 @@ namespace UIFixes // Called when dragging an item onto an equipment slot // Handles any kind of ItemAddress as the target destination (aka where the dragged item came from) - public class ItemContextClassCanAcceptPatch : ModulePatch + public class SlotCanAcceptSwapPatch : ModulePatch { protected override MethodBase GetTargetMethod() { @@ -422,7 +422,7 @@ namespace UIFixes // The patched method here is called when iterating over all slots to highlight ones that the dragged item can interact with // Since swap has no special highlight, I just skip the patch here (minor perf savings, plus makes debugging a million times easier) - public class GridGetHightLightColorPatch : ModulePatch + public class DetectGridHighlightPrecheckPatch : ModulePatch { protected override MethodBase GetTargetMethod() { @@ -444,7 +444,7 @@ namespace UIFixes // The patched method here is called when iterating over all slots to highlight ones that the dragged item can interact with // Since swap has no special highlight, I just skip the patch here (minor perf savings, plus makes debugging a million times easier) - public class SlotGetHightLightColorPatch : ModulePatch + public class DetectSlotHighlightPrecheckPatch : ModulePatch { protected override MethodBase GetTargetMethod() { @@ -467,7 +467,7 @@ namespace UIFixes // CanApply, when dealing with containers, eventually calls down into FindPlaceForItem, which calls CheckItemFilter. For reasons, // if an item fails the filters, it returns the error "no space", instead of "no action". Try to detect this, so we can swap. - public class CheckItemFilterPatch : ModulePatch + public class DetectFilterForSwapPatch : ModulePatch { protected override MethodBase GetTargetMethod() { @@ -485,7 +485,7 @@ namespace UIFixes // When dragging an item around, by default it updates an ItemSpecificationPanel when you drag an item on top of a slot // It doesn't do anything when you drag an item from a slot onto some other item elsewhere. But with swap, we should update the item panel then too. - public class DraggedItemContextUpdateTargetPatch : ModulePatch + public class InspectWindowUpdateStatsOnSwapPatch : ModulePatch { protected override MethodBase GetTargetMethod() { diff --git a/Patches/ScrollSyncPatches.cs b/Patches/SyncScrollPositionPatches.cs similarity index 86% rename from Patches/ScrollSyncPatches.cs rename to Patches/SyncScrollPositionPatches.cs index 501e9fa..a57a0e0 100644 --- a/Patches/ScrollSyncPatches.cs +++ b/Patches/SyncScrollPositionPatches.cs @@ -8,15 +8,15 @@ using UnityEngine.UI; namespace UIFixes { - public class ScrollSyncPatches + public class SyncScrollPositionPatches { private static float StashScrollPosition = 1f; public static void Enable() { - new SimpleStashPanelPatch().Enable(); - new TraderDealScreenPatch().Enable(); - new AddOfferWindowPatch().Enable(); + new SyncStashScrollPatch().Enable(); + new SyncTraderStashScrollPatch().Enable(); + new SyncOfferStashScrollPatch().Enable(); } private static void UpdateScrollPosition(Vector2 position) @@ -35,7 +35,7 @@ namespace UIFixes scrollRect.onValueChanged.AddListener(UpdateScrollPosition); } - private class SimpleStashPanelPatch : ModulePatch + private class SyncStashScrollPatch : ModulePatch { protected override MethodBase GetTargetMethod() { @@ -49,7 +49,7 @@ namespace UIFixes } } - public class TraderDealScreenPatch : ModulePatch + public class SyncTraderStashScrollPatch : ModulePatch { protected override MethodBase GetTargetMethod() { @@ -68,7 +68,7 @@ namespace UIFixes } } - public class AddOfferWindowPatch : ModulePatch + public class SyncOfferStashScrollPatch : ModulePatch { protected override MethodBase GetTargetMethod() { diff --git a/Patches/EditBuildScreenPatch.cs b/Patches/WeaponPresetConfirmPatches.cs similarity index 86% rename from Patches/EditBuildScreenPatch.cs rename to Patches/WeaponPresetConfirmPatches.cs index addf8ec..1c7e555 100644 --- a/Patches/EditBuildScreenPatch.cs +++ b/Patches/WeaponPresetConfirmPatches.cs @@ -10,18 +10,18 @@ namespace UIFixes { // Two patches are required for the edit preset screen - one to grab the value of moveForward from CloseScreenInterruption(), and one to use it. // This is because BSG didn't think to pass the argument in to method_35 - public class EditBuildScreenPatch + public class WeaponPresetConfirmPatches { public static bool MoveForward; public static void Enable() { - new CloseScreenInterruptionPatch().Enable(); - new ConfirmDiscardPatch().Enable(); + new DetectWeaponPresetCloseTypePatch().Enable(); + new ConfirmDiscardWeaponPresetChangesPatch().Enable(); } // This patch just caches whether this navigation is a forward navigation, which determines if the preset is actually closing - public class CloseScreenInterruptionPatch : ModulePatch + public class DetectWeaponPresetCloseTypePatch : ModulePatch { protected override MethodBase GetTargetMethod() { @@ -36,7 +36,7 @@ namespace UIFixes } } - public class ConfirmDiscardPatch : ModulePatch + public class ConfirmDiscardWeaponPresetChangesPatch : ModulePatch { protected override MethodBase GetTargetMethod() { diff --git a/Patches/WeaponZoomPatch.cs b/Patches/WeaponZoomPatches.cs similarity index 98% rename from Patches/WeaponZoomPatch.cs rename to Patches/WeaponZoomPatches.cs index 09d3ce1..dfc3a1c 100644 --- a/Patches/WeaponZoomPatch.cs +++ b/Patches/WeaponZoomPatches.cs @@ -9,7 +9,7 @@ using UnityEngine.EventSystems; namespace UIFixes { - public class WeaponZoomPatch + public class WeaponZoomPatches { public static void Enable() { diff --git a/Plugin.cs b/Plugin.cs index 854b0f1..754a7b9 100644 --- a/Plugin.cs +++ b/Plugin.cs @@ -9,21 +9,22 @@ namespace UIFixes { Settings.Init(Config); - EditBuildScreenPatch.Enable(); - new TransferConfirmPatch().Enable(); - new MailReceiveAllPatch().Enable(); + new ConfirmationDialogKeysPatch().Enable(); + new FixMailRecieveAllPatch().Enable(); + new FixTooltipPatch().Enable(); + new FixWeaponBindsDisplayPatch().Enable(); + new FocusFleaOfferNumberPatch().Enable(); + HideoutSearchPatches.Enable(); + InspectWindowResizePatches.Enable(); + InspectWindowStatsPatches.Enable(); + new RemoveDoorActionsPatch().Enable(); ScrollPatches.Enable(); - WeaponZoomPatch.Enable(); - new WeaponBindingPatch().Enable(); - new DisabledActionsPatch().Enable(); - SwapPatch.Enable(); - new TooltipPatch().Enable(); - ItemPanelPatches.Enable(); - new ContainerStackPatch().Enable(); - DialogPatches.Enable(); - ItemPanelResizePatches.Enable(); - ProductionPanelPatches.Enable(); - ScrollSyncPatches.Enable(); + new StackFirItemsPatch().Enable(); + SwapPatches.Enable(); + SyncScrollPositionPatches.Enable(); + new TransferConfirmPatch().Enable(); + WeaponPresetConfirmPatches.Enable(); + WeaponZoomPatches.Enable(); } } } diff --git a/UIFixes.Test/UnitTests.cs b/UIFixes.Test/UnitTests.cs index d84247f..8a38408 100644 --- a/UIFixes.Test/UnitTests.cs +++ b/UIFixes.Test/UnitTests.cs @@ -31,7 +31,7 @@ namespace UIFixes.Test foreach (var testCase in testCases) { - string result = ItemPanelPatches.RemoveTrailingZeros(testCase.Key); + string result = InspectWindowStatsPatches.RemoveTrailingZeros(testCase.Key); Assert.AreEqual(testCase.Value, result); } }