using file-scoped namespaces

This commit is contained in:
Tyfon
2024-07-12 16:17:42 -07:00
parent 29b6094b20
commit 7ea249114d
63 changed files with 8789 additions and 8855 deletions

View File

@@ -4,10 +4,10 @@ using EFT.UI.Ragfair;
using System;
using System.Collections.Generic;
namespace UIFixes.ContextMenus
namespace UIFixes;
public class EmptySlotMenu(Slot slot, ItemContextAbstractClass itemContext, ItemUiContext itemUiContext, Action closeAction) : BaseItemInfoInteractions(itemContext, itemUiContext, closeAction)
{
public class EmptySlotMenu(Slot slot, ItemContextAbstractClass itemContext, ItemUiContext itemUiContext, Action closeAction) : BaseItemInfoInteractions(itemContext, itemUiContext, closeAction)
{
private static readonly List<EItemInfoButton> Actions = [EItemInfoButton.LinkedSearch];
private readonly Slot slot = slot;
@@ -25,5 +25,4 @@ namespace UIFixes.ContextMenus
break;
}
}
}
}

View File

@@ -4,10 +4,10 @@ using System;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UIFixes.ContextMenus
namespace UIFixes;
public class EmptySlotMenuTrigger : MonoBehaviour, IPointerClickHandler, IPointerDownHandler, IPointerUpHandler, IPointerEnterHandler, IPointerExitHandler
{
public class EmptySlotMenuTrigger : MonoBehaviour, IPointerClickHandler, IPointerDownHandler, IPointerUpHandler, IPointerEnterHandler, IPointerExitHandler
{
private ItemUiContext itemUiContext;
private Slot slot;
private ItemContextAbstractClass parentContext;
@@ -57,10 +57,10 @@ namespace UIFixes.ContextMenus
}
public void OnPointerUp(PointerEventData eventData) { }
}
}
public class EmptySlotContext(Slot slot, ItemContextAbstractClass parentContext, ItemUiContext itemUiContext) : ItemContextAbstractClass(parentContext.Item, parentContext.ViewType, parentContext)
{
public class EmptySlotContext(Slot slot, ItemContextAbstractClass parentContext, ItemUiContext itemUiContext) : ItemContextAbstractClass(parentContext.Item, parentContext.ViewType, parentContext)
{
private readonly Slot slot = slot;
private readonly ItemUiContext itemUiContext = itemUiContext;
@@ -78,5 +78,4 @@ namespace UIFixes.ContextMenus
// Should never happen
throw new NotImplementedException();
}
}
}

View File

@@ -5,10 +5,10 @@ using System;
using System.Collections.Generic;
using System.Linq;
namespace UIFixes
namespace UIFixes;
public class InsuranceInteractions(IEnumerable<Item> items, ItemUiContext uiContext, int playerRubles) : ItemInfoInteractionsAbstractClass<InsuranceInteractions.EInsurers>(uiContext)
{
public class InsuranceInteractions(IEnumerable<Item> items, ItemUiContext uiContext, int playerRubles) : ItemInfoInteractionsAbstractClass<InsuranceInteractions.EInsurers>(uiContext)
{
private readonly InsuranceCompanyClass insurance = uiContext.Session.InsuranceCompany;
private readonly List<Item> items = items.ToList();
private readonly int playerRubles = playerRubles;
@@ -93,13 +93,12 @@ namespace UIFixes
{
return id.StartsWith("UIFixesInsurerId:");
}
}
}
public static class InsuranceExtensions
{
public static class InsuranceExtensions
{
public static bool IsInsuranceInteraction(this DynamicInteractionClass interaction)
{
return interaction.Id.StartsWith("UIFixesInsurerId:");
}
}
}

View File

@@ -6,10 +6,10 @@ using System;
using System.Globalization;
using System.Linq;
namespace UIFixes
namespace UIFixes;
public class RepairInteractions : ItemInfoInteractionsAbstractClass<RepairInteractions.ERepairers>
{
public class RepairInteractions : ItemInfoInteractionsAbstractClass<RepairInteractions.ERepairers>
{
private readonly RepairControllerClass repairController;
private readonly int playerRubles;
private readonly R.RepairStrategy repairStrategy;
@@ -19,7 +19,7 @@ namespace UIFixes
repairController = uiContext.Session.RepairController;
// Add empty action because otherwise RepairControllerClass.action_0 is null and it pukes on successful repair
repairController.OnSuccessfulRepairChangedEvent += () => {};
repairController.OnSuccessfulRepairChangedEvent += () => { };
this.playerRubles = playerRubles;
@@ -169,13 +169,12 @@ namespace UIFixes
{
return id.StartsWith("UIFixesRepairerId:");
}
}
}
public static class RepairExtensions
{
public static class RepairExtensions
{
public static bool IsRepairInteraction(this DynamicInteractionClass interaction)
{
return interaction.Id.StartsWith("UIFixesRepairerId:");
}
}
}

