Decompiled source of SkipIntro UltraDeluxeEdition v1.0.0

plugins/SkipIntroReal.dll

Decompiled a day ago
using System;
using System.Collections;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using RoR2;
using RoR2BepInExPack.GameAssetPathsBetter;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.ResourceManagement.AsyncOperations;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("SkipIntroReal")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+e3f1a5fda79a3af9c4020a98eb8cb4496b5a07e4")]
[assembly: AssemblyProduct("SkipIntroReal")]
[assembly: AssemblyTitle("SkipIntroReal")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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 SkipIntroReal
{
	public static class SkipIntroRealPatch
	{
		public static void Init()
		{
			SkipIntroRealPlugin.Harmony.PatchAll(typeof(SkipIntroRealPatch));
			RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(OnLoad));
			static void OnLoad()
			{
				((MonoBehaviour)RoR2Application.instance).StartCoroutine(TransitionToTitleCoroutine());
			}
			static IEnumerator TransitionToTitleCoroutine()
			{
				yield return null;
				NetworkManager.singleton.ServerChangeScene("title");
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(LoadHelper), "LoadSceneAdditivelyAsync")]
		private static bool SkipIntroScene(string _sceneGuid, ref IEnumerator __result)
		{
			if (_sceneGuid == RoR2_Base_intro.intro_unity && RoR2Application.isLoading)
			{
				__result = EmptyCoroutine();
				return false;
			}
			return true;
			static IEnumerator EmptyCoroutine()
			{
				yield break;
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(LoadHelper), "StartLoadSceneAdditiveAsync")]
		private static bool SkipIntroScene(string _sceneGuid, ref AsyncOperationHandle __result)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			if (_sceneGuid == RoR2_Base_intro.intro_unity && RoR2Application.isLoading)
			{
				__result = default(AsyncOperationHandle);
				return false;
			}
			return true;
		}
	}
	[BepInPlugin("groovesalad.SkipIntroReal", "SkipIntroReal", "1.0.0")]
	public class SkipIntroRealPlugin : BaseUnityPlugin
	{
		public const string GUID = "groovesalad.SkipIntroReal";

		public const string NAME = "SkipIntroReal";

		public const string VERSION = "1.0.0";

		public static ManualLogSource Logger { get; private set; }

		public static Harmony Harmony { get; private set; }

		private void Awake()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Expected O, but got Unknown
			Logger = ((BaseUnityPlugin)this).Logger;
			Harmony = new Harmony("groovesalad.SkipIntroReal");
			SkipIntroRealPatch.Init();
		}
	}
}