mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 09:50:43 -05:00
should fix SPT-AKI/Issues#640 Reviewed-on: SPT-AKI/Modules#119 Co-authored-by: kiobu <kiobu@sdf.org> Co-committed-by: kiobu <kiobu@sdf.org>
30 lines
864 B
C#
30 lines
864 B
C#
using Aki.Common.Http;
|
|
using Aki.Reflection.Patching;
|
|
using System.Reflection;
|
|
using EFT;
|
|
using EFT.UI;
|
|
using HarmonyLib;
|
|
using UnityEngine;
|
|
using TMPro;
|
|
using System.Linq;
|
|
|
|
namespace Aki.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);
|
|
Object.FindObjectsOfType<HoverTooltipArea>().Where(o => o.name == "Locked").SingleOrDefault()?.SetMessageText("<color=#51c6db>SPT-AKI</color> is already PvE.");
|
|
|
|
return false;
|
|
}
|
|
}
|
|
}
|