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;
using System.Collections.Generic; 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 static readonly List<EItemInfoButton> Actions = [EItemInfoButton.LinkedSearch];
private readonly Slot slot = slot; private readonly Slot slot = slot;
@@ -25,5 +25,4 @@ namespace UIFixes.ContextMenus
break; break;
} }
} }
}
} }

View File

@@ -4,10 +4,10 @@ using System;
using UnityEngine; using UnityEngine;
using UnityEngine.EventSystems; 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 ItemUiContext itemUiContext;
private Slot slot; private Slot slot;
private ItemContextAbstractClass parentContext; private ItemContextAbstractClass parentContext;
@@ -57,10 +57,10 @@ namespace UIFixes.ContextMenus
} }
public void OnPointerUp(PointerEventData eventData) { } 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 Slot slot = slot;
private readonly ItemUiContext itemUiContext = itemUiContext; private readonly ItemUiContext itemUiContext = itemUiContext;
@@ -78,5 +78,4 @@ namespace UIFixes.ContextMenus
// Should never happen // Should never happen
throw new NotImplementedException(); throw new NotImplementedException();
} }
}
} }

View File

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

View File

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

View File

@@ -2,10 +2,10 @@
using EFT.UI.DragAndDrop; using EFT.UI.DragAndDrop;
using System.Runtime.CompilerServices; 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 static readonly ConditionalWeakTable<Item, Properties> properties = new();
private class Properties private class Properties
@@ -15,10 +15,10 @@ namespace UIFixes
public static bool GetReordered(this Item item) => properties.GetOrCreateValue(item).Reordered; 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 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 static readonly ConditionalWeakTable<TemplatedGridsView, Properties> properties = new();
private class Properties private class Properties
@@ -28,5 +28,4 @@ namespace UIFixes
public static bool GetReordered(this TemplatedGridsView gridsView) => properties.GetOrCreateValue(gridsView).Reordered; 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; 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.EventSystems;
using UnityEngine.UI; using UnityEngine.UI;
namespace UIFixes namespace UIFixes;
public class DrawMultiSelect : MonoBehaviour
{ {
public class DrawMultiSelect : MonoBehaviour
{
private Texture2D selectTexture; private Texture2D selectTexture;
private Vector3 selectOrigin; private Vector3 selectOrigin;
@@ -218,10 +218,10 @@ namespace UIFixes
return true; return true;
} }
} }
public static class TransformExtensions public static class TransformExtensions
{ {
public static bool IsDescendantOf(this Transform transform, Transform target) public static bool IsDescendantOf(this Transform transform, Transform target)
{ {
if (transform == target) if (transform == target)
@@ -240,5 +240,4 @@ namespace UIFixes
return false; return false;
} }
}
} }

View File

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

View File

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

View File

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

View File

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

View File

