2024-07-04 23:59:44 +01:00
|
|
|
|
using System.Reflection;
|
|
|
|
|
using HarmonyLib;
|
|
|
|
|
using SPT.Reflection.Patching;
|
|
|
|
|
|
|
|
|
|
namespace SPT.SinglePlayer.Patches.MainMenu
|
|
|
|
|
{
|
2024-10-03 10:22:16 +01:00
|
|
|
|
public class DisableWelcomeToPVEModeMessagePatch : ModulePatch
|
2024-07-04 23:59:44 +01:00
|
|
|
|
{
|
|
|
|
|
protected override MethodBase GetTargetMethod()
|
|
|
|
|
{
|
2024-09-26 14:13:30 +01:00
|
|
|
|
return AccessTools.Method(typeof(GClass1955), nameof(GClass1955.GetBoolForProfile));
|
2024-07-04 23:59:44 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[PatchPrefix]
|
2024-08-02 16:57:59 +01:00
|
|
|
|
public static bool PatchPrefix(ref bool __result, string variable)
|
2024-07-04 23:59:44 +01:00
|
|
|
|
{
|
|
|
|
|
if (variable == "pve_first_time")
|
|
|
|
|
{
|
|
|
|
|
__result = true;
|
2024-09-16 15:02:51 +01:00
|
|
|
|
return false; // Skip original method
|
2024-07-04 23:59:44 +01:00
|
|
|
|
}
|
|
|
|
|
|
2024-08-28 12:52:54 +01:00
|
|
|
|
return true; // Do original method
|
2024-07-04 23:59:44 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|