Decompiled source of NoIntro v1.0.0

NoIntro.dll

Decompiled 5 days ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("NoIntro")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("NoIntro")]
[assembly: AssemblyTitle("NoIntro")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace NoIntro
{
	[BepInPlugin("NoIntro.adry.ultrakill", "NoIntro", "1.0.0")]
	public class NoIntro : BaseUnityPlugin
	{
		private Harmony harmony;

		private void Awake()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			harmony = new Harmony("NoIntro.adry.ultrakill");
			harmony.PatchAll(typeof(NoIntroPatches));
		}

		private void OnDestroy()
		{
			Harmony obj = harmony;
			if (obj != null)
			{
				obj.UnpatchSelf();
			}
		}
	}
	public static class NoIntroPatches
	{
		private static bool introSkipped;

		[HarmonyPatch(typeof(SceneHelper), "OnSceneLoaded")]
		[HarmonyPostfix]
		public static void OnSceneLoaded_Postfix(Scene scene, LoadSceneMode mode)
		{
			if (!introSkipped)
			{
				if (((Scene)(ref scene)).name == "Bootstrap" || ((Scene)(ref scene)).name == "Intro")
				{
					Debug.Log((object)("NoIntro: " + ((Scene)(ref scene)).name + " scene loaded, loading Main Menu."));
					introSkipped = true;
					SceneHelper.LoadScene("Main Menu", false);
				}
				else
				{
					Debug.Log((object)("NoIntro: Scene " + ((Scene)(ref scene)).name + " loaded. Waiting for Bootstrap or Intro."));
				}
			}
		}
	}
}