using EFT.UI;
using HarmonyLib;
using SPT.Reflection.Patching;
using System.Collections.Generic;
using System.Reflection;
namespace SPT.Custom.Patches
{
///
/// This patch sets the Prestige Tab to be enabled in PvE mode
///
internal class EnablePrestigeTabPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return AccessTools.Method(typeof(InventoryScreen.Class2752), nameof(InventoryScreen.Class2752.MoveNext));
}
[PatchPostfix]
public static void Postfix(InventoryScreen.Class2752 __instance)
{
var inventoryScreen = __instance.inventoryScreen_0;
var tabDictionary = Traverse.Create(inventoryScreen).Field>("_tabDictionary").Value;
var prestigeTab = tabDictionary[EInventoryTab.Prestige];
prestigeTab.gameObject.SetActive(true);
}
}
}