View File

@@ -2,10 +2,10 @@
using EFT.UI.DragAndDrop;
using System.Runtime.CompilerServices;
namespace UIFixes
namespace UIFixes;
public static class ExtraItemProperties
{
public static class ExtraItemProperties
{
private static readonly ConditionalWeakTable<Item, Properties> properties = new();
private class Properties
@@ -15,10 +15,10 @@ namespace UIFixes
public static bool GetReordered(this Item item) => properties.GetOrCreateValue(item).Reordered;
public static void SetReordered(this Item item, bool value) => properties.GetOrCreateValue(item).Reordered = value;
}
}
public static class ExtraTemplatedGridsViewProperties
{
public static class ExtraTemplatedGridsViewProperties
{
private static readonly ConditionalWeakTable<TemplatedGridsView, Properties> properties = new();
private class Properties
@@ -28,5 +28,4 @@ namespace UIFixes
public static bool GetReordered(this TemplatedGridsView gridsView) => properties.GetOrCreateValue(gridsView).Reordered;
public static void SetReordered(this TemplatedGridsView gridsView, bool value) => properties.GetOrCreateValue(gridsView).Reordered = value;
}
}

View File

@@ -9,10 +9,10 @@ using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
namespace UIFixes
namespace UIFixes;
public class DrawMultiSelect : MonoBehaviour
{
public class DrawMultiSelect : MonoBehaviour
{
private Texture2D selectTexture;
private Vector3 selectOrigin;
@@ -218,10 +218,10 @@ namespace UIFixes
return true;
}
}
}
public static class TransformExtensions
{
public static class TransformExtensions
{
public static bool IsDescendantOf(this Transform transform, Transform target)
{
if (transform == target)
@@ -240,5 +240,4 @@ namespace UIFixes
return false;
}
}
}

View File

@@ -5,10 +5,10 @@ using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace UIFixes
namespace UIFixes;
public static class MultiGrid
{
public static class MultiGrid
{
private static readonly Dictionary<string, Dictionary<string, Vector2Int>> GridOffsets = [];
private static readonly Dictionary<string, Dictionary<int, Dictionary<int, string>>> GridsByLocation = [];
@@ -123,5 +123,4 @@ namespace UIFixes
return lootItem.Grids.Length > 1;
}
}
}

View File

@@ -7,10 +7,10 @@ using System.Threading.Tasks;
using TMPro;
using UnityEngine;
namespace UIFixes
namespace UIFixes;
public class MultiSelect
{
public class MultiSelect
{
private static GameObject SelectedMarkTemplate = null;
private static GameObject SelectedBackgroundTemplate = null;
@@ -445,10 +445,10 @@ namespace UIFixes
selectedMark?.SetActive(false);
selectedBackground?.SetActive(false);
}
}
}
public class MultiSelectItemContext : DragItemContext
{
public class MultiSelectItemContext : DragItemContext
{
public MultiSelectItemContext(ItemContextAbstractClass itemContext, ItemRotation rotation) : base(itemContext, rotation)
{
// Adjust event handlers
@@ -501,13 +501,13 @@ namespace UIFixes
return base.CanQuickMoveTo(targetContainer);
}
}
}
// Specific type of TaskSerializer because Unity can't understand generics
public class MultiSelectItemContextTaskSerializer : TaskSerializer<MultiSelectItemContext> { }
// Specific type of TaskSerializer because Unity can't understand generics
public class MultiSelectItemContextTaskSerializer : TaskSerializer<MultiSelectItemContext> { }
public static class MultiSelectExtensions
{
public static class MultiSelectExtensions
{
public static bool IsSelectable(this ItemView itemView)
{
// Common non-interactable stuff
@@ -554,6 +554,5 @@ namespace UIFixes
}
}
}
}
}

View File

@@ -2,10 +2,10 @@
using System.Text;
using UnityEngine;
namespace UIFixes
namespace UIFixes;
public class MultiSelectDebug : MonoBehaviour
{
public class MultiSelectDebug : MonoBehaviour
{
private GUIStyle guiStyle;
private Rect guiRect = new(20, 70, 0, 0);
@@ -59,5 +59,4 @@ namespace UIFixes
GUI.Box(guiRect, guiContent, guiStyle);
}
}
}

View File

