mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 04:50:45 -05:00
Fix patch oopsie :). Added another patch to remove Practice mode toggle and warning text
This commit is contained in:
parent
00a2a3a984
commit
0c52ddbd61
@ -0,0 +1,34 @@
|
|||||||
|
using EFT.UI;
|
||||||
|
using EFT.UI.Matchmaker;
|
||||||
|
using HarmonyLib;
|
||||||
|
using SPT.Reflection.Patching;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
|
namespace SPT.SinglePlayer.Patches.MainMenu
|
||||||
|
{
|
||||||
|
public class RaidSettingsScreenPatch : ModulePatch
|
||||||
|
{
|
||||||
|
protected override MethodBase GetTargetMethod()
|
||||||
|
{
|
||||||
|
return AccessTools.FirstMethod(typeof(MatchmakerOfflineRaidScreen), IsTargetMethod);
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool IsTargetMethod(MethodInfo method)
|
||||||
|
{
|
||||||
|
ParameterInfo[] parameters = method.GetParameters();
|
||||||
|
|
||||||
|
return parameters.Length == 2
|
||||||
|
&& parameters[0].Name == "profileInfo"
|
||||||
|
&& parameters[1].Name == "raidSettings";
|
||||||
|
}
|
||||||
|
|
||||||
|
[PatchPostfix]
|
||||||
|
private static void PatchPostfix(MatchmakerOfflineRaidScreen __instance, DefaultUIButton ____changeSettingsButton, UiElementBlocker ____onlineBlocker)
|
||||||
|
{
|
||||||
|
____onlineBlocker.gameObject.SetActive(false);
|
||||||
|
____changeSettingsButton.Interactable = true;
|
||||||
|
__instance.transform.Find("Content/WarningPanelHorLayout").gameObject.SetActive(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -22,11 +22,6 @@ namespace SPT.SinglePlayer.Patches.ScavMode
|
|||||||
[PatchPrefix]
|
[PatchPrefix]
|
||||||
private static void PatchPrefix(ref MainMenuController __instance, ref RaidSettings ___raidSettings_0, ref ISession ___iSession)
|
private static void PatchPrefix(ref MainMenuController __instance, ref RaidSettings ___raidSettings_0, ref ISession ___iSession)
|
||||||
{
|
{
|
||||||
if (!___raidSettings_0.IsScav)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Store old settings to restore them later in postfix
|
// Store old settings to restore them later in postfix
|
||||||
storedRaidMode = ___raidSettings_0.RaidMode;
|
storedRaidMode = ___raidSettings_0.RaidMode;
|
||||||
storedSide = ___raidSettings_0.Side;
|
storedSide = ___raidSettings_0.Side;
|
||||||
@ -41,11 +36,6 @@ namespace SPT.SinglePlayer.Patches.ScavMode
|
|||||||
[PatchPostfix]
|
[PatchPostfix]
|
||||||
private static void PatchPostfix(ref MainMenuController __instance, ref RaidSettings ___raidSettings_0, ref ISession ___iSession)
|
private static void PatchPostfix(ref MainMenuController __instance, ref RaidSettings ___raidSettings_0, ref ISession ___iSession)
|
||||||
{
|
{
|
||||||
if (!___raidSettings_0.IsScav)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
___raidSettings_0.RaidMode = storedRaidMode;
|
___raidSettings_0.RaidMode = storedRaidMode;
|
||||||
___raidSettings_0.Side = storedSide;
|
___raidSettings_0.Side = storedSide;
|
||||||
___raidSettings_0.SelectedLocation.ForceOnlineRaidInPVE = storedOnlineRaidInPVE;
|
___raidSettings_0.SelectedLocation.ForceOnlineRaidInPVE = storedOnlineRaidInPVE;
|
||||||
|
@ -77,6 +77,7 @@ namespace SPT.SinglePlayer
|
|||||||
new EnableRefForPVEPatch().Enable();
|
new EnableRefForPVEPatch().Enable();
|
||||||
new EnableRefIntermScreenPatch().Enable();
|
new EnableRefIntermScreenPatch().Enable();
|
||||||
new EnablePlayerScavPatch().Enable();
|
new EnablePlayerScavPatch().Enable();
|
||||||
|
new RaidSettingsScreenPatch().Enable();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user