2023-03-03 18:52:31 +00:00
|
|
|
using Aki.Reflection.Patching;
|
|
|
|
using EFT;
|
|
|
|
using System.Reflection;
|
|
|
|
|
|
|
|
namespace Aki.SinglePlayer.Patches.MainMenu
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Force ERaidMode to online to make interface show insurance page
|
|
|
|
/// </summary>
|
|
|
|
class InsuranceScreenPatch : ModulePatch
|
|
|
|
{
|
|
|
|
static InsuranceScreenPatch()
|
|
|
|
{
|
|
|
|
_ = nameof(MainMenuController.InventoryController);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override MethodBase GetTargetMethod()
|
|
|
|
{
|
2023-10-10 10:58:33 +00:00
|
|
|
//[CompilerGenerated]
|
|
|
|
//private void method_67()
|
|
|
|
//{
|
|
|
|
// 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();
|
|
|
|
//}
|
|
|
|
|
2023-03-03 18:52:31 +00:00
|
|
|
var desiredType = typeof(MainMenuController);
|
2023-12-29 09:43:15 +00:00
|
|
|
var desiredMethod = desiredType.GetMethod("method_71", BindingFlags.NonPublic | BindingFlags.Instance);
|
2023-03-03 18:52:31 +00:00
|
|
|
|
|
|
|
Logger.LogDebug($"{this.GetType().Name} Type: {desiredType?.Name}");
|
|
|
|
Logger.LogDebug($"{this.GetType().Name} Method: {desiredMethod?.Name}");
|
|
|
|
|
|
|
|
return desiredMethod;
|
|
|
|
}
|
|
|
|
|
|
|
|
[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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|