@@ -9,10 +9,10 @@ using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
namespace UIFixes
namespace UIFixes;
public static class AddOfferClickablePricesPatches
{
public static class AddOfferClickablePricesPatches
{
public static void Enable()
{
new AddButtonPatch().Enable();
@@ -94,5 +94,4 @@ namespace UIFixes
Text.color = originalColor;
}
}
}
}

View File

@@ -5,10 +5,10 @@ using SPT.Reflection.Patching;
using System.Reflection;
using UnityEngine;
namespace UIFixes
namespace UIFixes;
public static class AddOfferRememberAutoselectPatches
{
public static class AddOfferRememberAutoselectPatches
{
private static readonly string PlayerPrefKey = "UIFixes.AddOffer.AutoselectSimilar";
public static void Enable()
@@ -58,5 +58,4 @@ namespace UIFixes
}
}
}
}
}

View File

@@ -6,10 +6,10 @@ using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace UIFixes
namespace UIFixes;
public static class AimToggleHoldPatches
{
public static class AimToggleHoldPatches
{
public static void Enable()
{
new AddStatesPatch().Enable();
@@ -69,5 +69,4 @@ namespace UIFixes
__instance.method_0((KeyCombination.EKeyState)ToggleHoldState.Idle);
}
}
}
}

View File

@@ -9,10 +9,10 @@ using System.Collections.Generic;
using System.Reflection;
using System.Threading.Tasks;
namespace UIFixes
namespace UIFixes;
public class AssortUnlocksPatch : ModulePatch
{
public class AssortUnlocksPatch : ModulePatch
{
private static bool Loading = false;
private static Dictionary<string, string> AssortUnlocks = null;
@@ -61,5 +61,4 @@ namespace UIFixes
}
}
}
}
}

View File

@@ -4,10 +4,10 @@ using SPT.Reflection.Patching;
using System.Reflection;
using UnityEngine;
namespace UIFixes
namespace UIFixes;
public class AutofillQuestItemsPatch : ModulePatch
{
public class AutofillQuestItemsPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return AccessTools.DeclaredMethod(typeof(HandoverQuestItemsWindow), nameof(HandoverQuestItemsWindow.Show));
@@ -29,5 +29,4 @@ namespace UIFixes
scroller.content = scrollArea.Find("GridView")?.RectTransform();
}
}
}
}

View File

@@ -6,10 +6,10 @@ using System.Reflection;
using UnityEngine;
using UnityEngine.UI;
namespace UIFixes
namespace UIFixes;
public static class ConfirmDialogKeysPatches
{
public static class ConfirmDialogKeysPatches
{
public static void Enable()
{
new DialogWindowPatch().Enable();
@@ -221,5 +221,4 @@ namespace UIFixes
}
}
}
}
}

View File

@@ -9,13 +9,12 @@ using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using TMPro;
using UIFixes.ContextMenus;
using UnityEngine;
namespace UIFixes
namespace UIFixes;
public static class ContextMenuPatches
{
public static class ContextMenuPatches
{
private static InsuranceInteractions CurrentInsuranceInteractions = null;
private static RepairInteractions CurrentRepairInteractions = null;
private static string CreatedButtonInteractionId = null;
@@ -516,5 +515,4 @@ namespace UIFixes
return R.Money.GetMoneySums(stash.Grid.ContainedItems.Keys)[ECurrencyType.RUB];
}
}
}

View File

@@ -8,10 +8,10 @@ using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UIFixes
namespace UIFixes;
public static class ContextMenuShortcutPatches
{
public static class ContextMenuShortcutPatches
{
private static TMP_InputField LastSelectedInput = null;
public static void Enable()
@@ -220,5 +220,4 @@ namespace UIFixes
LastSelectedInput = null;
}
}
}
}

View File

@@ -6,10 +6,10 @@ using TMPro;
using UnityEngine;
using UnityEngine.UI;
namespace UIFixes
namespace UIFixes;
public static class FixFleaPatches
{
public static class FixFleaPatches
{
public static void Enable()
{
// These two are anal AF
@@ -95,5 +95,4 @@ namespace UIFixes
timeLeft.childControlWidth = false;
}
}
}
}

View File

@@ -3,10 +3,10 @@ using HarmonyLib;
using SPT.Reflection.Patching;
using System.Reflection;
namespace UIFixes
namespace UIFixes;
public class FixMailRecieveAllPatch : ModulePatch
{
public class FixMailRecieveAllPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return AccessTools.Method(typeof(ChatMessageSendBlock), nameof(ChatMessageSendBlock.Show));
@@ -18,6 +18,5 @@ namespace UIFixes
// Force this false will recalculate each time. This is less than ideal, but the way the code is structured makes it very difficult to do correctly.
dialogue.HasMessagesWithRewards = false;
}
}
}

View File

