2024-05-21 20:00:01 +00:00
|
|
|
|
using SPT.Reflection.Patching;
|
2024-04-28 08:17:13 +00:00
|
|
|
|
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-04-28 08:17:13 +00:00
|
|
|
|
{
|
2024-08-01 17:33:29 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Remove ability to alter the game mode
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class DisableGameModeAdjustButtonPatch : ModulePatch
|
2024-04-28 08:17:13 +00:00
|
|
|
|
{
|
|
|
|
|
protected override MethodBase GetTargetMethod()
|
|
|
|
|
{
|
|
|
|
|
return AccessTools.Method(typeof(ChangeGameModeButton), nameof(ChangeGameModeButton.Show));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[PatchPrefix]
|
2024-08-02 16:57:59 +01:00
|
|
|
|
public static bool PatchPrefix(ESessionMode sessionMode, Profile profile, ref GameObject ____notAvailableState)
|
2024-04-28 08:17:13 +00:00
|
|
|
|
{
|
2024-07-06 10:23:41 +01:00
|
|
|
|
____notAvailableState.SetActive(false);
|
2024-04-28 08:17:13 +00:00
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|