@@ -5,10 +5,10 @@ using SPT.Reflection.Patching;
using System.Reflection; using System.Reflection;
using UnityEngine; using UnityEngine;
namespace UIFixes namespace UIFixes;
public static class AddOfferRememberAutoselectPatches
{ {
public static class AddOfferRememberAutoselectPatches
{
private static readonly string PlayerPrefKey = "UIFixes.AddOffer.AutoselectSimilar"; private static readonly string PlayerPrefKey = "UIFixes.AddOffer.AutoselectSimilar";
public static void Enable() 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.Linq;
using System.Reflection; using System.Reflection;
namespace UIFixes namespace UIFixes;
public static class AimToggleHoldPatches
{ {
public static class AimToggleHoldPatches
{
public static void Enable() public static void Enable()
{ {
new AddStatesPatch().Enable(); new AddStatesPatch().Enable();
@@ -69,5 +69,4 @@ namespace UIFixes
__instance.method_0((KeyCombination.EKeyState)ToggleHoldState.Idle); __instance.method_0((KeyCombination.EKeyState)ToggleHoldState.Idle);
} }
} }
}
} }

View File

@@ -9,10 +9,10 @@ using System.Collections.Generic;
using System.Reflection; using System.Reflection;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace UIFixes namespace UIFixes;
public class AssortUnlocksPatch : ModulePatch
{ {
public class AssortUnlocksPatch : ModulePatch
{
private static bool Loading = false; private static bool Loading = false;
private static Dictionary<string, string> AssortUnlocks = null; 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 System.Reflection;
using UnityEngine; using UnityEngine;
namespace UIFixes namespace UIFixes;
public class AutofillQuestItemsPatch : ModulePatch
{ {
public class AutofillQuestItemsPatch : ModulePatch
{
protected override MethodBase GetTargetMethod() protected override MethodBase GetTargetMethod()
{ {
return AccessTools.DeclaredMethod(typeof(HandoverQuestItemsWindow), nameof(HandoverQuestItemsWindow.Show)); return AccessTools.DeclaredMethod(typeof(HandoverQuestItemsWindow), nameof(HandoverQuestItemsWindow.Show));
@@ -29,5 +29,4 @@ namespace UIFixes
scroller.content = scrollArea.Find("GridView")?.RectTransform(); scroller.content = scrollArea.Find("GridView")?.RectTransform();
} }
} }
}
} }

View File

@@ -6,10 +6,10 @@ using System.Reflection;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
namespace UIFixes namespace UIFixes;
public static class ConfirmDialogKeysPatches
{ {
public static class ConfirmDialogKeysPatches
{
public static void Enable() public static void Enable()
{ {
new DialogWindowPatch().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.Linq;
using System.Reflection; using System.Reflection;
using TMPro; using TMPro;
using UIFixes.ContextMenus;
using UnityEngine; using UnityEngine;
namespace UIFixes namespace UIFixes;
public static class ContextMenuPatches
{ {
public static class ContextMenuPatches
{
private static InsuranceInteractions CurrentInsuranceInteractions = null; private static InsuranceInteractions CurrentInsuranceInteractions = null;
private static RepairInteractions CurrentRepairInteractions = null; private static RepairInteractions CurrentRepairInteractions = null;
private static string CreatedButtonInteractionId = null; private static string CreatedButtonInteractionId = null;
@@ -516,5 +515,4 @@ namespace UIFixes
return R.Money.GetMoneySums(stash.Grid.ContainedItems.Keys)[ECurrencyType.RUB]; return R.Money.GetMoneySums(stash.Grid.ContainedItems.Keys)[ECurrencyType.RUB];
} }
}
} }

View File

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

View File

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

View File

@@ -3,10 +3,10 @@ using HarmonyLib;
using SPT.Reflection.Patching; using SPT.Reflection.Patching;
using System.Reflection; using System.Reflection;
namespace UIFixes namespace UIFixes;
public class FixMailRecieveAllPatch : ModulePatch
{ {
public class FixMailRecieveAllPatch : ModulePatch
{
protected override MethodBase GetTargetMethod() protected override MethodBase GetTargetMethod()
{ {
return AccessTools.Method(typeof(ChatMessageSendBlock), nameof(ChatMessageSendBlock.Show)); 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. // 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; dialogue.HasMessagesWithRewards = false;
} }
}
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -6,10 +6,10 @@ using System.Reflection;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
namespace UIFixes namespace UIFixes;
public class GridWindowButtonsPatch : ModulePatch
{ {
public class GridWindowButtonsPatch : ModulePatch
{
protected override MethodBase GetTargetMethod() protected override MethodBase GetTargetMethod()
{ {
return AccessTools.DeclaredMethod(typeof(GridWindow), nameof(GridWindow.Show)); return AccessTools.DeclaredMethod(typeof(GridWindow), nameof(GridWindow.Show));
@@ -97,5 +97,4 @@ namespace UIFixes
RectTransform inspectRect = (RectTransform)window.transform; RectTransform inspectRect = (RectTransform)window.transform;
inspectRect.anchoredPosition = new Vector2((float)Screen.width * 3f / 4f / inspectRect.lossyScale.x, inspectRect.anchoredPosition.y); 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 SPT.Reflection.Patching;
using System.Reflection; using System.Reflection;
namespace UIFixes namespace UIFixes;
public static class HideoutLevelPatches
{ {
public static class HideoutLevelPatches
{
private static string CurrentArea; private static string CurrentArea;
private static ELevelType CurrentLevel = ELevelType.NotSet; private static ELevelType CurrentLevel = ELevelType.NotSet;
@@ -60,7 +60,8 @@ namespace UIFixes
[PatchPrefix] [PatchPrefix]
public static bool Prefix(ref ELevelType __result) public static bool Prefix(ref ELevelType __result)
{ {
if (CurrentLevel != ELevelType.NotSet) { if (CurrentLevel != ELevelType.NotSet)
{
__result = CurrentLevel; __result = CurrentLevel;
return false; return false;
} }
@@ -83,5 +84,4 @@ namespace UIFixes
CurrentLevel = ELevelType.NotSet; CurrentLevel = ELevelType.NotSet;
} }
} }
}
} }

View File

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

View File

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

View File

@@ -13,10 +13,10 @@ using TMPro;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
namespace UIFixes namespace UIFixes;
public static class InspectWindowStatsPatches
{ {
public static class InspectWindowStatsPatches
{
public static void Enable() public static void Enable()
{ {
new AddShowHideModStatsButtonPatch().Enable(); new AddShowHideModStatsButtonPatch().Enable();
@@ -516,5 +516,4 @@ namespace UIFixes
// If neither matches this doesn't match and does nothing // 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}"); 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 SPT.Reflection.Patching;
using System.Reflection; using System.Reflection;
namespace UIFixes namespace UIFixes;
public static class KeepMessagesOpenPatches
{ {
public static class KeepMessagesOpenPatches
{
private static bool ReopenMessages = false; private static bool ReopenMessages = false;
public static void Enable() public static void Enable()
@@ -51,5 +51,4 @@ namespace UIFixes
} }
} }
} }
}
} }

View File

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

View File

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

View File

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

View File

@@ -5,10 +5,10 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection; using System.Reflection;
namespace UIFixes namespace UIFixes;
public class LoadMagPresetsPatch : ModulePatch
{ {
public class LoadMagPresetsPatch : ModulePatch
{
protected override MethodBase GetTargetMethod() protected override MethodBase GetTargetMethod()
{ {
return AccessTools.Method(typeof(MagazineBuildPresetClass), nameof(MagazineBuildPresetClass.smethod_0)); 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 System.Threading.Tasks;
using UnityEngine; using UnityEngine;
namespace UIFixes namespace UIFixes;
public static class LoadMultipleMagazinesPatches
{ {
public static class LoadMultipleMagazinesPatches
{
private static ItemFilter[] CombinedFilters; private static ItemFilter[] CombinedFilters;
public static void Enable() public static void Enable()
@@ -146,5 +146,4 @@ namespace UIFixes
return false; return false;
} }
} }
}
} }

View File

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

View File

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

View File

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

View File

@@ -6,10 +6,10 @@ using System.Linq;
using System.Reflection; using System.Reflection;
using UnityEngine; using UnityEngine;
namespace UIFixes namespace UIFixes;
public class OpenSortingTablePatch : ModulePatch
{ {
public class OpenSortingTablePatch : ModulePatch
{
private static readonly EItemUiContextType[] AllowedScreens = [EItemUiContextType.InventoryScreen, EItemUiContextType.ScavengerInventoryScreen]; 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.Linq;
using System.Reflection; using System.Reflection;
namespace UIFixes namespace UIFixes;
public class PutToolsBackPatch : ModulePatch
{ {
public class PutToolsBackPatch : ModulePatch
{
protected override MethodBase GetTargetMethod() protected override MethodBase GetTargetMethod()
{ {
return AccessTools.Method(R.ItemReceiver.Type, "method_9"); // GClass1855 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 SPT.Reflection.Patching;
using System.Reflection; using System.Reflection;
namespace UIFixes namespace UIFixes;
public static class QuickAccessPanelPatches
{ {
public static class QuickAccessPanelPatches
{
public static void Enable() public static void Enable()
{ {
new FixWeaponBindsDisplayPatch().Enable(); new FixWeaponBindsDisplayPatch().Enable();
@@ -101,5 +101,4 @@ namespace UIFixes
FixVisibilityPatch.Ignorable = false; FixVisibilityPatch.Ignorable = false;
} }
} }
}
} }

View File

@@ -7,10 +7,10 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Reflection; 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]; private static readonly EquipmentSlot[] Slots = [EquipmentSlot.Pockets, EquipmentSlot.TacticalVest, EquipmentSlot.Backpack, EquipmentSlot.SecuredContainer, EquipmentSlot.ArmBand];
protected override MethodBase GetTargetMethod() protected override MethodBase GetTargetMethod()
@@ -44,5 +44,4 @@ namespace UIFixes
} }
} }
} }
}
} }

View File

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

View File

@@ -4,10 +4,10 @@ using System;
using System.Linq; using System.Linq;
using System.Reflection; 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"]; private static readonly string[] UnimplementedActions = ["Bang & clear", "Flash & clear", "Move in"];
protected override MethodBase GetTargetMethod() protected override MethodBase GetTargetMethod()
@@ -34,5 +34,4 @@ namespace UIFixes
} }
} }
} }
}
} }

