2025-01-09 02:18:40 -08:00
|
|
|
|
using EFT.UI;
|
|
|
|
|
using HarmonyLib;
|
|
|
|
|
using SPT.Reflection.Patching;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
|
|
|
|
|
namespace SPT.Custom.Patches
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2025-01-19 07:53:56 -08:00
|
|
|
|
/// This patch sets the Prestige Tab to be enabled in PvE mode
|
2025-01-09 02:18:40 -08:00
|
|
|
|
/// </summary>
|
|
|
|
|
internal class EnablePrestigeTabPatch : ModulePatch
|
|
|
|
|
{
|
|
|
|
|
protected override MethodBase GetTargetMethod()
|
|
|
|
|
{
|
2025-01-30 12:18:13 +00:00
|
|
|
|
return AccessTools.Method(typeof(InventoryScreen.Class2752), nameof(InventoryScreen.Class2752.MoveNext));
|
2025-01-09 02:18:40 -08:00
|
|
|
|
}
|
|
|
|
|
|
2025-01-19 07:53:56 -08:00
|
|
|
|
[PatchPostfix]
|
2025-01-30 12:18:13 +00:00
|
|
|
|
public static void Postfix(InventoryScreen.Class2752 __instance)
|
2025-01-09 02:18:40 -08:00
|
|
|
|
{
|
2025-01-19 07:53:56 -08:00
|
|
|
|
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);
|
2025-01-09 02:18:40 -08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|