0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 09:50:43 -05:00
modules/project/Aki.SinglePlayer/Patches/MainMenu/InsuranceScreenPatch.cs
BluBb_mADe 2abc1ab0ce fixed insurance screen patch (!114)
I am not entirely sure what the method name index of the added method is that has offset everything by one. There might be other patches affected by this that reference a method by name instead of signature but everything seems to work with just these two adjustments.
I don't have a diff ready to easily spot where the offset happens and what else might potentially be affected.

Reviewed-on: SPT-AKI/Modules#114
Co-authored-by: BluBb_mADe <ku21runy1k11@opayq.com>
Co-committed-by: BluBb_mADe <ku21runy1k11@opayq.com>
2024-04-27 09:38:27 +00:00

51 lines
1.4 KiB
C#

using Aki.Reflection.Patching;
using EFT;
using System.Reflection;
using HarmonyLib;
namespace Aki.SinglePlayer.Patches.MainMenu
{
/// <summary>
/// Force ERaidMode to online to make interface show insurance page
/// </summary>
public class InsuranceScreenPatch : ModulePatch
{
static InsuranceScreenPatch()
{
_ = nameof(MainMenuController.InventoryController);
}
protected override MethodBase GetTargetMethod()
{
//[CompilerGenerated]
//private void method_XX()
//{
// if (this.raidSettings_0.SelectedLocation.Id == "laboratory")
// {
// this.raidSettings_0.WavesSettings.IsBosses = true;
// }
// if (this.raidSettings_0.RaidMode == ERaidMode.Online)
// {
// this.method_40();
// return;
// }
// this.method_41();
//}
return AccessTools.Method(typeof(MainMenuController), nameof(MainMenuController.method_73));
}
[PatchPrefix]
private static void PrefixPatch(RaidSettings ___raidSettings_0)
{
___raidSettings_0.RaidMode = ERaidMode.Online;
}
[PatchPostfix]
private static void PostfixPatch(RaidSettings ___raidSettings_0)
{
___raidSettings_0.RaidMode = ERaidMode.Local;
}
}
}