mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 09:50:43 -05:00
29 lines
964 B
C#
29 lines
964 B
C#
using EFT.UI;
|
|
using HarmonyLib;
|
|
using SPT.Reflection.Patching;
|
|
using System.Collections.Generic;
|
|
using System.Reflection;
|
|
|
|
namespace SPT.Custom.Patches
|
|
{
|
|
/// <summary>
|
|
/// This patch sets the Prestige Tab to be enabled in PvE mode
|
|
/// </summary>
|
|
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<IReadOnlyDictionary<EInventoryTab, Tab>>("_tabDictionary").Value;
|
|
var prestigeTab = tabDictionary[EInventoryTab.Prestige];
|
|
prestigeTab.gameObject.SetActive(true);
|
|
}
|
|
}
|
|
}
|