mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 08:30:45 -05:00
26 lines
764 B
C#
26 lines
764 B
C#
using SPT.Reflection.Patching;
|
|
using System.Reflection;
|
|
using EFT;
|
|
using EFT.UI;
|
|
using HarmonyLib;
|
|
using UnityEngine;
|
|
|
|
namespace SPT.Custom.Patches
|
|
{
|
|
public class DisablePvEPatch : ModulePatch
|
|
{
|
|
protected override MethodBase GetTargetMethod()
|
|
{
|
|
return AccessTools.Method(typeof(ChangeGameModeButton), nameof(ChangeGameModeButton.Show));
|
|
}
|
|
|
|
[PatchPrefix]
|
|
private static bool PatchPrefix(ESessionMode sessionMode, Profile profile, ref GameObject ____notAvailableState)
|
|
{
|
|
____notAvailableState.SetActive(true);
|
|
____notAvailableState.GetComponent<HoverTooltipArea>().SetMessageText("<color=#51c6db>SPT</color> is already PvE.");
|
|
return false;
|
|
}
|
|
}
|
|
}
|