@@ -6,10 +6,10 @@ using System.Reflection;
using TMPro;
using UnityEngine;
namespace UIFixes
namespace UIFixes;
public static class FixTooltipPatches
{
public static class FixTooltipPatches
{
public static void Enable()
{
new QuestTooltipPatch().Enable();
@@ -66,5 +66,4 @@ namespace UIFixes
}
}
}
}
}

View File

@@ -4,10 +4,10 @@ using HarmonyLib;
using SPT.Reflection.Patching;
using System.Reflection;
namespace UIFixes
namespace UIFixes;
public class FixTraderControllerSimulateFalsePatch : ModulePatch
{
public class FixTraderControllerSimulateFalsePatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return AccessTools.Method(typeof(TraderControllerClass), nameof(TraderControllerClass.ExecutePossibleAction), [typeof(ItemContextAbstractClass), typeof(Item), typeof(bool), typeof(bool)]);
@@ -78,5 +78,4 @@ namespace UIFixes
__result = error;
return false;
}
}
}

View File

@@ -4,10 +4,10 @@ using SPT.Reflection.Patching;
using System.Collections.Generic;
using System.Reflection;
namespace UIFixes
namespace UIFixes;
public class FixUnloadLastBulletPatch : ModulePatch
{
public class FixUnloadLastBulletPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return AccessTools.Method(typeof(TraderControllerClass), nameof(TraderControllerClass.HasForeignEvents));
@@ -48,5 +48,4 @@ namespace UIFixes
__result = false;
return false;
}
}
}

View File

@@ -11,10 +11,10 @@ using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.UI;
namespace UIFixes
namespace UIFixes;
public static class FleaPrevSearchPatches
{
public static class FleaPrevSearchPatches
{
private class HistoryEntry
{
public FilterRule filterRule;
@@ -431,5 +431,4 @@ namespace UIFixes
one.LinkedSearchId == two.LinkedSearchId &&
one.NeededSearchId == two.NeededSearchId;
}
}
}

View File

@@ -4,10 +4,10 @@ using SPT.Reflection.Patching;
using System.Linq;
using System.Reflection;
namespace UIFixes
namespace UIFixes;
public static class FleaSlotSearchPatches
{
public static class FleaSlotSearchPatches
{
public static void Enable()
{
new HandbookWorkaroundPatch().Enable();
@@ -51,5 +51,4 @@ namespace UIFixes
}
}
}
}
}

View File

@@ -6,10 +6,10 @@ using System.Reflection;
using TMPro;
using UnityEngine;
namespace UIFixes
namespace UIFixes;
public static class FocusFleaOfferNumberPatches
{
public static class FocusFleaOfferNumberPatches
{
public static void Enable()
{
new MoneyPatch().Enable();
@@ -71,5 +71,4 @@ namespace UIFixes
}
}
}
}
}

View File

@@ -4,10 +4,10 @@ using SPT.Reflection.Patching;
using System.Reflection;
using TMPro;
namespace UIFixes
namespace UIFixes;
public class FocusTradeQuantityPatch : ModulePatch
{
public class FocusTradeQuantityPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return AccessTools.Method(typeof(BarterSchemePanel), nameof(BarterSchemePanel.method_10));
@@ -22,5 +22,4 @@ namespace UIFixes
____quantity.ActivateInputField();
____quantity.Select();
}
}
}

View File

@@ -9,10 +9,10 @@ using TMPro;
using UnityEngine;
using UnityEngine.UI;
namespace UIFixes
namespace UIFixes;
public static class GPCoinPatches
{
public static class GPCoinPatches
{
public static void Enable()
{
new MoneyPanelPatch().Enable();
@@ -121,5 +121,4 @@ namespace UIFixes
return false;
}
}
}
}

View File

@@ -6,10 +6,10 @@ using System.Reflection;
using UnityEngine;
using UnityEngine.UI;
namespace UIFixes
namespace UIFixes;
public class GridWindowButtonsPatch : ModulePatch
{
public class GridWindowButtonsPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return AccessTools.DeclaredMethod(typeof(GridWindow), nameof(GridWindow.Show));
@@ -97,5 +97,4 @@ namespace UIFixes
RectTransform inspectRect = (RectTransform)window.transform;
inspectRect.anchoredPosition = new Vector2((float)Screen.width * 3f / 4f / inspectRect.lossyScale.x, inspectRect.anchoredPosition.y);
}
}
}

View File