View File

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

View File

@@ -13,10 +13,10 @@ using UnityEngine.Events;
using UnityEngine.EventSystems; using UnityEngine.EventSystems;
using UnityEngine.UI; using UnityEngine.UI;
namespace UIFixes namespace UIFixes;
public static class ScrollPatches
{ {
public static class ScrollPatches
{
public static void Enable() public static void Enable()
{ {
new EnhanceStashScrollingPatch().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.Linq;
using System.Reflection; using System.Reflection;
namespace UIFixes namespace UIFixes;
public static class StackFirItemsPatches
{ {
public static class StackFirItemsPatches
{
public static void Enable() public static void Enable()
{ {
new ContainerStackPatch().Enable(); new ContainerStackPatch().Enable();
@@ -97,5 +97,4 @@ namespace UIFixes
return false; return false;
} }
} }
}
} }

View File

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

View File

@@ -14,10 +14,10 @@ using System.Reflection;
using UnityEngine; using UnityEngine;
using UnityEngine.EventSystems; 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 // Source container for the drag - grab this early to check it
private static IContainer SourceContainer; private static IContainer SourceContainer;
@@ -596,5 +596,4 @@ namespace UIFixes
return false; return false;
} }
} }
}
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -2,11 +2,11 @@
using Comfort.Common; using Comfort.Common;
using EFT; 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() public void Awake()
{ {
Settings.Init(Config); Settings.Init(Config);
@@ -70,5 +70,4 @@ namespace UIFixes
bool? inRaid = Singleton<AbstractGame>.Instance?.InRaid; bool? inRaid = Singleton<AbstractGame>.Instance?.InRaid;
return inRaid.HasValue && inRaid.Value; return inRaid.HasValue && inRaid.Value;
} }
}
} }

