From 1277e103817a0f71021ec1bafabcd0327b0c8377 Mon Sep 17 00:00:00 2001
From: KaenoDev <193943350+KaenoDev@users.noreply.github.com>
Date: Fri, 7 Feb 2025 21:54:01 +0000
Subject: [PATCH] Adds Patch to remove use BSG servers for matchmaking (needs
looking at when we get more data)
---
.../MainMenu/DisableUseBSGServersCheckbox.cs | 27 +++++++++++++++++++
.../SPT.SinglePlayer/SPT.SinglePlayer.csproj | 1 +
.../SPT.SinglePlayer/SPTSingleplayerPlugin.cs | 1 +
3 files changed, 29 insertions(+)
create mode 100644 project/SPT.SinglePlayer/Patches/MainMenu/DisableUseBSGServersCheckbox.cs
diff --git a/project/SPT.SinglePlayer/Patches/MainMenu/DisableUseBSGServersCheckbox.cs b/project/SPT.SinglePlayer/Patches/MainMenu/DisableUseBSGServersCheckbox.cs
new file mode 100644
index 0000000..d4c0e5c
--- /dev/null
+++ b/project/SPT.SinglePlayer/Patches/MainMenu/DisableUseBSGServersCheckbox.cs
@@ -0,0 +1,27 @@
+using System.Reflection;
+using EFT.UI;
+using HarmonyLib;
+using SPT.Reflection.Patching;
+
+namespace SPT.SinglePlayer.Patches.MainMenu
+{
+ ///
+ /// Removes BSG's checkmark to use BSG servers instead of local hosted
+ /// Also Sets checkmark to false.if checkmark is somehow enabled it will default to false (local raid only)
+ ///
+ public class DisableUseBSGServersCheckbox : ModulePatch
+ {
+ protected override MethodBase GetTargetMethod()
+ {
+ return AccessTools.Method(typeof(LocationInfoPanel), nameof(LocationInfoPanel.method_1));
+ }
+
+ [PatchPostfix]
+ public static void PatchPostfix(ref UpdatableToggle ____onlineModeToggle)
+ {
+
+ ____onlineModeToggle.isOn = false;
+ ____onlineModeToggle.transform.parent.gameObject.SetActive(false);
+ }
+ }
+}
\ No newline at end of file
diff --git a/project/SPT.SinglePlayer/SPT.SinglePlayer.csproj b/project/SPT.SinglePlayer/SPT.SinglePlayer.csproj
index e2c36a9..e0d31d4 100644
--- a/project/SPT.SinglePlayer/SPT.SinglePlayer.csproj
+++ b/project/SPT.SinglePlayer/SPT.SinglePlayer.csproj
@@ -23,6 +23,7 @@
+
diff --git a/project/SPT.SinglePlayer/SPTSingleplayerPlugin.cs b/project/SPT.SinglePlayer/SPTSingleplayerPlugin.cs
index 12a99b6..c628c20 100644
--- a/project/SPT.SinglePlayer/SPTSingleplayerPlugin.cs
+++ b/project/SPT.SinglePlayer/SPTSingleplayerPlugin.cs
@@ -71,6 +71,7 @@ namespace SPT.SinglePlayer
new DisableDevMaskCheckPatch().Enable();
new RemoveStopwatchAllocationsEveryBotFramePatch().Enable();
new RemoveStopwatchAllocationsEveryCoverPointFramePatch().Enable();
+ new DisableUseBSGServersCheckbox().Enable();
}
catch (Exception ex)
{