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,8 +4,8 @@ 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)
{
private static readonly List<EItemInfoButton> Actions = [EItemInfoButton.LinkedSearch];
@@ -26,4 +26,3 @@ namespace UIFixes.ContextMenus
}
}
}
}

View File

@@ -4,8 +4,8 @@ using System;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UIFixes.ContextMenus
{
namespace UIFixes;
public class EmptySlotMenuTrigger : MonoBehaviour, IPointerClickHandler, IPointerDownHandler, IPointerUpHandler, IPointerEnterHandler, IPointerExitHandler
{
private ItemUiContext itemUiContext;
@@ -79,4 +79,3 @@ namespace UIFixes.ContextMenus
throw new NotImplementedException();
}
}
}

View File

@@ -5,8 +5,8 @@ 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)
{
private readonly InsuranceCompanyClass insurance = uiContext.Session.InsuranceCompany;
@@ -102,4 +102,3 @@ namespace UIFixes
return interaction.Id.StartsWith("UIFixesInsurerId:");
}
}
}

View File

@@ -6,8 +6,8 @@ using System;
using System.Globalization;
using System.Linq;
namespace UIFixes
{
namespace UIFixes;
public class RepairInteractions : ItemInfoInteractionsAbstractClass<RepairInteractions.ERepairers>
{
private readonly RepairControllerClass repairController;
@@ -178,4 +178,3 @@ namespace UIFixes
return interaction.Id.StartsWith("UIFixesRepairerId:");
}
}
}

View File

@@ -2,8 +2,8 @@
using EFT.UI.DragAndDrop;
using System.Runtime.CompilerServices;
namespace UIFixes
{
namespace UIFixes;
public static class ExtraItemProperties
{
private static readonly ConditionalWeakTable<Item, Properties> properties = new();
@@ -29,4 +29,3 @@ 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,8 +9,8 @@ using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
namespace UIFixes
{
namespace UIFixes;
public class DrawMultiSelect : MonoBehaviour
{
private Texture2D selectTexture;
@@ -241,4 +241,3 @@ namespace UIFixes
return false;
}
}
}

View File

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

View File

@@ -7,8 +7,8 @@ using System.Threading.Tasks;
using TMPro;
using UnityEngine;
namespace UIFixes
{
namespace UIFixes;
public class MultiSelect
{
private static GameObject SelectedMarkTemplate = null;
@@ -555,5 +555,4 @@ namespace UIFixes
}
}
}
}

View File

@@ -2,8 +2,8 @@
using System.Text;
using UnityEngine;
namespace UIFixes
{
namespace UIFixes;
public class MultiSelectDebug : MonoBehaviour
{
private GUIStyle guiStyle;
@@ -60,4 +60,3 @@ namespace UIFixes
GUI.Box(guiRect, guiContent, guiStyle);
}
}
}

View File

