From 2383a402e50cdbee0ed96e39893448a7c7fedf24 Mon Sep 17 00:00:00 2001 From: CWX Date: Thu, 4 Jul 2024 23:59:44 +0100 Subject: [PATCH] expirementing with using existing PVE logic disabled PVE first time message disabled insurance screen patch disabled offlineraid screen patch disabled raidsettingswindowpatch --- project/SPT.Custom/SPTCustomPlugin.cs | 9 ++++--- .../Patches/MainMenu/InsuranceScreenPatch.cs | 4 +-- .../MainMenu/PVEModeWelcomeMessagePatch.cs | 26 +++++++++++++++++++ .../SPT.SinglePlayer/SPTSingleplayerPlugin.cs | 8 ++++-- 4 files changed, 40 insertions(+), 7 deletions(-) create mode 100644 project/SPT.SinglePlayer/Patches/MainMenu/PVEModeWelcomeMessagePatch.cs diff --git a/project/SPT.Custom/SPTCustomPlugin.cs b/project/SPT.Custom/SPTCustomPlugin.cs index ce307c7..68ab334 100644 --- a/project/SPT.Custom/SPTCustomPlugin.cs +++ b/project/SPT.Custom/SPTCustomPlugin.cs @@ -27,11 +27,14 @@ 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(); - new OfflineRaidSettingsMenuPatch().Enable(); + // new RaidSettingsWindowPatch().Enable(); // new SessionIdPatch().Enable(); + + // Unused in PvE mode + // new OfflineRaidSettingsMenuPatch().Enable(); new VersionLabelPatch().Enable(); new IsEnemyPatch().Enable(); new BotCalledDataTryCallPatch().Enable(); diff --git a/project/SPT.SinglePlayer/Patches/MainMenu/InsuranceScreenPatch.cs b/project/SPT.SinglePlayer/Patches/MainMenu/InsuranceScreenPatch.cs index 3d8c6df..1ecbb09 100644 --- a/project/SPT.SinglePlayer/Patches/MainMenu/InsuranceScreenPatch.cs +++ b/project/SPT.SinglePlayer/Patches/MainMenu/InsuranceScreenPatch.cs @@ -32,7 +32,7 @@ namespace SPT.SinglePlayer.Patches.MainMenu // this.method_41(); //} - return AccessTools.Method(typeof(MainMenuController), nameof(MainMenuController.method_74)); + return AccessTools.Method(typeof(MainMenuController), nameof(MainMenuController.method_76)); } [PatchPrefix] @@ -40,7 +40,7 @@ namespace SPT.SinglePlayer.Patches.MainMenu { ___raidSettings_0.RaidMode = ERaidMode.Online; } - + [PatchPostfix] private static void PostfixPatch(RaidSettings ___raidSettings_0) { diff --git a/project/SPT.SinglePlayer/Patches/MainMenu/PVEModeWelcomeMessagePatch.cs b/project/SPT.SinglePlayer/Patches/MainMenu/PVEModeWelcomeMessagePatch.cs new file mode 100644 index 0000000..b37aa43 --- /dev/null +++ b/project/SPT.SinglePlayer/Patches/MainMenu/PVEModeWelcomeMessagePatch.cs @@ -0,0 +1,26 @@ +using System.Reflection; +using HarmonyLib; +using SPT.Reflection.Patching; + +namespace SPT.SinglePlayer.Patches.MainMenu +{ + public class PVEModeWelcomeMessagePatch : ModulePatch + { + protected override MethodBase GetTargetMethod() + { + return AccessTools.Method(typeof(GClass1849), nameof(GClass1849.GetBoolForProfile)); + } + + [PatchPrefix] + private static bool PatchPrefix(ref bool __result, string variable) + { + if (variable == "pve_first_time") + { + __result = true; + return false; + } + + return true; + } + } +} \ No newline at end of file diff --git a/project/SPT.SinglePlayer/SPTSingleplayerPlugin.cs b/project/SPT.SinglePlayer/SPTSingleplayerPlugin.cs index b54f13b..fb861c3 100644 --- a/project/SPT.SinglePlayer/SPTSingleplayerPlugin.cs +++ b/project/SPT.SinglePlayer/SPTSingleplayerPlugin.cs @@ -26,8 +26,11 @@ namespace SPT.SinglePlayer new ScavExperienceGainPatch().Enable(); new MainMenuControllerPatch().Enable(); new PlayerPatch().Enable(); - new SelectLocationScreenPatch().Enable(); - new InsuranceScreenPatch().Enable(); + new DisableReadyLocationReadyPatch().Enable(); + + // No longer required with PVE offline mode + // new InsuranceScreenPatch().Enable(); + new BotTemplateLimitPatch().Enable(); new GetNewBotTemplatesPatch().Enable(); new RemoveUsedBotProfilePatch().Enable(); @@ -69,6 +72,7 @@ namespace SPT.SinglePlayer new ScavRepAdjustmentPatch().Enable(); new AmmoUsedCounterPatch().Enable(); new ArmorDamageCounterPatch().Enable(); + new PVEModeWelcomeMessagePatch().Enable(); } catch (Exception ex) {