@@ -3,10 +3,10 @@ using HarmonyLib;
using SPT.Reflection.Patching;
using System.Reflection;
namespace UIFixes
namespace UIFixes;
public static class HideoutLevelPatches
{
public static class HideoutLevelPatches
{
private static string CurrentArea;
private static ELevelType CurrentLevel = ELevelType.NotSet;
@@ -60,7 +60,8 @@ namespace UIFixes
[PatchPrefix]
public static bool Prefix(ref ELevelType __result)
{
if (CurrentLevel != ELevelType.NotSet) {
if (CurrentLevel != ELevelType.NotSet)
{
__result = CurrentLevel;
return false;
}
@@ -83,5 +84,4 @@ namespace UIFixes
CurrentLevel = ELevelType.NotSet;
}
}
}
}

View File

@@ -11,10 +11,10 @@ using TMPro;
using UnityEngine.EventSystems;
using UnityEngine.UI;
namespace UIFixes
namespace UIFixes;
public static class HideoutSearchPatches
{
public static class HideoutSearchPatches
{
private static readonly Dictionary<string, string> LastSearches = [];
private static float LastAbsoluteDownScrollPosition = -1f;
@@ -234,5 +234,4 @@ namespace UIFixes
return true;
}
}
}
}

View File

@@ -9,10 +9,9 @@ using System.Reflection;
using UnityEngine;
using UnityEngine.UI;
namespace UIFixes
namespace UIFixes;
internal static class InspectWindowResizePatches
{
internal static class InspectWindowResizePatches
{
private static float SavedPreferredWidth = -1f;
private static float SavedPreferredHeight = -1f;
@@ -278,5 +277,4 @@ namespace UIFixes
}
}
}
}
}

View File

@@ -13,10 +13,10 @@ using TMPro;
using UnityEngine;
using UnityEngine.UI;
namespace UIFixes
namespace UIFixes;
public static class InspectWindowStatsPatches
{
public static class InspectWindowStatsPatches
{
public static void Enable()
{
new AddShowHideModStatsButtonPatch().Enable();
@@ -516,5 +516,4 @@ namespace UIFixes
// If neither matches this doesn't match and does nothing
return Regex.Replace(input, @"(?<integer>\d)((?<significantDecimals>\.[0-9]*[1-9])0*\b)?(\.0+\b)?", "${integer}${significantDecimals}");
}
}
}

View File

@@ -5,10 +5,10 @@ using HarmonyLib;
using SPT.Reflection.Patching;
using System.Reflection;
namespace UIFixes
namespace UIFixes;
public static class KeepMessagesOpenPatches
{
public static class KeepMessagesOpenPatches
{
private static bool ReopenMessages = false;
public static void Enable()
@@ -51,5 +51,4 @@ namespace UIFixes
}
}
}
}
}

View File

@@ -7,10 +7,10 @@ using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
namespace UIFixes
namespace UIFixes;
public static class KeepOfferWindowOpenPatches
{
public static class KeepOfferWindowOpenPatches
{
private static bool BlockClose = false;
private static TaskCompletionSource CompletionSource;
@@ -155,5 +155,4 @@ namespace UIFixes
return false;
}
}
}
}

View File

@@ -6,10 +6,10 @@ using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace UIFixes
namespace UIFixes;
public static class KeepWindowsOnScreenPatches
{
public static class KeepWindowsOnScreenPatches
{
public static void Enable()
{
new KeepWindowOnScreenPatch(nameof(ItemUiContext.Inspect)).Enable();
@@ -37,5 +37,4 @@ namespace UIFixes
[PatchPostfix]
public static void Postfix(List<InputNode> ____children) => FixNewestWindow(____children);
}
}
}

View File

@@ -8,10 +8,10 @@ using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
namespace UIFixes
namespace UIFixes;
public class LoadAmmoInRaidPatches
{
public class LoadAmmoInRaidPatches
{
public static void Enable()
{
new EnableContextMenuPatch().Enable();
@@ -79,5 +79,4 @@ namespace UIFixes
return false;
}
}
}
}

View File

@@ -5,10 +5,10 @@ using System;
using System.Collections.Generic;
using System.Reflection;
namespace UIFixes
namespace UIFixes;
public class LoadMagPresetsPatch : ModulePatch
{
public class LoadMagPresetsPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return AccessTools.Method(typeof(MagazineBuildPresetClass), nameof(MagazineBuildPresetClass.smethod_0));
@@ -47,5 +47,4 @@ namespace UIFixes
}
}
}
}
}

View File

@@ -9,10 +9,10 @@ using System.Reflection;
using System.Threading.Tasks;
using UnityEngine;
namespace UIFixes
namespace UIFixes;
public static class LoadMultipleMagazinesPatches
{
public static class LoadMultipleMagazinesPatches
{
private static ItemFilter[] CombinedFilters;
public static void Enable()
@@ -146,5 +146,4 @@ namespace UIFixes
return false;
}
}
}
}

View File