@@ -9,8 +9,8 @@ using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
namespace UIFixes
{
namespace UIFixes;
public static class AddOfferClickablePricesPatches
{
public static void Enable()
@@ -95,4 +95,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -5,8 +5,8 @@ using SPT.Reflection.Patching;
using System.Reflection;
using UnityEngine;
namespace UIFixes
{
namespace UIFixes;
public static class AddOfferRememberAutoselectPatches
{
private static readonly string PlayerPrefKey = "UIFixes.AddOffer.AutoselectSimilar";
@@ -59,4 +59,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -6,8 +6,8 @@ using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace UIFixes
{
namespace UIFixes;
public static class AimToggleHoldPatches
{
public static void Enable()
@@ -70,4 +70,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -9,8 +9,8 @@ using System.Collections.Generic;
using System.Reflection;
using System.Threading.Tasks;
namespace UIFixes
{
namespace UIFixes;
public class AssortUnlocksPatch : ModulePatch
{
private static bool Loading = false;
@@ -62,4 +62,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -4,8 +4,8 @@ using SPT.Reflection.Patching;
using System.Reflection;
using UnityEngine;
namespace UIFixes
{
namespace UIFixes;
public class AutofillQuestItemsPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
@@ -30,4 +30,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -6,8 +6,8 @@ using System.Reflection;
using UnityEngine;
using UnityEngine.UI;
namespace UIFixes
{
namespace UIFixes;
public static class ConfirmDialogKeysPatches
{
public static void Enable()
@@ -222,4 +222,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -9,11 +9,10 @@ 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
{
private static InsuranceInteractions CurrentInsuranceInteractions = null;
@@ -517,4 +516,3 @@ namespace UIFixes
return R.Money.GetMoneySums(stash.Grid.ContainedItems.Keys)[ECurrencyType.RUB];
}
}
}

View File

@@ -8,8 +8,8 @@ using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UIFixes
{
namespace UIFixes;
public static class ContextMenuShortcutPatches
{
private static TMP_InputField LastSelectedInput = null;
@@ -221,4 +221,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -6,8 +6,8 @@ using TMPro;
using UnityEngine;
using UnityEngine.UI;
namespace UIFixes
{
namespace UIFixes;
public static class FixFleaPatches
{
public static void Enable()
@@ -96,4 +96,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -3,8 +3,8 @@ using HarmonyLib;
using SPT.Reflection.Patching;
using System.Reflection;
namespace UIFixes
{
namespace UIFixes;
public class FixMailRecieveAllPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
@@ -19,5 +19,4 @@ namespace UIFixes
dialogue.HasMessagesWithRewards = false;
}
}
}

View File

@@ -6,8 +6,8 @@ using System.Reflection;
using TMPro;
using UnityEngine;
namespace UIFixes
{
namespace UIFixes;
public static class FixTooltipPatches
{
public static void Enable()
@@ -67,4 +67,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -4,8 +4,8 @@ using HarmonyLib;
using SPT.Reflection.Patching;
using System.Reflection;
namespace UIFixes
{
namespace UIFixes;
public class FixTraderControllerSimulateFalsePatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
@@ -79,4 +79,3 @@ namespace UIFixes
return false;
}
}
}

View File

@@ -4,8 +4,8 @@ using SPT.Reflection.Patching;
using System.Collections.Generic;
using System.Reflection;
namespace UIFixes
{
namespace UIFixes;
public class FixUnloadLastBulletPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
@@ -49,4 +49,3 @@ namespace UIFixes
return false;
}
}
}

View File

@@ -11,8 +11,8 @@ using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.UI;
namespace UIFixes
{
namespace UIFixes;
public static class FleaPrevSearchPatches
{
private class HistoryEntry
@@ -432,4 +432,3 @@ namespace UIFixes
one.NeededSearchId == two.NeededSearchId;
}
}
}

View File

@@ -4,8 +4,8 @@ using SPT.Reflection.Patching;
using System.Linq;
using System.Reflection;
namespace UIFixes
{
namespace UIFixes;
public static class FleaSlotSearchPatches
{
public static void Enable()
@@ -52,4 +52,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -6,8 +6,8 @@ using System.Reflection;
using TMPro;
using UnityEngine;
namespace UIFixes
{
namespace UIFixes;
public static class FocusFleaOfferNumberPatches
{
public static void Enable()
@@ -72,4 +72,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -4,8 +4,8 @@ using SPT.Reflection.Patching;
using System.Reflection;
using TMPro;
namespace UIFixes
{
namespace UIFixes;
public class FocusTradeQuantityPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
@@ -23,4 +23,3 @@ namespace UIFixes
____quantity.Select();
}
}
}

View File

@@ -9,8 +9,8 @@ using TMPro;
using UnityEngine;
using UnityEngine.UI;
namespace UIFixes
{
namespace UIFixes;
public static class GPCoinPatches
{
public static void Enable()
@@ -122,4 +122,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -6,8 +6,8 @@ using System.Reflection;
using UnityEngine;
using UnityEngine.UI;
namespace UIFixes
{
namespace UIFixes;
public class GridWindowButtonsPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
@@ -98,4 +98,3 @@ namespace UIFixes
inspectRect.anchoredPosition = new Vector2((float)Screen.width * 3f / 4f / inspectRect.lossyScale.x, inspectRect.anchoredPosition.y);
}
}
}

View File

@@ -3,8 +3,8 @@ using HarmonyLib;
using SPT.Reflection.Patching;
using System.Reflection;
namespace UIFixes
{
namespace UIFixes;
public static class HideoutLevelPatches
{
private static string CurrentArea;
@@ -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;
}
@@ -84,4 +85,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -11,8 +11,8 @@ using TMPro;
using UnityEngine.EventSystems;
using UnityEngine.UI;
namespace UIFixes
{
namespace UIFixes;
public static class HideoutSearchPatches
{
private static readonly Dictionary<string, string> LastSearches = [];
@@ -235,4 +235,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -9,8 +9,7 @@ using System.Reflection;
using UnityEngine;
using UnityEngine.UI;
namespace UIFixes
{
namespace UIFixes;
internal static class InspectWindowResizePatches
{
private static float SavedPreferredWidth = -1f;
@@ -279,4 +278,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -13,8 +13,8 @@ using TMPro;
using UnityEngine;
using UnityEngine.UI;
namespace UIFixes
{
namespace UIFixes;
public static class InspectWindowStatsPatches
{
public static void Enable()
@@ -517,4 +517,3 @@ namespace UIFixes
return Regex.Replace(input, @"(?<integer>\d)((?<significantDecimals>\.[0-9]*[1-9])0*\b)?(\.0+\b)?", "${integer}${significantDecimals}");
}
}
}

View File

@@ -5,8 +5,8 @@ using HarmonyLib;
using SPT.Reflection.Patching;
using System.Reflection;
namespace UIFixes
{
namespace UIFixes;
public static class KeepMessagesOpenPatches
{
private static bool ReopenMessages = false;
@@ -52,4 +52,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -7,8 +7,8 @@ using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
namespace UIFixes
{
namespace UIFixes;
public static class KeepOfferWindowOpenPatches
{
private static bool BlockClose = false;
@@ -156,4 +156,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -6,8 +6,8 @@ using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace UIFixes
{
namespace UIFixes;
public static class KeepWindowsOnScreenPatches
{
public static void Enable()
@@ -38,4 +38,3 @@ namespace UIFixes
public static void Postfix(List<InputNode> ____children) => FixNewestWindow(____children);
}
}
}

View File

@@ -8,8 +8,8 @@ using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
namespace UIFixes
{
namespace UIFixes;
public class LoadAmmoInRaidPatches
{
public static void Enable()
@@ -80,4 +80,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -5,8 +5,8 @@ using System;
using System.Collections.Generic;
using System.Reflection;
namespace UIFixes
{
namespace UIFixes;
public class LoadMagPresetsPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
@@ -48,4 +48,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -9,8 +9,8 @@ using System.Reflection;
using System.Threading.Tasks;
using UnityEngine;
namespace UIFixes
{
namespace UIFixes;
public static class LoadMultipleMagazinesPatches
{
private static ItemFilter[] CombinedFilters;
@@ -147,4 +147,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -5,8 +5,8 @@ using System.Linq;
using System.Reflection;
using UnityEngine;
namespace UIFixes
{
namespace UIFixes;
public class MoveTaskbarPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
@@ -22,4 +22,3 @@ namespace UIFixes
bottomPanel.localPosition = new Vector3(0f, -3f, 0f);
}
}
}

View File

@@ -17,8 +17,8 @@ using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
namespace UIFixes
{
namespace UIFixes;
public static class MultiSelectPatches
{
// Used to prevent infinite recursion of CanAccept/AcceptItem
@@ -1375,4 +1375,3 @@ namespace UIFixes
return hoveredGridAddress;
}
}
}

View File

@@ -4,8 +4,8 @@ using System.Collections.Generic;
using System.Reflection;
using System.Reflection.Emit;
namespace UIFixes
{
namespace UIFixes;
public class NoRandomGrenadesPatch : ModulePatch
{
private static NoRandomGrenadesPatch Patch;
@@ -57,4 +57,3 @@ namespace UIFixes
}
}
}
}

View File

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

View File

@@ -7,8 +7,8 @@ using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace UIFixes
{
namespace UIFixes;
public class PutToolsBackPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
@@ -70,4 +70,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -8,8 +8,8 @@ using HarmonyLib;
using SPT.Reflection.Patching;
using System.Reflection;
namespace UIFixes
{
namespace UIFixes;
public static class QuickAccessPanelPatches
{
public static void Enable()
@@ -102,4 +102,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -7,8 +7,8 @@ using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace UIFixes
{
namespace UIFixes;
public class RebindGrenadesPatch : ModulePatch
{
private static readonly EquipmentSlot[] Slots = [EquipmentSlot.Pockets, EquipmentSlot.TacticalVest, EquipmentSlot.Backpack, EquipmentSlot.SecuredContainer, EquipmentSlot.ArmBand];
@@ -45,4 +45,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -4,8 +4,8 @@ using SPT.Reflection.Patching;
using System.Reflection;
using UnityEngine;
namespace UIFixes
{
namespace UIFixes;
public static class RememberRepairerPatches
{
public static void Enable()
@@ -49,4 +49,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -4,8 +4,8 @@ using System;
using System.Linq;
using System.Reflection;
namespace UIFixes
{
namespace UIFixes;
public class RemoveDoorActionsPatch : ModulePatch
{
private static readonly string[] UnimplementedActions = ["Bang & clear", "Flash & clear", "Move in"];
@@ -35,4 +35,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -7,8 +7,8 @@ using System.Linq;
using System.Reflection;
using UnityEngine;
namespace UIFixes
{
namespace UIFixes;
public static class ReorderGridsPatches
{
public static void Enable()
@@ -140,4 +140,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -13,8 +13,8 @@ using UnityEngine.Events;
using UnityEngine.EventSystems;
using UnityEngine.UI;
namespace UIFixes
{
namespace UIFixes;
public static class ScrollPatches
{
public static void Enable()
@@ -363,4 +363,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -6,8 +6,8 @@ using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace UIFixes
{
namespace UIFixes;
public static class StackFirItemsPatches
{
public static void Enable()
@@ -98,4 +98,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -6,8 +6,8 @@ using System.Threading;
using System.Threading.Tasks;
using UnityEngine;
namespace UIFixes
{
namespace UIFixes;
public static class StackMoveGreedyPatches
{
private static bool InPatch = false;
@@ -86,4 +86,3 @@ namespace UIFixes
return false;
}
}
}

View File

@@ -14,8 +14,8 @@ using System.Reflection;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UIFixes
{
namespace UIFixes;
public static class SwapPatches
{
// Source container for the drag - grab this early to check it
@@ -597,4 +597,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -6,8 +6,8 @@ using System.Reflection;
using UnityEngine;
using UnityEngine.UI;
namespace UIFixes
{
namespace UIFixes;
public static class SyncScrollPositionPatches
{
private static float StashScrollPosition = 1f;
@@ -85,4 +85,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -7,8 +7,8 @@ using System.Reflection;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UIFixes
{
namespace UIFixes;
public static class TradingAutoSwitchPatches
{
private static Tab BuyTab;
@@ -102,4 +102,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -4,8 +4,8 @@ using SPT.Reflection.Patching;
using System.Reflection;
using System.Threading.Tasks;
namespace UIFixes
{
namespace UIFixes;
public class TransferConfirmPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
@@ -25,5 +25,4 @@ namespace UIFixes
return false;
}
}
}

View File

@@ -9,8 +9,8 @@ using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
namespace UIFixes
{
namespace UIFixes;
public static class UnloadAmmoPatches
{
public static void Enable()
@@ -99,4 +99,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -6,8 +6,7 @@ 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
@@ -61,5 +60,4 @@ namespace UIFixes
}
}
}
}

View File

@@ -5,8 +5,8 @@ using SPT.Reflection.Patching;
using System.Reflection;
using UnityEngine.EventSystems;
namespace UIFixes
{
namespace UIFixes;
public static class WeaponZoomPatches
{
public static void Enable()
@@ -59,4 +59,3 @@ namespace UIFixes
}
}
}
}

View File

@@ -2,8 +2,8 @@
using Comfort.Common;
using EFT;
namespace UIFixes
{
namespace UIFixes;
[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
public class Plugin : BaseUnityPlugin
{
@@ -71,4 +71,3 @@ namespace UIFixes
return inRaid.HasValue && inRaid.Value;
}
}
}

5
R.cs
View File

@@ -17,8 +17,8 @@ using TMPro;
using UnityEngine;
using UnityEngine.UI;
namespace UIFixes
{
namespace UIFixes;
public static class R
{
public static void Init()
@@ -878,4 +878,3 @@ namespace UIFixes
public static R.InventoryScreen R(this InventoryScreen value) => new(value);
public static R.ScavengerInventoryScreen R(this ScavengerInventoryScreen value) => new(value);
}
}

View File

@@ -4,8 +4,7 @@ using System.Collections.Generic;
using System.ComponentModel;
using UnityEngine;
namespace UIFixes
{
namespace UIFixes;
internal enum WeaponPresetConfirmationOption
{
Never,
@@ -781,4 +780,3 @@ namespace UIFixes
onChange(configEntry.Value);
}
}
}

View File

@@ -3,8 +3,8 @@ using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine;
namespace UIFixes
{
namespace UIFixes;
public class TaskSerializer<T> : MonoBehaviour
{
private Func<T, Task> func;
@@ -76,4 +76,3 @@ namespace UIFixes
Destroy(this);
}
}
}

View File

@@ -1,7 +1,7 @@
using EFT.InputSystem;
namespace UIFixes
{
namespace UIFixes;
public enum ToggleHoldState
{
Idle = 13,
@@ -83,4 +83,3 @@ namespace UIFixes
return disableCommand;
}
}
}