Decompiled source of SkipReadinessCheck v1.1.0

Outward.SkipReadinessCheck.dll

Decompiled 2 months ago
using System.Collections;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("Outward.SkipReadinessCheck")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Outward.SkipReadinessCheck")]
[assembly: AssemblyCopyright("Copyright ©  2022")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("F2B5776D-D403-48EA-AE2D-5E18A254EEE2")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.0.0")]
[module: UnverifiableCode]
namespace Outward.SkipReadinessCheck;

public class MenuChecker : MonoBehaviour
{
	private Coroutine currentCoroutine;

	private void Update()
	{
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Invalid comparison between Unknown and I4
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Invalid comparison between Unknown and I4
		if (MenuManager.Instance.IsMasterLoadingDisplayed && NetworkLevelLoader.Instance.AllPlayerDoneLoading && (int)CharacterManager.Instance.CurrentRestingStatus != 2 && !NetworkLevelLoader.Instance.ContinueAfterLoading)
		{
			NetworkLevelLoader.Instance.SetContinueAfterLoading();
		}
		if (MenuManager.Instance.IsMasterLoadingDisplayed && NetworkLevelLoader.Instance.AllPlayerDoneLoading && (int)CharacterManager.Instance.CurrentRestingStatus == 2 && !NetworkLevelLoader.Instance.ContinueAfterLoading && currentCoroutine == null)
		{
			currentCoroutine = ((MonoBehaviour)this).StartCoroutine(WaitToSkipReadyCheck());
		}
	}

	private IEnumerator WaitToSkipReadyCheck()
	{
		yield return (object)new WaitForSecondsRealtime(1.5f);
		while (SceneManagerHelper.ActiveSceneName == "LowMemory_TransitionScene")
		{
			yield return null;
		}
		NetworkLevelLoader.Instance.SetContinueAfterLoading();
		currentCoroutine = null;
	}
}
[BepInPlugin("fl01.skip-readiness-check", "Skip Readiness Check", "1.1.0")]
public class SkipReadinessCheckMod : BaseUnityPlugin
{
	public const string GUID = "fl01.skip-readiness-check";

	public const string NAME = "Skip Readiness Check";

	public const string VERSION = "1.1.0";

	internal void Awake()
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		((Component)this).gameObject.AddComponent<MenuChecker>();
		new Harmony("fl01.skip-readiness-check").PatchAll();
	}
}