0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 09:50:43 -05:00
modules/project/Aki.Custom/Patches/DisablePvEPatch.cs
kiobu 5676c58fce fix: disablepve in-raid bug when finding tooltip (!119)
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>
2024-05-01 08:17:57 +00:00

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;
}
}
}