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
DrakiaXYZ e3bdf9c1fd Update for 28375 + fixes (!47)
- Update GClass references
- Fix incorrect method in InsuranceScreenPatch (Makes insurance screen actually show)
- Fix incorrect method in Scav offline raid screen patch (Makes "Ready" from the practice screen start the raid)
- Update hollowed.dll with one provided by Chomp

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: SPT-AKI/Modules#47
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2023-12-29 09:43:15 +00:00

56 lines
1.7 KiB
C#

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()
{
//[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();
//}
var desiredType = typeof(MainMenuController);
var desiredMethod = desiredType.GetMethod("method_71", BindingFlags.NonPublic | BindingFlags.Instance);
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;
}
}
}