0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 09:50:43 -05:00
modules/project/SPT.Custom/Patches/DisableGameModeAdjustButtonPatch.cs

28 lines
752 B
C#
Raw Normal View History

using SPT.Reflection.Patching;
using System.Reflection;
using EFT;
using EFT.UI;
using HarmonyLib;
using UnityEngine;
2024-05-21 19:10:17 +01:00
namespace SPT.Custom.Patches
{
2024-08-01 17:33:29 +01:00
/// <summary>
/// Remove ability to alter the game mode
/// </summary>
public class DisableGameModeAdjustButtonPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return AccessTools.Method(typeof(ChangeGameModeButton), nameof(ChangeGameModeButton.Show));
}
[PatchPrefix]
public static bool PatchPrefix(ESessionMode sessionMode, Profile profile, ref GameObject ____notAvailableState)
{
____notAvailableState.SetActive(false);
2024-10-03 10:28:48 +01:00
return false; // Skip original
}
}
}