@@ -5,10 +5,10 @@ using System.Linq;
using System.Reflection;
using UnityEngine;
namespace UIFixes
namespace UIFixes;
public class MoveTaskbarPatch : ModulePatch
{
public class MoveTaskbarPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return AccessTools.Method(typeof(MenuTaskBar), nameof(MenuTaskBar.Awake));
@@ -21,5 +21,4 @@ namespace UIFixes
bottomPanel.localPosition = new Vector3(0f, -3f, 0f);
}
}
}

View File

@@ -17,10 +17,10 @@ using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
namespace UIFixes
namespace UIFixes;
public static class MultiSelectPatches
{
public static class MultiSelectPatches
{
// Used to prevent infinite recursion of CanAccept/AcceptItem
private static bool InPatch = false;
@@ -1374,5 +1374,4 @@ namespace UIFixes
return hoveredGridAddress;
}
}
}

View File

@@ -4,10 +4,10 @@ using System.Collections.Generic;
using System.Reflection;
using System.Reflection.Emit;
namespace UIFixes
namespace UIFixes;
public class NoRandomGrenadesPatch : ModulePatch
{
public class NoRandomGrenadesPatch : ModulePatch
{
private static NoRandomGrenadesPatch Patch;
public static void Init()
@@ -56,5 +56,4 @@ namespace UIFixes
}
}
}
}
}

View File

@@ -6,10 +6,10 @@ using System.Linq;
using System.Reflection;
using UnityEngine;
namespace UIFixes
namespace UIFixes;
public class OpenSortingTablePatch : ModulePatch
{
public class OpenSortingTablePatch : ModulePatch
{
private static readonly EItemUiContextType[] AllowedScreens = [EItemUiContextType.InventoryScreen, EItemUiContextType.ScavengerInventoryScreen];
@@ -47,5 +47,4 @@ namespace UIFixes
}
}
}
}
}

View File

@@ -7,10 +7,10 @@ using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace UIFixes
namespace UIFixes;
public class PutToolsBackPatch : ModulePatch
{
public class PutToolsBackPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return AccessTools.Method(R.ItemReceiver.Type, "method_9"); // GClass1855
@@ -69,5 +69,4 @@ namespace UIFixes
}
}
}
}
}

View File

@@ -8,10 +8,10 @@ using HarmonyLib;
using SPT.Reflection.Patching;
using System.Reflection;
namespace UIFixes
namespace UIFixes;
public static class QuickAccessPanelPatches
{
public static class QuickAccessPanelPatches
{
public static void Enable()
{
new FixWeaponBindsDisplayPatch().Enable();
@@ -101,5 +101,4 @@ namespace UIFixes
FixVisibilityPatch.Ignorable = false;
}
}
}
}

View File

@@ -7,10 +7,10 @@ using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace UIFixes
namespace UIFixes;
public class RebindGrenadesPatch : ModulePatch
{
public class RebindGrenadesPatch : ModulePatch
{
private static readonly EquipmentSlot[] Slots = [EquipmentSlot.Pockets, EquipmentSlot.TacticalVest, EquipmentSlot.Backpack, EquipmentSlot.SecuredContainer, EquipmentSlot.ArmBand];
protected override MethodBase GetTargetMethod()
@@ -44,5 +44,4 @@ namespace UIFixes
}
}
}
}
}

View File

@@ -4,10 +4,10 @@ using SPT.Reflection.Patching;
using System.Reflection;
using UnityEngine;
namespace UIFixes
namespace UIFixes;
public static class RememberRepairerPatches
{
public static class RememberRepairerPatches
{
public static void Enable()
{
new RememberRepairerPatch().Enable();
@@ -48,5 +48,4 @@ namespace UIFixes
____conditionSlider.method_1(); // like clicking >>, aka select max value
}
}
}
}

View File

@@ -4,10 +4,10 @@ using System;
using System.Linq;
using System.Reflection;
namespace UIFixes
namespace UIFixes;
public class RemoveDoorActionsPatch : ModulePatch
{
public class RemoveDoorActionsPatch : ModulePatch
{
private static readonly string[] UnimplementedActions = ["Bang & clear", "Flash & clear", "Move in"];
protected override MethodBase GetTargetMethod()
@@ -34,5 +34,4 @@ namespace UIFixes
}
}
}
}
}

View File

@@ -7,10 +7,10 @@ using System.Linq;
using System.Reflection;
using UnityEngine;
namespace UIFixes
namespace UIFixes;
public static class ReorderGridsPatches
{
public static class ReorderGridsPatches
{
public static void Enable()
{
new ReorderGridsPatch().Enable();
@@ -139,5 +139,4 @@ namespace UIFixes
__instance.SetReordered(true);
}
}
}
}

View File

