From 0c850bc8d2ec76a3219e69132314bc95fe34be6c Mon Sep 17 00:00:00 2001 From: Kaeno Date: Sat, 6 Jul 2024 00:15:58 +0100 Subject: [PATCH] Removed duplicate patch. enabled a disabled patch from testing --- .../Patches/OfflineRaidMenuPatch.cs | 13 +++---- project/SPT.Custom/SPTCustomPlugin.cs | 2 +- .../MainMenu/RaidSettingsScreenPatch.cs | 34 ------------------- .../SPT.SinglePlayer/SPTSingleplayerPlugin.cs | 1 - 4 files changed, 5 insertions(+), 45 deletions(-) delete mode 100644 project/SPT.SinglePlayer/Patches/MainMenu/RaidSettingsScreenPatch.cs diff --git a/project/SPT.Custom/Patches/OfflineRaidMenuPatch.cs b/project/SPT.Custom/Patches/OfflineRaidMenuPatch.cs index 1add1a9..7c2946f 100644 --- a/project/SPT.Custom/Patches/OfflineRaidMenuPatch.cs +++ b/project/SPT.Custom/Patches/OfflineRaidMenuPatch.cs @@ -50,16 +50,11 @@ namespace SPT.Custom.Patches } [PatchPostfix] - private static void PatchPostfix(MatchmakerOfflineRaidScreen __instance, UiElementBlocker ____onlineBlocker) + private static void PatchPostfix(MatchmakerOfflineRaidScreen __instance, DefaultUIButton ____changeSettingsButton, UiElementBlocker ____onlineBlocker) { - // Hide "no progression save" panel - var warningPanel = __instance.transform.Find("Content/WarningPanelHorLayout").gameObject; - warningPanel.SetActive(false); - var spacer = __instance.transform.Find("Content/Space (1)").gameObject; - spacer.SetActive(false); - - // Disable "Enable practice mode for this raid" toggle - ____onlineBlocker.SetBlock(true, "Raids in SPT are always Offline raids. Don't worry - your progress will be saved!"); + ____onlineBlocker.gameObject.SetActive(false); + ____changeSettingsButton.Interactable = true; + __instance.transform.Find("Content/WarningPanelHorLayout").gameObject.SetActive(false); } } } diff --git a/project/SPT.Custom/SPTCustomPlugin.cs b/project/SPT.Custom/SPTCustomPlugin.cs index ebc75b6..effeb91 100644 --- a/project/SPT.Custom/SPTCustomPlugin.cs +++ b/project/SPT.Custom/SPTCustomPlugin.cs @@ -27,7 +27,7 @@ namespace SPT.Custom new BossSpawnChancePatch().Enable(); new BotDifficultyPatch().Enable(); new CoreDifficultyPatch().Enable(); - // new OfflineRaidMenuPatch().Enable(); + new OfflineRaidMenuPatch().Enable(); // Fixed in live, no need for patch // new RaidSettingsWindowPatch().Enable(); diff --git a/project/SPT.SinglePlayer/Patches/MainMenu/RaidSettingsScreenPatch.cs b/project/SPT.SinglePlayer/Patches/MainMenu/RaidSettingsScreenPatch.cs deleted file mode 100644 index 1f250b6..0000000 --- a/project/SPT.SinglePlayer/Patches/MainMenu/RaidSettingsScreenPatch.cs +++ /dev/null @@ -1,34 +0,0 @@ -using EFT.UI; -using EFT.UI.Matchmaker; -using HarmonyLib; -using SPT.Reflection.Patching; -using System.Linq; -using System.Reflection; - -namespace SPT.SinglePlayer.Patches.MainMenu -{ - public class RaidSettingsScreenPatch : ModulePatch - { - protected override MethodBase GetTargetMethod() - { - return AccessTools.FirstMethod(typeof(MatchmakerOfflineRaidScreen), IsTargetMethod); - } - - private bool IsTargetMethod(MethodInfo method) - { - ParameterInfo[] parameters = method.GetParameters(); - - return parameters.Length == 2 - && parameters[0].Name == "profileInfo" - && parameters[1].Name == "raidSettings"; - } - - [PatchPostfix] - private static void PatchPostfix(MatchmakerOfflineRaidScreen __instance, DefaultUIButton ____changeSettingsButton, UiElementBlocker ____onlineBlocker) - { - ____onlineBlocker.gameObject.SetActive(false); - ____changeSettingsButton.Interactable = true; - __instance.transform.Find("Content/WarningPanelHorLayout").gameObject.SetActive(false); - } - } -} diff --git a/project/SPT.SinglePlayer/SPTSingleplayerPlugin.cs b/project/SPT.SinglePlayer/SPTSingleplayerPlugin.cs index 059ebdc..f58fb89 100644 --- a/project/SPT.SinglePlayer/SPTSingleplayerPlugin.cs +++ b/project/SPT.SinglePlayer/SPTSingleplayerPlugin.cs @@ -77,7 +77,6 @@ namespace SPT.SinglePlayer new EnableRefForPVEPatch().Enable(); new EnableRefIntermScreenPatch().Enable(); new EnablePlayerScavPatch().Enable(); - new RaidSettingsScreenPatch().Enable(); } catch (Exception ex) {