From fc6124dfc888075c88a8f3fb74c3f0c27055b0b9 Mon Sep 17 00:00:00 2001 From: CWX Date: Sat, 24 Aug 2024 00:42:01 +0100 Subject: [PATCH] Add patch to disable StashExpansion label and tooltip --- .../MainMenu/RemoveStashUpgradeLabelPatch.cs | 25 +++++++++++++++++++ .../SPT.SinglePlayer/SPTSingleplayerPlugin.cs | 1 + 2 files changed, 26 insertions(+) create mode 100644 project/SPT.SinglePlayer/Patches/MainMenu/RemoveStashUpgradeLabelPatch.cs diff --git a/project/SPT.SinglePlayer/Patches/MainMenu/RemoveStashUpgradeLabelPatch.cs b/project/SPT.SinglePlayer/Patches/MainMenu/RemoveStashUpgradeLabelPatch.cs new file mode 100644 index 0000000..bfebaa3 --- /dev/null +++ b/project/SPT.SinglePlayer/Patches/MainMenu/RemoveStashUpgradeLabelPatch.cs @@ -0,0 +1,25 @@ +using System.Reflection; +using EFT.UI; +using HarmonyLib; +using SPT.Reflection.Patching; +using UnityEngine; + +namespace SPT.SinglePlayer.Patches.MainMenu; + +/// +/// Remove Tooltip and image from stash screen explaining to visit external site for more stash - EFT thing +/// +public class RemoveStashUpgradeLabelPatch : ModulePatch +{ + protected override MethodBase GetTargetMethod() + { + // InventoryScreen has 2 Show methods + return AccessTools.FirstMethod(typeof(InventoryScreen), info => info.Name == "Show"); + } + + [PatchPostfix] + public static void Postfix(SimpleStashPanel __instance) + { + Object.Destroy(__instance.transform.Find("Items Panel/Stash Panel/Simple Panel/Header/ExternalObtain").gameObject); + } +} \ No newline at end of file diff --git a/project/SPT.SinglePlayer/SPTSingleplayerPlugin.cs b/project/SPT.SinglePlayer/SPTSingleplayerPlugin.cs index 363f220..6386cd3 100644 --- a/project/SPT.SinglePlayer/SPTSingleplayerPlugin.cs +++ b/project/SPT.SinglePlayer/SPTSingleplayerPlugin.cs @@ -61,6 +61,7 @@ namespace SPT.SinglePlayer new FixSavageInventoryScreenPatch().Enable(); new InsuranceScreenPatch().Enable(); new FixQuestAchieveControllersPatch().Enable(); + new RemoveStashUpgradeLabelPatch().Enable(); } catch (Exception ex) {