2024-05-21 19:10:17 +01:00
using SPT.Common.Http ;
using SPT.Reflection.Patching ;
2024-04-28 08:17:13 +00:00
using System.Reflection ;
using EFT ;
using EFT.UI ;
using HarmonyLib ;
using UnityEngine ;
using TMPro ;
using System.Linq ;
2024-05-21 19:10:17 +01:00
namespace SPT.Custom.Patches
2024-04-28 08:17:13 +00:00
{
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 ) ;
2024-05-21 20:18:09 +01:00
Object . FindObjectsOfType < HoverTooltipArea > ( ) . Where ( o = > o . name = = "Locked" ) . SingleOrDefault ( ) ? . SetMessageText ( "<color=#51c6db>SPT</color> is already PvE." ) ;
2024-05-01 08:17:57 +00:00
2024-04-28 08:17:13 +00:00
return false ;
}
}
}