@@ -13,10 +13,10 @@ using UnityEngine.Events;
using UnityEngine.EventSystems;
using UnityEngine.UI;
namespace UIFixes
namespace UIFixes;
public static class ScrollPatches
{
public static class ScrollPatches
{
public static void Enable()
{
new EnhanceStashScrollingPatch().Enable();
@@ -362,5 +362,4 @@ namespace UIFixes
}
}
}
}
}

View File

@@ -6,10 +6,10 @@ using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace UIFixes
namespace UIFixes;
public static class StackFirItemsPatches
{
public static class StackFirItemsPatches
{
public static void Enable()
{
new ContainerStackPatch().Enable();
@@ -97,5 +97,4 @@ namespace UIFixes
return false;
}
}
}
}

View File

@@ -6,10 +6,10 @@ using System.Threading;
using System.Threading.Tasks;
using UnityEngine;
namespace UIFixes
namespace UIFixes;
public static class StackMoveGreedyPatches
{
public static class StackMoveGreedyPatches
{
private static bool InPatch = false;
public static void Enable()
@@ -85,5 +85,4 @@ namespace UIFixes
return false;
}
}
}

View File

@@ -14,10 +14,10 @@ using System.Reflection;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UIFixes
namespace UIFixes;
public static class SwapPatches
{
public static class SwapPatches
{
// Source container for the drag - grab this early to check it
private static IContainer SourceContainer;
@@ -596,5 +596,4 @@ namespace UIFixes
return false;
}
}
}
}

View File

@@ -6,10 +6,10 @@ using System.Reflection;
using UnityEngine;
using UnityEngine.UI;
namespace UIFixes
namespace UIFixes;
public static class SyncScrollPositionPatches
{
public static class SyncScrollPositionPatches
{
private static float StashScrollPosition = 1f;
public static void Enable()
@@ -84,5 +84,4 @@ namespace UIFixes
SynchronizeScrollRect(__instance);
}
}
}
}

View File

@@ -7,10 +7,10 @@ using System.Reflection;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UIFixes
namespace UIFixes;
public static class TradingAutoSwitchPatches
{
public static class TradingAutoSwitchPatches
{
private static Tab BuyTab;
private static Tab SellTab;
@@ -101,5 +101,4 @@ namespace UIFixes
return true;
}
}
}
}

View File

@@ -4,10 +4,10 @@ using SPT.Reflection.Patching;
using System.Reflection;
using System.Threading.Tasks;
namespace UIFixes
namespace UIFixes;
public class TransferConfirmPatch : ModulePatch
{
public class TransferConfirmPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return AccessTools.Method(typeof(TransferItemsScreen), nameof(TransferItemsScreen.method_4));
@@ -24,6 +24,5 @@ namespace UIFixes
__result = Task.FromResult(true);
return false;
}
}
}

View File

@@ -9,10 +9,10 @@ using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
namespace UIFixes
namespace UIFixes;
public static class UnloadAmmoPatches
{
public static class UnloadAmmoPatches
{
public static void Enable()
{
new TradingPlayerPatch().Enable();
@@ -98,5 +98,4 @@ namespace UIFixes
scavController.Inventory.Stash = null;
}
}
}
}

View File

@@ -6,12 +6,11 @@ using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
namespace UIFixes
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 static class WeaponPresetConfirmPatches
{
// 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 static class WeaponPresetConfirmPatches
{
public static bool MoveForward;
public static void Enable()
@@ -60,6 +59,5 @@ namespace UIFixes
return false;
}
}
}
}

View File

@@ -5,10 +5,10 @@ using SPT.Reflection.Patching;
using System.Reflection;
using UnityEngine.EventSystems;
namespace UIFixes
namespace UIFixes;
public static class WeaponZoomPatches
{
public static class WeaponZoomPatches
{
public static void Enable()
{
new EditBuildScreenZoomPatch().Enable();
@@ -58,5 +58,4 @@ namespace UIFixes
};
}
}
}
}

View File