13
R.cs
View File

@@ -17,10 +17,10 @@ using TMPro;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
namespace UIFixes namespace UIFixes;
public static class R
{ {
public static class R
{
public static void Init() public static void Init()
{ {
// Order is significant, as some reference each other // Order is significant, as some reference each other
@@ -847,10 +847,10 @@ namespace UIFixes
public SimpleStashPanel SimpleStashPanel { get { return (SimpleStashPanel)SimpleStashPanelField.GetValue(Value); } } 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.UIElement R(this UIElement value) => new(value);
public static R.UIInputNode R(this UIInputNode value) => new(value); public static R.UIInputNode R(this UIInputNode value) => new(value);
public static R.ProductionPanel R(this ProductionPanel 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.TradingTableGridView R(this TradingTableGridView value) => new(value);
public static R.InventoryScreen R(this InventoryScreen value) => new(value); public static R.InventoryScreen R(this InventoryScreen value) => new(value);
public static R.ScavengerInventoryScreen R(this ScavengerInventoryScreen 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 System.ComponentModel;
using UnityEngine; using UnityEngine;
namespace UIFixes namespace UIFixes;
internal enum WeaponPresetConfirmationOption
{ {
internal enum WeaponPresetConfirmationOption
{
Never, Never,
[Description("On Close")] [Description("On Close")]
OnClose, OnClose,
Always Always
} }
internal enum TransferConfirmationOption internal enum TransferConfirmationOption
{ {
Never, Never,
Always Always
} }
internal enum MultiSelectStrategy internal enum MultiSelectStrategy
{ {
[Description("First Available Space")] [Description("First Available Space")]
FirstOpenSpace, FirstOpenSpace,
[Description("Same Row or Below (Wrapping)")] [Description("Same Row or Below (Wrapping)")]
SameRowOrLower, SameRowOrLower,
[Description("Keep Original Spacing (Best Effort)")] [Description("Keep Original Spacing (Best Effort)")]
OriginalSpacing OriginalSpacing
} }
internal enum SortingTableDisplay internal enum SortingTableDisplay
{ {
New, New,
Old, Old,
Both Both
} }
internal class Settings internal class Settings
{ {
// Categories // Categories
private const string GeneralSection = "1. General"; private const string GeneralSection = "1. General";
private const string InputSection = "2. Input"; 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) public static void Subscribe<T>(this ConfigEntry<T> configEntry, Action<T> onChange)
{ {
configEntry.SettingChanged += (_, _) => onChange(configEntry.Value); configEntry.SettingChanged += (_, _) => onChange(configEntry.Value);
@@ -780,5 +779,4 @@ namespace UIFixes
configEntry.Subscribe(onChange); configEntry.Subscribe(onChange);
onChange(configEntry.Value); onChange(configEntry.Value);
} }
}
} }

View File

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

View File

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