@@ -2,11 +2,11 @@
using Comfort.Common;
using EFT;
namespace UIFixes
namespace UIFixes;
[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
public class Plugin : BaseUnityPlugin
{
[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
public class Plugin : BaseUnityPlugin
{
public void Awake()
{
Settings.Init(Config);
@@ -70,5 +70,4 @@ namespace UIFixes
bool? inRaid = Singleton<AbstractGame>.Instance?.InRaid;
return inRaid.HasValue && inRaid.Value;
}
}
}

13
R.cs
View File

@@ -17,10 +17,10 @@ using TMPro;
using UnityEngine;
using UnityEngine.UI;
namespace UIFixes
namespace UIFixes;
public static class R
{
public static class R
{
public static void Init()
{
// Order is significant, as some reference each other
@@ -847,10 +847,10 @@ namespace UIFixes
public SimpleStashPanel SimpleStashPanel { get { return (SimpleStashPanel)SimpleStashPanelField.GetValue(Value); } }
}
}
}
public static class RExtentensions
{
public static class RExtentensions
{
public static R.UIElement R(this UIElement value) => new(value);
public static R.UIInputNode R(this UIInputNode value) => new(value);
public static R.ProductionPanel R(this ProductionPanel value) => new(value);
@@ -877,5 +877,4 @@ namespace UIFixes
public static R.TradingTableGridView R(this TradingTableGridView value) => new(value);
public static R.InventoryScreen R(this InventoryScreen value) => new(value);
public static R.ScavengerInventoryScreen R(this ScavengerInventoryScreen value) => new(value);
}
}

View File

@@ -4,41 +4,40 @@ using System.Collections.Generic;
using System.ComponentModel;
using UnityEngine;
namespace UIFixes
namespace UIFixes;
internal enum WeaponPresetConfirmationOption
{
internal enum WeaponPresetConfirmationOption
{
Never,
[Description("On Close")]
OnClose,
Always
}
}
internal enum TransferConfirmationOption
{
internal enum TransferConfirmationOption
{
Never,
Always
}
}
internal enum MultiSelectStrategy
{
internal enum MultiSelectStrategy
{
[Description("First Available Space")]
FirstOpenSpace,
[Description("Same Row or Below (Wrapping)")]
SameRowOrLower,
[Description("Keep Original Spacing (Best Effort)")]
OriginalSpacing
}
}
internal enum SortingTableDisplay
{
internal enum SortingTableDisplay
{
New,
Old,
Both
}
}
internal class Settings
{
internal class Settings
{
// Categories
private const string GeneralSection = "1. General";
private const string InputSection = "2. Input";
@@ -765,10 +764,10 @@ namespace UIFixes
}
};
}
}
}
public static class SettingExtensions
{
public static class SettingExtensions
{
public static void Subscribe<T>(this ConfigEntry<T> configEntry, Action<T> onChange)
{
configEntry.SettingChanged += (_, _) => onChange(configEntry.Value);
@@ -780,5 +779,4 @@ namespace UIFixes
configEntry.Subscribe(onChange);
onChange(configEntry.Value);
}
}
}

View File

@@ -3,10 +3,10 @@ using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine;
namespace UIFixes
namespace UIFixes;
public class TaskSerializer<T> : MonoBehaviour
{
public class TaskSerializer<T> : MonoBehaviour
{
private Func<T, Task> func;
private Func<T, bool> canContinue;
private IEnumerator<T> enumerator;
@@ -75,5 +75,4 @@ namespace UIFixes
func = null;
Destroy(this);
}
}
}

View File

@@ -1,16 +1,16 @@
using EFT.InputSystem;
namespace UIFixes
namespace UIFixes;
public enum ToggleHoldState
{
public enum ToggleHoldState
{
Idle = 13,
ClickOrHold = 14,
Holding = 15
}
}
public class ToggleHoldIdleState(KeyCombination keyCombination) : KeyCombination.KeyCombinationState(keyCombination)
{
public class ToggleHoldIdleState(KeyCombination keyCombination) : KeyCombination.KeyCombinationState(keyCombination)
{
public override ECommand GetCommand(float deltaTime)
{
if (!CanProcess())
@@ -27,10 +27,10 @@ namespace UIFixes
{
return GetKeysStatus(out EKeyPress ekeyPress) && (ekeyPress == EKeyPress.Down);
}
}
}
public class ToggleHoldClickOrHoldState(KeyCombination keyCombination) : KeyCombination.KeyCombinationState(keyCombination)
{
public class ToggleHoldClickOrHoldState(KeyCombination keyCombination) : KeyCombination.KeyCombinationState(keyCombination)
{
public override void Enter()
{
timer = KeyCombination.DoubleClickTimeout;
@@ -64,10 +64,10 @@ namespace UIFixes
}
private float timer;
}
}
public class ToggleHoldHoldState(KeyCombination keyCombination, ECommand disableCommand) : KeyCombination.KeyCombinationState(keyCombination)
{
public class ToggleHoldHoldState(KeyCombination keyCombination, ECommand disableCommand) : KeyCombination.KeyCombinationState(keyCombination)
{
private readonly ECommand disableCommand = disableCommand;
public override ECommand GetCommand(float deltaTime)
@@ -82,5 +82,4 @@ namespace UIFixes
KeyCombination.method_0((KeyCombination.EKeyState)ToggleHoldState.Idle);
return disableCommand;
}
}
}