Decompiled source of AngryLevelLoader v3.0.1

plugins/AngryLevelLoader/AngryLevelLoader.dll

Decompiled 3 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Cryptography;
using System.Security.Permissions;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using AngryLevelLoader;
using AngryLevelLoader.Containers;
using AngryLevelLoader.DataTypes;
using AngryLevelLoader.DataTypes.MapVarHandlers;
using AngryLevelLoader.Extensions;
using AngryLevelLoader.Fields;
using AngryLevelLoader.Managers;
using AngryLevelLoader.Managers.BannedMods;
using AngryLevelLoader.Managers.LegacyPatches;
using AngryLevelLoader.Managers.ServerManager;
using AngryLevelLoader.Notifications;
using AngryLevelLoader.Patches;
using AngryUiComponents;
using Atlas.Modules.Guns;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Logging;
using FasterPunch;
using HarmonyLib;
using Logic;
using LucasMeshCombine;
using Microsoft.CodeAnalysis;
using MyCoolMod;
using Newtonsoft.Json;
using PluginConfig;
using PluginConfig.API;
using PluginConfig.API.Decorators;
using PluginConfig.API.Fields;
using PluginConfig.API.Functionals;
using ProjectProphet;
using RudeLevelScript;
using RudeLevelScripts;
using RudeLevelScripts.Essentials;
using Steamworks;
using Steamworks.Data;
using TMPro;
using UltraFunGuns;
using UltraTweaker;
using UltraTweaker.Tweaks;
using UltraTweaker.Tweaks.Impl;
using Ultrapain;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.AddressableAssets.ResourceLocators;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.InputSystem;
using UnityEngine.Networking;
using UnityEngine.ResourceManagement.AsyncOperations;
using UnityEngine.ResourceManagement.ResourceProviders;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[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("AngryLevelLoader")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Loads level made with Rude level editor")]
[assembly: AssemblyFileVersion("3.0.1.0")]
[assembly: AssemblyInformationalVersion("3.0.1+65cc30b196266f0dedc806e256a3922b4f0c4823")]
[assembly: AssemblyProduct("AngryLevelLoader")]
[assembly: AssemblyTitle("AngryLevelLoader")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("3.0.1.0")]
[module: UnverifiableCode]
[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;
		}
	}
}
public class CrossThreadInvoker : ISynchronizeInvoke
{
	private class BackgroundUpdater : MonoBehaviour
	{
		public void Update()
		{
			ProcessQueue();
		}
	}

	private class AsyncResult : IAsyncResult
	{
		public Delegate method;

		public object[] args;

		public ManualResetEvent manualResetEvent;

		public Thread invokingThread;

		public bool IsCompleted { get; set; }

		public WaitHandle AsyncWaitHandle => manualResetEvent;

		public object AsyncState { get; set; }

		public bool CompletedSynchronously { get; set; }

		public void Invoke()
		{
			AsyncState = method.DynamicInvoke(args);
			IsCompleted = true;
			manualResetEvent.Set();
		}
	}

	private static CrossThreadInvoker instance;

	private static Thread mainThread;

	private static readonly Queue<AsyncResult> ToExecute = new Queue<AsyncResult>();

	public static CrossThreadInvoker Instance => instance;

	public bool InvokeRequired => mainThread.ManagedThreadId != Thread.CurrentThread.ManagedThreadId;

	public static void Init()
	{
		if (instance == null)
		{
			mainThread = Thread.CurrentThread;
			instance = new CrossThreadInvoker();
			((Component)Plugin.instance).gameObject.AddComponent<BackgroundUpdater>();
		}
	}

	private static void ProcessQueue()
	{
		if (Thread.CurrentThread != mainThread)
		{
			throw new Exception("must be called from the same thread it was created on (created on thread id: " + mainThread.ManagedThreadId + ", called from thread id: " + Thread.CurrentThread.ManagedThreadId);
		}
		AsyncResult asyncResult = null;
		while (true)
		{
			lock (ToExecute)
			{
				if (ToExecute.Count == 0)
				{
					break;
				}
				asyncResult = ToExecute.Dequeue();
			}
			asyncResult.Invoke();
		}
	}

	public IAsyncResult BeginInvoke(Delegate method, object[] args)
	{
		AsyncResult asyncResult = new AsyncResult
		{
			method = method,
			args = args,
			IsCompleted = false,
			manualResetEvent = new ManualResetEvent(initialState: false),
			invokingThread = Thread.CurrentThread
		};
		if (mainThread.ManagedThreadId != asyncResult.invokingThread.ManagedThreadId)
		{
			lock (ToExecute)
			{
				ToExecute.Enqueue(asyncResult);
			}
		}
		else
		{
			asyncResult.Invoke();
			asyncResult.CompletedSynchronously = true;
		}
		return asyncResult;
	}

	public object EndInvoke(IAsyncResult result)
	{
		if (!result.IsCompleted)
		{
			result.AsyncWaitHandle.WaitOne();
		}
		return result.AsyncState;
	}

	public object Invoke(Delegate method, object[] args)
	{
		if (InvokeRequired)
		{
			IAsyncResult result = BeginInvoke(method, args);
			return EndInvoke(result);
		}
		return method.DynamicInvoke(args);
	}
}
namespace AngryLevelLoader
{
	public static class AngryPaths
	{
		public const string SERVER_ROOT_GLOBAL = "https://angry.dnzsoft.com";

		public const string SERVER_ROOT_LOCAL = "http://localhost:3000";

		public static string SERVER_ROOT
		{
			get
			{
				if (!Plugin.useLocalServer.value)
				{
					return "https://angry.dnzsoft.com";
				}
				return "http://localhost:3000";
			}
		}

		public static string ConfigFolderPath => Path.Combine(Paths.ConfigPath, "AngryLevelLoader");

		public static string OnlineCacheFolderPath => Path.Combine(ConfigFolderPath, "OnlineCache");

		public static string ThumbnailCachePath => Path.Combine(OnlineCacheFolderPath, "thumbnailCacheHashes.txt");

		public static string LevelCatalogCachePath => Path.Combine(OnlineCacheFolderPath, "V2", "LevelCatalog.json");

		public static string ScriptCatalogCachePath => Path.Combine(OnlineCacheFolderPath, "ScriptCatalog.json");

		public static string ThumbnailCacheFolderPath => Path.Combine(OnlineCacheFolderPath, "ThumbnailCache");

		public static string LastPlayedMapPath => Path.Combine(ConfigFolderPath, "lastPlayedMap.txt");

		public static string LastUpdateMapPath => Path.Combine(ConfigFolderPath, "lastUpdateMap.txt");

		public static void TryCreateAllPaths()
		{
			IOUtils.TryCreateDirectory(ConfigFolderPath);
			IOUtils.TryCreateDirectory(OnlineCacheFolderPath);
			IOUtils.TryCreateDirectory(ThumbnailCacheFolderPath);
		}
	}
	public class ManifestReader
	{
		public static byte[] GetBytes(string resourceName)
		{
			using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("AngryLevelLoader.Resources." + resourceName);
			byte[] array = new byte[stream.Length];
			stream.Read(array, 0, array.Length);
			return array;
		}
	}
	public class SpaceField : CustomConfigField
	{
		public SpaceField(ConfigPanel parentPanel, float space)
			: base(parentPanel, 60f, space)
		{
		}
	}
	[BepInPlugin("com.eternalUnion.angryLevelLoader", "AngryLevelLoader", "3.0.1")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		public class FolderEnumerator : IEnumerator<AngryBundleContainer>, IEnumerator, IDisposable, IEnumerable<AngryBundleContainer>, IEnumerable
		{
			public readonly FolderButtonField sourceFolder;

			private int currentBundleIndex = -1;

			private Stack<FolderButtonField> currentFolderStack = new Stack<FolderButtonField>();

			private List<AngryBundleContainer> currentBundles;

			public AngryBundleContainer Current => currentBundles[currentBundleIndex];

			object IEnumerator.Current => Current;

			private static AngryBundleContainer[] Test()
			{
				return new FolderEnumerator(pathToFolderMap["/"]).ToArray();
			}

			public FolderEnumerator(FolderButtonField folder)
			{
				sourceFolder = folder;
				currentFolderStack.Push(folder);
				currentBundles = folderToBundleMap[folder];
			}

			public void Dispose()
			{
			}

			public bool MoveNext()
			{
				currentBundleIndex++;
				if (currentBundleIndex < currentBundles.Count)
				{
					return true;
				}
				currentBundleIndex = 0;
				while (currentFolderStack.Count != 0)
				{
					FolderButtonField key = currentFolderStack.Peek();
					if (folderToFolderMap.TryGetValue(key, out var value) && value.Count != 0)
					{
						key = value[0];
						currentBundles = folderToBundleMap[key];
						currentFolderStack.Push(key);
						if (currentBundles.Count != 0)
						{
							return true;
						}
						continue;
					}
					while (currentFolderStack.Count > 1)
					{
						key = currentFolderStack.Pop();
						FolderButtonField key2 = currentFolderStack.Peek();
						List<FolderButtonField> list = folderToFolderMap[key2];
						int num = list.IndexOf(key) + 1;
						if (num < list.Count)
						{
							key = list[num];
							currentFolderStack.Push(key);
							currentBundles = folderToBundleMap[key];
							if (currentBundles.Count == 0)
							{
								break;
							}
							return true;
						}
					}
					if (currentFolderStack.Count <= 1)
					{
						return false;
					}
				}
				return false;
			}

			public void Reset()
			{
				currentFolderStack.Clear();
				currentFolderStack.Push(sourceFolder);
				currentBundles = folderToBundleMap[sourceFolder];
				currentBundleIndex = -1;
			}

			public IEnumerator<AngryBundleContainer> GetEnumerator()
			{
				return this;
			}

			IEnumerator IEnumerable.GetEnumerator()
			{
				return this;
			}
		}

		public enum CustomLevelButtonPosition
		{
			Top,
			Bottom,
			Disabled
		}

		public enum BundleSorting
		{
			Alphabetically,
			Author,
			LastPlayed,
			LastUpdate
		}

		public enum DefaultLeaderboardCategory
		{
			All,
			PRank,
			Challenge,
			Nomo,
			Nomow
		}

		public enum DefaultLeaderboardDifficulty
		{
			Any,
			Harmless,
			Lenient,
			Standard,
			Violent,
			Brutal
		}

		public enum DefaultLeaderboardFilter
		{
			Global,
			Friends
		}

		private class RecordInfoJsonWrapper
		{
			public string category { get; set; }

			public string difficulty { get; set; }

			public string bundleGuid { get; set; }

			public string hash { get; set; }

			public string levelId { get; set; }

			public int time { get; set; }

			public RecordInfoJsonWrapper()
			{
			}

			public RecordInfoJsonWrapper(AngryLeaderboards.PostRecordInfo record)
			{
				category = AngryLeaderboards.RECORD_CATEGORY_DICT[record.category];
				difficulty = AngryLeaderboards.RECORD_DIFFICULTY_DICT[record.difficulty];
				bundleGuid = record.bundleGuid;
				hash = record.hash;
				levelId = record.levelId;
				time = record.time;
			}

			public bool TryParseRecordInfo(out AngryLeaderboards.PostRecordInfo record)
			{
				record = default(AngryLeaderboards.PostRecordInfo);
				record.category = AngryLeaderboards.RECORD_CATEGORY_DICT.FirstOrDefault((KeyValuePair<AngryLeaderboards.RecordCategory, string> i) => i.Value == category).Key;
				if (AngryLeaderboards.RECORD_CATEGORY_DICT[record.category] != category)
				{
					return false;
				}
				record.difficulty = AngryLeaderboards.RECORD_DIFFICULTY_DICT.FirstOrDefault((KeyValuePair<AngryLeaderboards.RecordDifficulty, string> i) => i.Value == difficulty).Key;
				if (AngryLeaderboards.RECORD_DIFFICULTY_DICT[record.difficulty] != difficulty)
				{
					return false;
				}
				record.bundleGuid = bundleGuid;
				record.hash = hash;
				record.levelId = levelId;
				record.time = time;
				return true;
			}
		}

		[CompilerGenerated]
		private static class <>O
		{
			public static UnityAction<Scene, LoadSceneMode> <0>__RefreshCatalogOnMainMenu;

			public static OnClick <1>__ProcessPendingRecords;

			public static Action<string> <2>__UpdateBundleSearch;
		}

		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static Func<AngryBundleContainer, bool> <>9__41_1;

			public static Func<string, string> <>9__43_0;

			public static Func<string, bool> <>9__47_0;

			public static Func<AngryBundleContainer, string> <>9__48_0;

			public static Func<AngryBundleContainer, string> <>9__48_1;

			public static Func<AngryBundleContainer, long> <>9__48_2;

			public static Func<AngryBundleContainer, long> <>9__48_3;

			public static Func<GameObject, bool> <>9__111_0;

			public static Func<GameObject, bool> <>9__115_0;

			public static FileSystemEventHandler <>9__117_0;

			public static RenamedEventHandler <>9__117_1;

			public static FileSystemEventHandler <>9__117_2;

			public static FileSystemEventHandler <>9__117_3;

			public static PostPresetChangeEvent <>9__118_0;

			public static Func<string, bool> <>9__118_20;

			public static Func<string, string> <>9__118_21;

			public static OpenPanelEventDelegate <>9__118_1;

			public static OpenPanelEventDelegate <>9__118_2;

			public static EnumValueChangeEventDelegate<BundleSorting> <>9__118_3;

			public static PostStringListValueChangeEvent <>9__118_23;

			public static OpenPanelEventDelegate <>9__118_4;

			public static OnClick <>9__118_5;

			public static OnClick <>9__118_6;

			public static KeyCodeValueChangeEventDelegate <>9__118_7;

			public static PostEnumValueChangeEvent<CustomLevelButtonPosition> <>9__118_8;

			public static PostColorValueChangeEvent <>9__118_9;

			public static PostColorValueChangeEvent <>9__118_10;

			public static BoolValueChangeEventDelegate <>9__118_11;

			public static BoolValueChangeEventDelegate <>9__118_12;

			public static BoolValueChangeEventDelegate <>9__118_13;

			public static OnClick <>9__118_15;

			public static OnClick <>9__118_17;

			public static Func<RudeLevelData, string> <>9__118_25;

			public static Func<RudeLevelData, int> <>9__118_26;

			public static Func<Task, bool> <>9__125_0;

			public static BoolValueChangeEventDelegate <>9__128_0;

			public static PostBoolValueChangeEvent <>9__128_1;

			public static UnityAction<Scene, LoadSceneMode> <>9__128_2;

			public static OpenPanelEventDelegate <>9__128_4;

			public static OpenPanelEventDelegate <>9__128_5;

			public static Action <>9__128_7;

			public static Action<bool> <>9__128_8;

			internal bool <OpenFolder>b__41_1(AngryBundleContainer bundle)
			{
				return bundle.bundleData != null;
			}

			internal string <UpdateBundleSearch>b__43_0(string keyword)
			{
				return keyword.ToLower();
			}

			internal bool <ScanForLevels>b__47_0(string path)
			{
				return validImageExts.Contains<string>(Path.GetExtension(path));
			}

			internal string <SortBundles>b__48_0(AngryBundleContainer b)
			{
				return b.bundleData.bundleName;
			}

			internal string <SortBundles>b__48_1(AngryBundleContainer b)
			{
				return b.bundleData.bundleAuthor;
			}

			internal long <SortBundles>b__48_2(AngryBundleContainer b)
			{
				if (lastPlayed.TryGetValue(b.bundleData.bundleGuid, out var value))
				{
					return value;
				}
				return 0L;
			}

			internal long <SortBundles>b__48_3(AngryBundleContainer b)
			{
				if (lastUpdate.TryGetValue(b.bundleData.bundleGuid, out var value))
				{
					return value;
				}
				return 0L;
			}

			internal bool <CreateCustomLevelButtonOnMainMenuAsync>b__111_0(GameObject obj)
			{
				return ((Object)obj).name == "Canvas";
			}

			internal bool <CreateAngryUIAsync>b__115_0(GameObject obj)
			{
				return ((Object)obj).name == "Canvas";
			}

			internal void <InitializeFileWatcher>b__117_0(object sender, FileSystemEventArgs e)
			{
				string fullPath = e.FullPath;
				foreach (AngryBundleContainer value in angryBundles.Values)
				{
					if (IOUtils.PathEquals(fullPath, value.pathToAngryBundle))
					{
						logger.LogWarning((object)("Bundle " + fullPath + " was updated, container notified"));
						value.FileChanged();
						break;
					}
				}
			}

			internal void <InitializeFileWatcher>b__117_1(object sender, RenamedEventArgs e)
			{
				string fullPath = e.FullPath;
				foreach (AngryBundleContainer value in angryBundles.Values)
				{
					if (IOUtils.PathEquals(fullPath, value.pathToAngryBundle))
					{
						logger.LogWarning((object)("Bundle " + fullPath + " was renamed, path updated"));
						value.pathToAngryBundle = fullPath;
						break;
					}
				}
			}

			internal void <InitializeFileWatcher>b__117_2(object sender, FileSystemEventArgs e)
			{
				string fullPath = e.FullPath;
				foreach (AngryBundleContainer value in angryBundles.Values)
				{
					if (IOUtils.PathEquals(fullPath, value.pathToAngryBundle))
					{
						logger.LogWarning((object)("Bundle " + fullPath + " was deleted, unlinked"));
						value.pathToAngryBundle = "";
						break;
					}
				}
			}

			internal void <InitializeFileWatcher>b__117_3(object sender, FileSystemEventArgs e)
			{
				string fullPath = e.FullPath;
				if (AngryFileUtils.TryGetAngryBundleData(fullPath, out var data, out var _) && angryBundles.TryGetValue(data.bundleGuid, out var value) && value.bundleData.bundleGuid == data.bundleGuid && !File.Exists(value.pathToAngryBundle))
				{
					logger.LogWarning((object)("Bundle " + fullPath + " was just added, and a container with the same guid had no file linked. Linked, container notified"));
					value.pathToAngryBundle = fullPath;
					value.FileChanged();
				}
			}

			internal void <InitializeConfig>b__118_0(string b, string a)
			{
				UpdateAllUI();
			}

			internal void <InitializeConfig>b__118_1(bool external)
			{
				if (newLevelToggle.value)
				{
					newLevelNotifier.text = string.Join("\n", from level in newLevelNotifierLevels.value.Split('`')
						where !string.IsNullOrEmpty(level)
						select level into name
						select "<color=#00FF00>New level: " + name + "</color>");
					((ConfigField)newLevelNotifier).hidden = false;
					newLevelNotifierLevels.value = "";
				}
				newLevelToggle.value = false;
			}

			internal bool <InitializeConfig>b__118_20(string level)
			{
				return !string.IsNullOrEmpty(level);
			}

			internal string <InitializeConfig>b__118_21(string name)
			{
				return "<color=#00FF00>New level: " + name + "</color>";
			}

			internal void <InitializeConfig>b__118_2(bool e)
			{
				((ConfigField)newLevelNotifier).hidden = true;
			}

			internal void <InitializeConfig>b__118_3(EnumValueChangeEvent<BundleSorting> e)
			{
				bundleSortingMode.value = e.value;
				SortBundles();
			}

			internal void <InitializeConfig>b__118_23(string gamemodeName, int gamemodeIndex)
			{
				difficultyField.TriggerPostDifficultyChangeEvent();
			}

			internal void <InitializeConfig>b__118_4(bool externally)
			{
				difficultyField.TriggerPostDifficultyChangeEvent();
			}

			internal void <InitializeConfig>b__118_5()
			{
				Application.OpenURL(levelsPath);
			}

			internal void <InitializeConfig>b__118_6()
			{
				openButtons.SetButtonInteractable(1, false);
				PluginUpdateHandler.CheckPluginUpdate();
			}

			internal void <InitializeConfig>b__118_7(KeyCodeValueChangeEvent e)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_000b: Invalid comparison between Unknown and I4
				//IL_000e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0018: Invalid comparison between Unknown and I4
				//IL_001b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0025: Invalid comparison between Unknown and I4
				if ((int)e.value == 323 || (int)e.value == 324 || (int)e.value == 325)
				{
					e.canceled = true;
				}
			}

			internal void <InitializeConfig>b__118_8(CustomLevelButtonPosition pos)
			{
				//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
				//IL_005e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0077: Unknown result type (might be due to invalid IL or missing references)
				//IL_0081: Unknown result type (might be due to invalid IL or missing references)
				//IL_0195: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
				//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
				//IL_0212: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
				//IL_011c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0130: Unknown result type (might be due to invalid IL or missing references)
				//IL_013a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0153: Unknown result type (might be due to invalid IL or missing references)
				//IL_0176: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)currentCustomLevelButton == (Object)null)
				{
					return;
				}
				((Component)currentCustomLevelButton).gameObject.SetActive(true);
				switch (pos)
				{
				case CustomLevelButtonPosition.Disabled:
					((Component)currentCustomLevelButton).gameObject.SetActive(false);
					break;
				case CustomLevelButtonPosition.Bottom:
					((Component)currentCustomLevelButton).transform.localPosition = new Vector3(((Component)currentCustomLevelButton).transform.localPosition.x, -303f, ((Component)currentCustomLevelButton).transform.localPosition.z);
					break;
				case CustomLevelButtonPosition.Top:
					((Component)currentCustomLevelButton).transform.localPosition = new Vector3(((Component)currentCustomLevelButton).transform.localPosition.x, 192f, ((Component)currentCustomLevelButton).transform.localPosition.z);
					break;
				}
				if ((Object)(object)bossRushButton != (Object)null)
				{
					if (pos == CustomLevelButtonPosition.Bottom)
					{
						currentCustomLevelButton.rect.sizeDelta = new Vector2(187.5f, 50f);
						((Component)currentCustomLevelButton).transform.localPosition = new Vector3(-96.25f, ((Component)currentCustomLevelButton).transform.localPosition.y, ((Component)currentCustomLevelButton).transform.localPosition.z);
						bossRushButton.sizeDelta = new Vector2(187.5f, 50f);
						((Component)bossRushButton).transform.localPosition = new Vector3(96.25f, -303f, 0f);
					}
					else
					{
						currentCustomLevelButton.rect.sizeDelta = new Vector2(380f, 50f);
						((Component)currentCustomLevelButton).transform.localPosition = new Vector3(0f, ((Component)currentCustomLevelButton).transform.localPosition.y, ((Component)currentCustomLevelButton).transform.localPosition.z);
						bossRushButton.sizeDelta = new Vector2(380f, 50f);
						((Component)bossRushButton).transform.localPosition = new Vector3(0f, -303f, 0f);
					}
				}
			}

			internal void <InitializeConfig>b__118_9(Color clr)
			{
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_0030: Unknown result type (might be due to invalid IL or missing references)
				//IL_0038: Unknown result type (might be due to invalid IL or missing references)
				//IL_003e: Unknown result type (might be due to invalid IL or missing references)
				//IL_004a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0050: Unknown result type (might be due to invalid IL or missing references)
				//IL_005c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0062: Unknown result type (might be due to invalid IL or missing references)
				//IL_006e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0082: Unknown result type (might be due to invalid IL or missing references)
				if (!((Object)(object)currentCustomLevelButton == (Object)null))
				{
					ColorBlock colors = default(ColorBlock);
					((ColorBlock)(ref colors)).colorMultiplier = 1f;
					((ColorBlock)(ref colors)).fadeDuration = 0.1f;
					((ColorBlock)(ref colors)).normalColor = clr;
					((ColorBlock)(ref colors)).selectedColor = clr * 0.8f;
					((ColorBlock)(ref colors)).highlightedColor = clr * 0.8f;
					((ColorBlock)(ref colors)).pressedColor = clr * 0.5f;
					((ColorBlock)(ref colors)).disabledColor = Color.gray;
					((Selectable)currentCustomLevelButton.button).colors = colors;
				}
			}

			internal void <InitializeConfig>b__118_10(Color clr)
			{
				//IL_0018: Unknown result type (might be due to invalid IL or missing references)
				if (!((Object)(object)currentCustomLevelButton == (Object)null))
				{
					((Graphic)currentCustomLevelButton.text).color = clr;
				}
			}

			internal void <InitializeConfig>b__118_11(BoolValueChangeEvent e)
			{
				levelUpdateNotifierToggle.value = e.value;
				OnlineLevelsManager.CheckLevelUpdateText();
			}

			internal void <InitializeConfig>b__118_12(BoolValueChangeEvent e)
			{
				levelUpdateIgnoreCustomBuilds.value = e.value;
				OnlineLevelsManager.CheckLevelUpdateText();
			}

			internal void <InitializeConfig>b__118_13(BoolValueChangeEvent e)
			{
				newLevelNotifierToggle.value = e.value;
				if (!e.value)
				{
					((ConfigField)newLevelNotifier).hidden = true;
				}
			}

			internal void <InitializeConfig>b__118_15()
			{
				NotificationPanel.Open((Notification)(object)new DeleteOldBundlesNotification());
			}

			internal void <InitializeConfig>b__118_17()
			{
				ScanForLevels();
			}

			internal string <InitializeConfig>b__118_25(RudeLevelData data)
			{
				return data.uniqueIdentifier;
			}

			internal int <InitializeConfig>b__118_26(RudeLevelData d)
			{
				return d.prefferedLevelOrder;
			}

			internal bool <ProcessPendingRecords>b__125_0(Task task)
			{
				return ((ConfigField)sendPendingRecords).interactable = true;
			}

			internal void <PostAwake>b__128_0(BoolValueChangeEvent e)
			{
				if (e.value)
				{
					e.canceled = true;
					NotificationPanel.Open((Notification)(object)new LeaderboardPermissionNotification());
				}
			}

			internal void <PostAwake>b__128_1(bool newVal)
			{
				((ConfigField)leaderboardsDivision).hidden = newVal;
			}

			internal void <PostAwake>b__128_2(Scene scene, LoadSceneMode mode)
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0002: Invalid comparison between Unknown and I4
				if ((int)mode != 1)
				{
					if (AngrySceneManager.isInCustomLevel)
					{
						_ = AngrySceneManager.currentBundleContainer.bundleData.bundleVersion;
						LegacyPatchManager.SetLegacyPatchState(LegacyPatchState.None);
					}
					else
					{
						LegacyPatchManager.SetLegacyPatchState(LegacyPatchState.None);
					}
				}
			}

			internal void <PostAwake>b__128_4(bool externally)
			{
				if (AngryLeaderboards.bannedModsListLoaded)
				{
					CheckForBannedMods();
				}
				else
				{
					AngryLeaderboards.LoadBannedModsList();
				}
			}

			internal void <PostAwake>b__128_5(bool externally)
			{
				//IL_001b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0025: Expected O, but got Unknown
				//IL_0036: Unknown result type (might be due to invalid IL or missing references)
				//IL_0040: Expected O, but got Unknown
				<>c__DisplayClass128_0 CS$<>8__locals0 = new <>c__DisplayClass128_0
				{
					backButtonEvent = PluginConfiguratorController.backButton.onClick
				};
				PluginConfiguratorController.backButton.onClick = new ButtonClickedEvent();
				((UnityEvent)PluginConfiguratorController.backButton.onClick).AddListener((UnityAction)delegate
				{
					if (folderStack.Count <= 1 || !string.IsNullOrEmpty(searchBar.value))
					{
						((UnityEvent)CS$<>8__locals0.backButtonEvent).Invoke();
					}
					else
					{
						folderStack.Pop();
						if (folderStack.Count != 0)
						{
							OpenFolder(folderStack.Peek());
						}
						else
						{
							OpenFolder(null);
						}
					}
				});
			}

			internal void <PostAwake>b__128_7()
			{
				searchBar.value = "";
			}

			internal void <PostAwake>b__128_8(bool wasCanceled)
			{
				if (wasCanceled)
				{
					if (!string.IsNullOrWhiteSpace(searchBar.value))
					{
						searchBar.value = "";
					}
					else if (folderStack.Count <= 1)
					{
						config.rootPanel.ClosePanel();
					}
				}
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass111_0
		{
			public GameObject canvasObj;

			public Transform chapterSelect;

			internal void <CreateCustomLevelButtonOnMainMenuAsync>b__1()
			{
				//IL_013d: Unknown result type (might be due to invalid IL or missing references)
				Transform val = canvasObj.transform.Find("OptionsMenu");
				if ((Object)(object)val == (Object)null)
				{
					logger.LogError((object)"Angry tried to find the options menu but failed!");
					return;
				}
				((Component)chapterSelect).gameObject.SetActive(false);
				((Component)val).gameObject.SetActive(true);
				Transform val2 = ((Component)val).transform.Find("Navigation Rail/PluginConfiguratorButton(Clone)");
				if ((Object)(object)val2 == (Object)null)
				{
					val2 = ((Component)val).transform.Find("Navigation Rail/PluginConfiguratorButton");
				}
				if ((Object)(object)val2 == (Object)null)
				{
					logger.LogError((object)"Angry tried to find the plugin configurator button but failed!");
					return;
				}
				Transform val3 = val.Find("Navigation Rail");
				ButtonHighlightParent val4 = default(ButtonHighlightParent);
				if ((Object)(object)val3 != (Object)null && ((Component)val3).gameObject.TryGetComponent<ButtonHighlightParent>(ref val4) && (val4.buttons == null || val4.buttons.Length == 0))
				{
					val4.Start();
					val4.targetOnStart = null;
				}
				((UnityEvent)((Component)val2).gameObject.GetComponent<Button>().onClick).Invoke();
				if ((Object)(object)PluginConfiguratorController.activePanel != (Object)null)
				{
					PluginConfiguratorController.activePanel.SetActive(false);
				}
				((Component)PluginConfiguratorController.mainPanel).gameObject.SetActive(false);
				config.rootPanel.OpenPanelInternally(false);
				config.rootPanel.currentPanel.rect.normalizedPosition = new Vector2(0f, 1f);
				int @int = MonoSingleton<PrefsManager>.Instance.GetInt("difficulty", 3);
				switch (@int)
				{
				case 0:
				case 1:
				case 2:
				case 3:
				case 4:
					logger.LogInfo((object)("Angry setting difficulty to " + difficultyList[@int]));
					difficultyField.difficultyListValueIndex = @int;
					break;
				case 5:
					if (ultrapainLoaded)
					{
						if (GetUltrapainDifficultySet())
						{
							difficultyField.difficultyListValueIndex = difficultyList.IndexOf("ULTRAPAIN");
							break;
						}
						logger.LogWarning((object)"Difficulty was set to UKMD, but angry does not support it. Setting to violent");
						difficultyField.difficultyListValueIndex = 3;
					}
					break;
				default:
					if (heavenOrHellLoaded)
					{
						if (GetHeavenOrHellDifficultySet())
						{
							difficultyField.difficultyListValueIndex = difficultyList.IndexOf("HEAVEN OR HELL");
							break;
						}
						logger.LogWarning((object)"Unknown difficulty, defaulting to violent");
						difficultyField.difficultyListValueIndex = 3;
					}
					break;
				}
				difficultyField.TriggerPostDifficultyChangeEvent();
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass128_0
		{
			public ButtonClickedEvent backButtonEvent;

			internal void <PostAwake>b__6()
			{
				if (folderStack.Count <= 1 || !string.IsNullOrEmpty(searchBar.value))
				{
					((UnityEvent)backButtonEvent).Invoke();
					return;
				}
				folderStack.Pop();
				if (folderStack.Count != 0)
				{
					OpenFolder(folderStack.Peek());
				}
				else
				{
					OpenFolder(null);
				}
			}
		}

		[CompilerGenerated]
		private sealed class <CreateAngryUIAsync>d__115 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <CreateAngryUIAsync>d__115(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_003d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0042: Unknown result type (might be due to invalid IL or missing references)
				//IL_009b: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = null;
					<>1__state = 1;
					return true;
				case 1:
				{
					<>1__state = -1;
					if ((Object)(object)currentPanel != (Object)null)
					{
						return false;
					}
					Scene activeScene = SceneManager.GetActiveScene();
					GameObject val = (from obj in ((Scene)(ref activeScene)).GetRootGameObjects()
						where ((Object)obj).name == "Canvas"
						select obj).FirstOrDefault();
					if ((Object)(object)val == (Object)null)
					{
						logger.LogWarning((object)"Angry tried to create main menu buttons, but root canvas was not found!");
						return false;
					}
					currentPanel = Addressables.InstantiateAsync((object)"AngryLevelLoader/UI/AngryUIPanel.prefab", val.transform, false, true).WaitForCompletion().GetComponent<AngryUIPanelComponent>();
					currentPanel.reloadBundlePrompt.MakeTransparent(true);
					return false;
				}
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[CompilerGenerated]
		private sealed class <CreateCustomLevelButtonOnMainMenuAsync>d__111 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			private <>c__DisplayClass111_0 <>8__1;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <CreateCustomLevelButtonOnMainMenuAsync>d__111(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>8__1 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0044: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
				//IL_0139: Unknown result type (might be due to invalid IL or missing references)
				//IL_0143: Expected O, but got Unknown
				//IL_015e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0168: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>8__1 = new <>c__DisplayClass111_0();
					<>2__current = null;
					<>1__state = 1;
					return true;
				case 1:
				{
					<>1__state = -1;
					<>c__DisplayClass111_0 <>c__DisplayClass111_ = <>8__1;
					Scene activeScene = SceneManager.GetActiveScene();
					<>c__DisplayClass111_.canvasObj = (from obj in ((Scene)(ref activeScene)).GetRootGameObjects()
						where ((Object)obj).name == "Canvas"
						select obj).FirstOrDefault();
					if ((Object)(object)<>8__1.canvasObj == (Object)null)
					{
						logger.LogWarning((object)"Angry tried to create main menu buttons, but root canvas was not found!");
						return false;
					}
					Transform val = <>8__1.canvasObj.transform.Find("Chapter Select/Chapters");
					if ((Object)(object)val != (Object)null)
					{
						<>8__1.chapterSelect = <>8__1.canvasObj.transform.Find("Chapter Select");
						GameObject obj2 = Addressables.InstantiateAsync((object)"AngryLevelLoader/UI/CustomLevels.prefab", val, false, true).WaitForCompletion();
						Transform val2 = val.Find("Boss Rush Button");
						if ((Object)(object)val2 != (Object)null)
						{
							bossRushButton = ((Component)val2).gameObject.GetComponent<RectTransform>();
						}
						currentCustomLevelButton = obj2.GetComponent<AngryCustomLevelButtonComponent>();
						currentCustomLevelButton.button.onClick = new ButtonClickedEvent();
						((UnityEvent)currentCustomLevelButton.button.onClick).AddListener((UnityAction)delegate
						{
							//IL_013d: Unknown result type (might be due to invalid IL or missing references)
							Transform val3 = <>8__1.canvasObj.transform.Find("OptionsMenu");
							if ((Object)(object)val3 == (Object)null)
							{
								logger.LogError((object)"Angry tried to find the options menu but failed!");
							}
							else
							{
								((Component)<>8__1.chapterSelect).gameObject.SetActive(false);
								((Component)val3).gameObject.SetActive(true);
								Transform val4 = ((Component)val3).transform.Find("Navigation Rail/PluginConfiguratorButton(Clone)");
								if ((Object)(object)val4 == (Object)null)
								{
									val4 = ((Component)val3).transform.Find("Navigation Rail/PluginConfiguratorButton");
								}
								if ((Object)(object)val4 == (Object)null)
								{
									logger.LogError((object)"Angry tried to find the plugin configurator button but failed!");
								}
								else
								{
									Transform val5 = val3.Find("Navigation Rail");
									ButtonHighlightParent val6 = default(ButtonHighlightParent);
									if ((Object)(object)val5 != (Object)null && ((Component)val5).gameObject.TryGetComponent<ButtonHighlightParent>(ref val6) && (val6.buttons == null || val6.buttons.Length == 0))
									{
										val6.Start();
										val6.targetOnStart = null;
									}
									((UnityEvent)((Component)val4).gameObject.GetComponent<Button>().onClick).Invoke();
									if ((Object)(object)PluginConfiguratorController.activePanel != (Object)null)
									{
										PluginConfiguratorController.activePanel.SetActive(false);
									}
									((Component)PluginConfiguratorController.mainPanel).gameObject.SetActive(false);
									config.rootPanel.OpenPanelInternally(false);
									config.rootPanel.currentPanel.rect.normalizedPosition = new Vector2(0f, 1f);
									int @int = MonoSingleton<PrefsManager>.Instance.GetInt("difficulty", 3);
									switch (@int)
									{
									case 0:
									case 1:
									case 2:
									case 3:
									case 4:
										logger.LogInfo((object)("Angry setting difficulty to " + difficultyList[@int]));
										difficultyField.difficultyListValueIndex = @int;
										break;
									case 5:
										if (ultrapainLoaded)
										{
											if (GetUltrapainDifficultySet())
											{
												difficultyField.difficultyListValueIndex = difficultyList.IndexOf("ULTRAPAIN");
											}
											else
											{
												logger.LogWarning((object)"Difficulty was set to UKMD, but angry does not support it. Setting to violent");
												difficultyField.difficultyListValueIndex = 3;
											}
										}
										break;
									default:
										if (heavenOrHellLoaded)
										{
											if (GetHeavenOrHellDifficultySet())
											{
												difficultyField.difficultyListValueIndex = difficultyList.IndexOf("HEAVEN OR HELL");
											}
											else
											{
												logger.LogWarning((object)"Unknown difficulty, defaulting to violent");
												difficultyField.difficultyListValueIndex = 3;
											}
										}
										break;
									}
									difficultyField.TriggerPostDifficultyChangeEvent();
								}
							}
						});
						customLevelButtonPosition.TriggerPostValueChangeEvent();
						customLevelButtonFrameColor.TriggerPostValueChangeEvent();
						customLevelButtonTextColor.TriggerPostValueChangeEvent();
					}
					else
					{
						logger.LogWarning((object)"Angry tried to find chapter select menu, but root canvas was not found!");
					}
					return false;
				}
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		public const string PLUGIN_NAME = "AngryLevelLoader";

		public const string PLUGIN_GUID = "com.eternalUnion.angryLevelLoader";

		public const string PLUGIN_VERSION = "3.0.1";

		public const string PLUGIN_CONFIG_MIN_VERSION = "1.8.0";

		public static readonly Vector3 defaultGravity = new Vector3(0f, -40f, 0f);

		public static string workingDir;

		public static string tempFolderPath;

		public static string dataPath;

		public static string levelsPath;

		public static string mapVarsFolderPath;

		public static string angryCatalogPath;

		public static Plugin instance;

		public static ManualLogSource logger;

		public static PluginConfigurator internalConfig;

		public static BoolField devMode;

		public static StringField lastVersion;

		public static StringField updateLastVersion;

		public static BoolField ignoreUpdates;

		public static StringField configDataPath;

		public static BoolField leaderboardToggle;

		public static BoolField askedPermissionForLeaderboards;

		public static BoolField showLeaderboardOnLevelEnd;

		public static BoolField showLeaderboardOnSecretLevelEnd;

		public static StringField pendingRecordsField;

		public static bool ultrapainLoaded = false;

		public static bool heavenOrHellLoaded = false;

		public static Dictionary<string, RudeLevelData> idDictionary = new Dictionary<string, RudeLevelData>();

		public static Dictionary<string, AngryBundleContainer> angryBundles = new Dictionary<string, AngryBundleContainer>();

		public static Dictionary<string, FolderButtonField> pathToFolderMap = new Dictionary<string, FolderButtonField>();

		public static Dictionary<FolderButtonField, List<AngryBundleContainer>> folderToBundleMap = new Dictionary<FolderButtonField, List<AngryBundleContainer>>();

		public static Dictionary<FolderButtonField, List<FolderButtonField>> folderToFolderMap = new Dictionary<FolderButtonField, List<FolderButtonField>>();

		public static Stack<FolderButtonField> folderStack = new Stack<FolderButtonField>();

		internal static string[] currentSearchKeywords = new string[0];

		public static Dictionary<string, long> lastPlayed = new Dictionary<string, long>();

		public static Dictionary<string, long> lastUpdate = new Dictionary<string, long>();

		private static char[] whitespaceSeparator = new char[1] { ' ' };

		private static int numOfOldBundles = 0;

		private static string[] validImageExts = new string[3] { ".jpg", ".jpeg", ".png" };

		public static int selectedDifficulty = 3;

		public static DifficultyField difficultyField;

		internal static List<string> difficultyList = new List<string> { "HARMLESS", "LENIENT", "STANDARD", "VIOLENT", "BRUTAL" };

		internal static List<string> gamemodeList = new List<string> { "None", "No Monsters", "No Monsters/Weapons" };

		public static Harmony harmony;

		public static PluginConfigurator config;

		public static ConfigHeader levelUpdateNotifier;

		public static ConfigHeader newLevelNotifier;

		public static StringField newLevelNotifierLevels;

		public static BoolField newLevelToggle;

		public static ConfigHeader errorText;

		public static ConfigHeader levelBundlesHeader;

		public static SearchBarField searchBar;

		public static ConfigDivision folderDivision;

		public static ConfigDivision bundleDivision;

		public static ConfigHeader searchInfo;

		public static ConfigDivision leaderboardsDivision;

		public static ConfigPanel bannedModsPanel;

		public static ConfigHeader bannedModsText;

		public static ConfigPanel pendingRecords;

		public static ButtonField sendPendingRecords;

		public static ConfigHeader pendingRecordsStatus;

		public static ConfigHeader pendingRecordsInfo;

		public static ButtonArrayField openButtons;

		public static KeyCodeField reloadFileKeybind;

		public static EnumField<CustomLevelButtonPosition> customLevelButtonPosition;

		public static ColorField customLevelButtonFrameColor;

		public static ColorField customLevelButtonTextColor;

		public static BoolField refreshCatalogOnBoot;

		public static BoolField checkForUpdates;

		public static BoolField levelUpdateNotifierToggle;

		public static BoolField levelUpdateIgnoreCustomBuilds;

		public static BoolField newLevelNotifierToggle;

		public static BoolField scriptAutoUpdate;

		public static List<string> scriptCertificateIgnore = new List<string>();

		public static StringMultilineField scriptCertificateIgnoreField;

		public static BoolField useDevelopmentBranch;

		public static BoolField useLocalServer;

		public static BoolField scriptUpdateIgnoreCustom;

		public static EnumField<BundleSorting> bundleSortingMode;

		public static EnumField<DefaultLeaderboardCategory> defaultLeaderboardCategory;

		public static EnumField<DefaultLeaderboardDifficulty> defaultLeaderboardDifficulty;

		public static EnumField<DefaultLeaderboardFilter> defaultLeaderboardFilter;

		private const string CUSTOM_LEVEL_BUTTON_ASSET_PATH = "AngryLevelLoader/UI/CustomLevels.prefab";

		private static AngryCustomLevelButtonComponent currentCustomLevelButton;

		private static RectTransform bossRushButton;

		private const string ANGRY_UI_PANEL_ASSET_PATH = "AngryLevelLoader/UI/AngryUIPanel.prefab";

		public static AngryUIPanelComponent currentPanel;

		internal static FileSystemWatcher watcher;

		private static Task pendingRecordsTask = null;

		private float lastPress;

		public static bool NoMonsters
		{
			get
			{
				if (difficultyField.gamemodeListValueIndex != 1)
				{
					return difficultyField.gamemodeListValueIndex == 2;
				}
				return true;
			}
		}

		public static bool NoWeapons => difficultyField.gamemodeListValueIndex == 2;

		public static void LoadLastPlayedMap()
		{
			lastPlayed.Clear();
			string lastPlayedMapPath = AngryPaths.LastPlayedMapPath;
			if (!File.Exists(lastPlayedMapPath))
			{
				return;
			}
			using StreamReader streamReader = new StreamReader(File.Open(lastPlayedMapPath, FileMode.Open, FileAccess.Read));
			while (!streamReader.EndOfStream)
			{
				string key = streamReader.ReadLine();
				if (streamReader.EndOfStream)
				{
					logger.LogWarning((object)"Invalid end of last played map file");
					break;
				}
				string text = streamReader.ReadLine();
				if (long.TryParse(text, out var result))
				{
					lastPlayed[key] = result;
				}
				else
				{
					logger.LogInfo((object)("Invalid last played time '" + text + "'"));
				}
			}
		}

		public static void UpdateLastPlayed(AngryBundleContainer bundle)
		{
			string bundleGuid = bundle.bundleData.bundleGuid;
			if (bundleGuid.Length != 32)
			{
				return;
			}
			if (bundleSortingMode.value == BundleSorting.LastPlayed)
			{
				((ConfigField)bundle.rootPanel).siblingIndex = 0;
			}
			long value = ((DateTimeOffset)DateTime.UtcNow).ToUnixTimeSeconds();
			lastPlayed[bundleGuid] = value;
			string lastPlayedMapPath = AngryPaths.LastPlayedMapPath;
			IOUtils.TryCreateDirectoryForFile(lastPlayedMapPath);
			using StreamWriter streamWriter = new StreamWriter(File.Open(lastPlayedMapPath, FileMode.OpenOrCreate, FileAccess.Write));
			streamWriter.BaseStream.Seek(0L, SeekOrigin.Begin);
			streamWriter.BaseStream.SetLength(0L);
			foreach (KeyValuePair<string, long> item in lastPlayed)
			{
				streamWriter.WriteLine(item.Key);
				streamWriter.WriteLine(item.Value.ToString());
			}
		}

		public static void LoadLastUpdateMap()
		{
			lastUpdate.Clear();
			string lastUpdateMapPath = AngryPaths.LastUpdateMapPath;
			if (!File.Exists(lastUpdateMapPath))
			{
				return;
			}
			using StreamReader streamReader = new StreamReader(File.Open(lastUpdateMapPath, FileMode.Open, FileAccess.Read));
			while (!streamReader.EndOfStream)
			{
				string key = streamReader.ReadLine();
				if (streamReader.EndOfStream)
				{
					logger.LogWarning((object)"Invalid end of last played map file");
					break;
				}
				string text = streamReader.ReadLine();
				if (long.TryParse(text, out var result))
				{
					lastUpdate[key] = result;
				}
				else
				{
					logger.LogInfo((object)("Invalid last played time '" + text + "'"));
				}
			}
		}

		public static void UpdateLastUpdate(AngryBundleContainer bundle)
		{
			string bundleGuid = bundle.bundleData.bundleGuid;
			if (bundleGuid.Length != 32)
			{
				return;
			}
			if (bundleSortingMode.value == BundleSorting.LastUpdate)
			{
				((ConfigField)bundle.rootPanel).siblingIndex = 0;
			}
			long value = ((DateTimeOffset)DateTime.UtcNow).ToUnixTimeSeconds();
			lastUpdate[bundleGuid] = value;
			string lastUpdateMapPath = AngryPaths.LastUpdateMapPath;
			IOUtils.TryCreateDirectoryForFile(lastUpdateMapPath);
			using StreamWriter streamWriter = new StreamWriter(File.Open(lastUpdateMapPath, FileMode.OpenOrCreate, FileAccess.Write));
			streamWriter.BaseStream.Seek(0L, SeekOrigin.Begin);
			streamWriter.BaseStream.SetLength(0L);
			foreach (KeyValuePair<string, long> item in lastUpdate)
			{
				streamWriter.WriteLine(item.Key);
				streamWriter.WriteLine(item.Value.ToString());
			}
		}

		public static AngryBundleContainer GetAngryBundleByGuid(string guid)
		{
			return angryBundles.Values.Where((AngryBundleContainer bundle) => bundle.bundleData != null && bundle.bundleData.bundleGuid == guid).FirstOrDefault();
		}

		internal static void OpenFolder(FolderButtonField folderField)
		{
			if (folderField == null)
			{
				folderField = pathToFolderMap["/"];
			}
			List<AngryBundleContainer> list = folderToBundleMap[folderField];
			List<FolderButtonField> list2 = folderToFolderMap[folderField];
			foreach (AngryBundleContainer value3 in angryBundles.Values)
			{
				((ConfigField)value3.rootPanel).hidden = true;
			}
			foreach (FolderButtonField value4 in pathToFolderMap.Values)
			{
				((ConfigField)value4).hidden = true;
			}
			foreach (AngryBundleContainer item in list)
			{
				if (item.bundleData != null)
				{
					((ConfigField)item.rootPanel).hidden = false;
				}
			}
			foreach (FolderButtonField item2 in list2)
			{
				Stack<FolderButtonField> stack = new Stack<FolderButtonField>();
				stack.Push(item2);
				while (stack.Count != 0)
				{
					FolderButtonField key = stack.Pop();
					if (folderToBundleMap.TryGetValue(key, out var value) && value.Where((AngryBundleContainer bundle) => bundle.bundleData != null).Any())
					{
						((ConfigField)item2).hidden = false;
						break;
					}
					if (!folderToFolderMap.TryGetValue(key, out var value2))
					{
						continue;
					}
					foreach (FolderButtonField item3 in value2)
					{
						stack.Push(item3);
					}
				}
			}
			if (folderField == pathToFolderMap["/"])
			{
				levelBundlesHeader.text = "Level Bundles";
				return;
			}
			levelBundlesHeader.text = "Level Bundles <color=grey>" + pathToFolderMap.Where((KeyValuePair<string, FolderButtonField> e) => e.Value == folderField).FirstOrDefault().Key + "</color>";
		}

		private static void UpdateBundleSearch(string newVal)
		{
			string[] array = (from keyword in newVal.Split(whitespaceSeparator, StringSplitOptions.RemoveEmptyEntries)
				select keyword.ToLower()).ToArray();
			if (array.Length == currentSearchKeywords.Length && array.SequenceEqual(currentSearchKeywords))
			{
				return;
			}
			currentSearchKeywords = array;
			if (currentSearchKeywords.Length == 0)
			{
				((ConfigField)folderDivision).hidden = false;
				((ConfigField)searchInfo).hidden = true;
				foreach (AngryBundleContainer value in angryBundles.Values)
				{
					value.ResetSearch();
				}
				OpenFolder(folderStack.Peek());
				return;
			}
			((ConfigField)folderDivision).hidden = true;
			((ConfigField)searchInfo).hidden = false;
			int num = 0;
			int num2 = 0;
			foreach (AngryBundleContainer value2 in angryBundles.Values)
			{
				if (value2.rootPanel.forceHidden)
				{
					continue;
				}
				if (value2.bundleData == null)
				{
					((ConfigField)value2.rootPanel).hidden = true;
					continue;
				}
				bool flag = value2.ApplySearch(currentSearchKeywords);
				((ConfigField)value2.rootPanel).hidden = !flag;
				num2++;
				if (flag)
				{
					num++;
				}
			}
			levelBundlesHeader.text = "Level Bundles";
			searchInfo.text = $"Showing {num} of {num2} bundles";
		}

		public static void ProcessPath(string path, string folder)
		{
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Expected O, but got Unknown
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Expected O, but got Unknown
			if (!pathToFolderMap.TryGetValue(folder, out var folderField))
			{
				folderField = new FolderButtonField((ConfigPanel)(object)folderDivision);
				folderField.folderName = Path.GetFileName(folder);
				folderField.onPressed.AddListener((UnityAction)delegate
				{
					OpenFolder(folderField);
					folderStack.Push(folderField);
				});
				pathToFolderMap[folder] = folderField;
				folderToBundleMap[folderField] = new List<AngryBundleContainer>();
				folderToFolderMap[folderField] = new List<FolderButtonField>();
				string text = folder;
				FolderButtonField item = folderField;
				while (text != "/")
				{
					string text2 = Path.GetDirectoryName(text).Replace('\\', '/');
					bool flag = true;
					if (!pathToFolderMap.TryGetValue(text2, out var parentFolder))
					{
						flag = false;
						parentFolder = new FolderButtonField((ConfigPanel)(object)folderDivision);
						parentFolder.folderName = Path.GetFileName(text2);
						parentFolder.onPressed.AddListener((UnityAction)delegate
						{
							OpenFolder(parentFolder);
							folderStack.Push(parentFolder);
						});
						pathToFolderMap[text2] = parentFolder;
						folderToBundleMap[parentFolder] = new List<AngryBundleContainer>();
						folderToFolderMap[parentFolder] = new List<FolderButtonField>();
					}
					if (!folderToFolderMap.TryGetValue(parentFolder, out var value))
					{
						value = new List<FolderButtonField>();
						folderToFolderMap[parentFolder] = value;
					}
					value.Add(item);
					if (flag)
					{
						break;
					}
					item = parentFolder;
					text = text2;
				}
			}
			if (!folderToBundleMap.TryGetValue(folderField, out var value2))
			{
				value2 = new List<AngryBundleContainer>();
				folderToBundleMap[folderField] = value2;
			}
			if (AngryFileUtils.TryGetAngryBundleData(path, out var data, out var error))
			{
				if (angryBundles.TryGetValue(data.bundleGuid, out var value3))
				{
					if (File.Exists(value3.pathToAngryBundle) && !IOUtils.PathEquals(path, value3.pathToAngryBundle))
					{
						logger.LogError((object)("Duplicate angry files. Original: " + Path.GetFileName(value3.pathToAngryBundle) + ". Duplicate: " + Path.GetFileName(path)));
						if (!string.IsNullOrEmpty(errorText.text))
						{
							ConfigHeader obj = errorText;
							obj.text += "\n";
						}
						ConfigHeader val = errorText;
						val.text = val.text + "<color=red>Error loading " + Path.GetFileName(path) + "</color> Duplicate file, original is " + Path.GetFileName(value3.pathToAngryBundle);
						return;
					}
					bool num = !IOUtils.PathEquals(value3.pathToAngryBundle, path);
					value3.pathToAngryBundle = path;
					((ConfigField)value3.rootPanel).interactable = true;
					value3.rootPanel.forceHidden = false;
					((ConfigField)value3.rootPanel).hidden = false;
					if (num)
					{
						value3.UpdateScenes(forceReload: false, lazyLoad: false);
					}
					value2.Add(value3);
					if (data.bundleVersion < 6)
					{
						value3.rootPanel.forceHidden = true;
						numOfOldBundles++;
					}
					return;
				}
				AngryBundleContainer angryBundleContainer = new AngryBundleContainer(path, data);
				angryBundles[data.bundleGuid] = angryBundleContainer;
				value2.Add(angryBundleContainer);
				angryBundleContainer.UpdateOrder();
				try
				{
					if (angryBundleContainer.finalRankScore.value < 0)
					{
						logger.LogWarning((object)"Final rank score for the bundle not cached, skipping lazy reload");
						angryBundleContainer.UpdateScenes(forceReload: false, lazyLoad: false);
					}
					else
					{
						angryBundleContainer.UpdateScenes(forceReload: false, lazyLoad: true);
					}
				}
				catch (Exception arg)
				{
					logger.LogWarning((object)$"Exception thrown while loading level bundle: {arg}");
					if (!string.IsNullOrEmpty(errorText.text))
					{
						ConfigHeader obj2 = errorText;
						obj2.text += "\n";
					}
					ConfigHeader obj3 = errorText;
					obj3.text = obj3.text + "<color=red>Error loading " + Path.GetFileNameWithoutExtension(path) + "</color>. Check the logs for more information";
				}
				if (data.bundleVersion < 6)
				{
					angryBundleContainer.rootPanel.forceHidden = true;
					numOfOldBundles++;
				}
			}
			else if (AngryFileUtils.IsV1LegacyFile(path))
			{
				if (!string.IsNullOrEmpty(errorText.text))
				{
					ConfigHeader obj4 = errorText;
					obj4.text += "\n";
				}
				ConfigHeader obj5 = errorText;
				obj5.text = obj5.text + "<color=yellow>" + Path.GetFileName(path) + " is a V1 legacy file. Support for legacy files were dropped after 2.5.0</color>";
			}
			else
			{
				logger.LogError((object)$"Could not load the bundle at {path}\n{error}");
				if (!string.IsNullOrEmpty(errorText.text))
				{
					ConfigHeader obj6 = errorText;
					obj6.text += "\n";
				}
				ConfigHeader obj7 = errorText;
				obj7.text = obj7.text + "<color=yellow>Failed to load " + Path.GetFileNameWithoutExtension(path) + "</color>";
			}
		}

		public static void ScanForLevels()
		{
			numOfOldBundles = 0;
			errorText.text = "";
			currentSearchKeywords = new string[0];
			((ConfigField)folderDivision).hidden = false;
			foreach (AngryBundleContainer value2 in angryBundles.Values)
			{
				value2.ResetSearch();
			}
			searchBar.SetValueWithoutNotify("");
			if (!Directory.Exists(levelsPath))
			{
				logger.LogWarning((object)("Could not find the Levels folder at " + levelsPath));
				errorText.text = "<color=red>Error: </color>Levels folder not found";
				return;
			}
			if (!pathToFolderMap.TryGetValue("/", out var value))
			{
				value = new FolderButtonField(config.rootPanel);
				((ConfigField)value).hidden = true;
				pathToFolderMap["/"] = value;
				folderToBundleMap[value] = new List<AngryBundleContainer>();
				folderToFolderMap[value] = new List<FolderButtonField>();
			}
			foreach (List<AngryBundleContainer> value3 in folderToBundleMap.Values)
			{
				value3.Clear();
			}
			foreach (IOUtils.SubFileInfo item in IOUtils.GetAllFilesRecursive(levelsPath))
			{
				if (item.filePath.EndsWith(".angry"))
				{
					ProcessPath(item.filePath, item.subFolder);
				}
			}
			foreach (KeyValuePair<string, FolderButtonField> item2 in pathToFolderMap)
			{
				if (item2.Value == value)
				{
					continue;
				}
				string path2 = Path.Combine(levelsPath, item2.Key.Substring(1));
				if (Directory.Exists(path2))
				{
					string text = (from path in Directory.GetFiles(path2)
						where validImageExts.Contains<string>(Path.GetExtension(path))
						select path).FirstOrDefault();
					if (!string.IsNullOrEmpty(text))
					{
						item2.Value.CreateIcon(text);
						continue;
					}
				}
				item2.Value.CreateIcon(new FolderEnumerator(item2.Value));
			}
			if (numOfOldBundles != 0)
			{
				if (!string.IsNullOrEmpty(errorText.text))
				{
					ConfigHeader obj = errorText;
					obj.text += "\n";
				}
				ConfigHeader obj2 = errorText;
				obj2.text += $"<color=yellow>Hidden {numOfOldBundles} old angry file(s). These files can be deleted at the bottom of the settings page.</color>";
			}
			OpenFolder(value);
			folderStack.Clear();
			folderStack.Push(value);
			OnlineLevelsManager.UpdateUI();
		}

		public static void SortBundles()
		{
			int num = 0;
			if (bundleSortingMode.value == BundleSorting.Alphabetically)
			{
				foreach (AngryBundleContainer item in angryBundles.Values.OrderBy((AngryBundleContainer b) => b.bundleData.bundleName))
				{
					((ConfigField)item.rootPanel).siblingIndex = num++;
				}
				return;
			}
			if (bundleSortingMode.value == BundleSorting.Author)
			{
				foreach (AngryBundleContainer item2 in angryBundles.Values.OrderBy((AngryBundleContainer b) => b.bundleData.bundleAuthor))
				{
					((ConfigField)item2.rootPanel).siblingIndex = num++;
				}
				return;
			}
			if (bundleSortingMode.value == BundleSorting.LastPlayed)
			{
				long value2;
				foreach (AngryBundleContainer item3 in angryBundles.Values.OrderByDescending((AngryBundleContainer b) => lastPlayed.TryGetValue(b.bundleData.bundleGuid, out value2) ? value2 : 0))
				{
					((ConfigField)item3.rootPanel).siblingIndex = num++;
				}
				return;
			}
			if (bundleSortingMode.value != BundleSorting.LastUpdate)
			{
				return;
			}
			long value;
			foreach (AngryBundleContainer item4 in angryBundles.Values.OrderByDescending((AngryBundleContainer b) => lastUpdate.TryGetValue(b.bundleData.bundleGuid, out value) ? value : 0))
			{
				((ConfigField)item4.rootPanel).siblingIndex = num++;
			}
		}

		public static void UpdateAllUI()
		{
			foreach (AngryBundleContainer value in angryBundles.Values)
			{
				if (value.finalRankScore.value < 0)
				{
					value.UpdateScenes(forceReload: false, lazyLoad: false);
				}
				else
				{
					value.UpdateFinalRankUI();
				}
				foreach (LevelContainer value2 in value.levels.Values)
				{
					value2.UpdateUI();
				}
			}
		}

		public static bool LoadEssentialScripts()
		{
			bool result = true;
			if (ScriptManager.AttemptLoadScriptWithCertificate("AngryLoaderAPI.dll") == ScriptManager.LoadScriptResult.NotFound)
			{
				logger.LogError((object)"Required script AngryLoaderAPI.dll not found");
				result = false;
			}
			else
			{
				ScriptManager.ForceLoadScript("AngryLoaderAPI.dll");
			}
			if (ScriptManager.AttemptLoadScriptWithCertificate("RudeLevelScripts.dll") == ScriptManager.LoadScriptResult.NotFound)
			{
				logger.LogError((object)"Required script RudeLevelScripts.dll not found");
				result = false;
			}
			else
			{
				ScriptManager.ForceLoadScript("RudeLevelScripts.dll");
			}
			return result;
		}

		private static void DisableAllConfig()
		{
			Stack<ConfigField> stack = new Stack<ConfigField>(config.rootPanel.GetAllFields());
			while (stack.Count != 0)
			{
				ConfigField val = stack.Pop();
				ConfigPanel val2 = (ConfigPanel)(object)((val is ConfigPanel) ? val : null);
				if (val2 != null)
				{
					ConfigField[] allFields = val2.GetAllFields();
					foreach (ConfigField item in allFields)
					{
						stack.Push(item);
					}
				}
				val.interactable = false;
			}
		}

		private static void RefreshCatalogOnMainMenu(Scene newScene, LoadSceneMode mode)
		{
			if (!(SceneHelper.CurrentScene != "Main Menu"))
			{
				if (refreshCatalogOnBoot.value)
				{
					OnlineLevelsManager.RefreshAsync();
				}
				SceneManager.sceneLoaded -= RefreshCatalogOnMainMenu;
			}
		}

		private static bool GetUltrapainDifficultySet()
		{
			return Plugin.ultrapainDifficulty;
		}

		private static bool GetHeavenOrHellDifficultySet()
		{
			return Plugin.isHeavenOrHell;
		}

		private static void CreateCustomLevelButtonOnMainMenu()
		{
			((MonoBehaviour)instance).StartCoroutine(CreateCustomLevelButtonOnMainMenuAsync());
		}

		[IteratorStateMachine(typeof(<CreateCustomLevelButtonOnMainMenuAsync>d__111))]
		private static IEnumerator CreateCustomLevelButtonOnMainMenuAsync()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <CreateCustomLevelButtonOnMainMenuAsync>d__111(0);
		}

		private static void CreateAngryUI()
		{
			((MonoBehaviour)instance).StartCoroutine(CreateAngryUIAsync());
		}

		[IteratorStateMachine(typeof(<CreateAngryUIAsync>d__115))]
		private static IEnumerator CreateAngryUIAsync()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <CreateAngryUIAsync>d__115(0);
		}

		private static void InitializeFileWatcher()
		{
			if (watcher != null)
			{
				return;
			}
			watcher = new FileSystemWatcher(levelsPath);
			watcher.SynchronizingObject = CrossThreadInvoker.Instance;
			watcher.Changed += delegate(object sender, FileSystemEventArgs e)
			{
				string fullPath4 = e.FullPath;
				foreach (AngryBundleContainer value2 in angryBundles.Values)
				{
					if (IOUtils.PathEquals(fullPath4, value2.pathToAngryBundle))
					{
						logger.LogWarning((object)("Bundle " + fullPath4 + " was updated, container notified"));
						value2.FileChanged();
						break;
					}
				}
			};
			watcher.Renamed += delegate(object sender, RenamedEventArgs e)
			{
				string fullPath3 = e.FullPath;
				foreach (AngryBundleContainer value3 in angryBundles.Values)
				{
					if (IOUtils.PathEquals(fullPath3, value3.pathToAngryBundle))
					{
						logger.LogWarning((object)("Bundle " + fullPath3 + " was renamed, path updated"));
						value3.pathToAngryBundle = fullPath3;
						break;
					}
				}
			};
			watcher.Deleted += delegate(object sender, FileSystemEventArgs e)
			{
				string fullPath2 = e.FullPath;
				foreach (AngryBundleContainer value4 in angryBundles.Values)
				{
					if (IOUtils.PathEquals(fullPath2, value4.pathToAngryBundle))
					{
						logger.LogWarning((object)("Bundle " + fullPath2 + " was deleted, unlinked"));
						value4.pathToAngryBundle = "";
						break;
					}
				}
			};
			watcher.Created += delegate(object sender, FileSystemEventArgs e)
			{
				string fullPath = e.FullPath;
				if (AngryFileUtils.TryGetAngryBundleData(fullPath, out var data, out var _) && angryBundles.TryGetValue(data.bundleGuid, out var value) && value.bundleData.bundleGuid == data.bundleGuid && !File.Exists(value.pathToAngryBundle))
				{
					logger.LogWarning((object)("Bundle " + fullPath + " was just added, and a container with the same guid had no file linked. Linked, container notified"));
					value.pathToAngryBundle = fullPath;
					value.FileChanged();
				}
			};
			watcher.Filter = "*";
			watcher.IncludeSubdirectories = false;
			watcher.EnableRaisingEvents = true;
		}

		private static void InitializeConfig()
		{
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Expected O, but got Unknown
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Expected O, but got Unknown
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Expected O, but got Unknown
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Expected O, but got Unknown
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Expected O, but got Unknown
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Expected O, but got Unknown
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Expected O, but got Unknown
			//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e1: Expected O, but got Unknown
			//IL_021c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: Expected O, but got Unknown
			//IL_0236: Unknown result type (might be due to invalid IL or missing references)
			//IL_0240: Expected O, but got Unknown
			//IL_0272: Unknown result type (might be due to invalid IL or missing references)
			//IL_027c: Expected O, but got Unknown
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Expected O, but got Unknown
			//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b8: Expected O, but got Unknown
			//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02df: Expected O, but got Unknown
			//IL_0291: Unknown result type (might be due to invalid IL or missing references)
			//IL_0296: Unknown result type (might be due to invalid IL or missing references)
			//IL_029c: Expected O, but got Unknown
			//IL_036f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0387: Unknown result type (might be due to invalid IL or missing references)
			//IL_0391: Expected O, but got Unknown
			//IL_0397: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c9: Expected O, but got Unknown
			//IL_03c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d3: Expected O, but got Unknown
			//IL_0402: Unknown result type (might be due to invalid IL or missing references)
			//IL_040c: Expected O, but got Unknown
			//IL_03f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fd: Expected O, but got Unknown
			//IL_045a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0464: Expected O, but got Unknown
			//IL_0474: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04cd: Expected O, but got Unknown
			//IL_042a: Unknown result type (might be due to invalid IL or missing references)
			//IL_042f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0435: Expected O, but got Unknown
			//IL_04ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f7: Expected O, but got Unknown
			//IL_053c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0546: Expected O, but got Unknown
			//IL_051b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0520: Unknown result type (might be due to invalid IL or missing references)
			//IL_0526: Expected O, but got Unknown
			//IL_057c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0590: Unknown result type (might be due to invalid IL or missing references)
			//IL_055f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0564: Unknown result type (might be due to invalid IL or missing references)
			//IL_056a: Expected O, but got Unknown
			//IL_05ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0608: Expected O, but got Unknown
			//IL_0603: Unknown result type (might be due to invalid IL or missing references)
			//IL_060d: Expected O, but got Unknown
			//IL_0640: Unknown result type (might be due to invalid IL or missing references)
			//IL_064a: Expected O, but got Unknown
			//IL_0645: Unknown result type (might be due to invalid IL or missing references)
			//IL_064f: Expected O, but got Unknown
			//IL_0626: Unknown result type (might be due to invalid IL or missing references)
			//IL_062b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0631: Expected O, but got Unknown
			//IL_0685: Unknown result type (might be due to invalid IL or missing references)
			//IL_0699: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_06cf: Expected O, but got Unknown
			//IL_06e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ea: Expected O, but got Unknown
			//IL_0789: Unknown result type (might be due to invalid IL or missing references)
			//IL_079d: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c2: Expected O, but got Unknown
			//IL_07d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_07dd: Expected O, but got Unknown
			//IL_07ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f8: Expected O, but got Unknown
			//IL_0809: Unknown result type (might be due to invalid IL or missing references)
			//IL_0813: Expected O, but got Unknown
			//IL_0668: Unknown result type (might be due to invalid IL or missing references)
			//IL_066d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0673: Expected O, but got Unknown
			//IL_085c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0866: Expected O, but got Unknown
			//IL_08a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_08aa: Expected O, but got Unknown
			//IL_087f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0884: Unknown result type (might be due to invalid IL or missing references)
			//IL_088a: Expected O, but got Unknown
			//IL_08e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_08f3: Expected O, but got Unknown
			//IL_090f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0919: Expected O, but got Unknown
			//IL_08c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ce: Expected O, but got Unknown
			//IL_094f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0963: Unknown result type (might be due to invalid IL or missing references)
			//IL_097e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0988: Expected O, but got Unknown
			//IL_0999: Unknown result type (might be due to invalid IL or missing references)
			//IL_09a3: Expected O, but got Unknown
			//IL_09b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_09c3: Expected O, but got Unknown
			//IL_09fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a02: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a24: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a2e: Expected O, but got Unknown
			//IL_0a3e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a51: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a5b: Expected O, but got Unknown
			//IL_0a6e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a78: Expected O, but got Unknown
			//IL_0a88: Unknown result type (might be due to invalid IL or missing references)
			//IL_0932: Unknown result type (might be due to invalid IL or missing references)
			//IL_0937: Unknown result type (might be due to invalid IL or missing references)
			//IL_093d: Expected O, but got Unknown
			//IL_0af2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0af7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b05: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b0f: Expected O, but got Unknown
			//IL_0aa1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aac: Expected O, but got Unknown
			//IL_0b4e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b54: Expected O, but got Unknown
			//IL_0b29: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b2e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b34: Expected O, but got Unknown
			//IL_0b6f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b7c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b86: Expected O, but got Unknown
			//IL_0b96: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b9c: Expected O, but got Unknown
			//IL_0bb3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bbd: Expected O, but got Unknown
			//IL_0bcd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bdb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0beb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bf5: Expected O, but got Unknown
			//IL_0bff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c09: Expected O, but got Unknown
			//IL_0c11: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c1b: Expected O, but got Unknown
			//IL_0c22: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c2c: Expected O, but got Unknown
			//IL_0c3e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c48: Expected O, but got Unknown
			//IL_0c59: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c63: Expected O, but got Unknown
			//IL_0c86: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c90: Expected O, but got Unknown
			//IL_0c9f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ca9: Expected O, but got Unknown
			//IL_0cba: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cc4: Expected O, but got Unknown
			//IL_0cc9: Unknown result type (might be due to invalid IL or missing references)
			if (config != null)
			{
				return;
			}
			config = PluginConfigurator.Create("Angry Level Loader", "com.eternalUnion.angryLevelLoader");
			PluginConfigurator obj = config;
			object obj2 = <>c.<>9__118_0;
			if (obj2 == null)
			{
				PostPresetChangeEvent val = delegate
				{
					UpdateAllUI();
				};
				<>c.<>9__118_0 = val;
				obj2 = (object)val;
			}
			obj.postPresetChangeEvent += (PostPresetChangeEvent)obj2;
			config.SetIconWithURL("file://" + Path.Combine(workingDir, "plugin-icon.png"));
			newLevelToggle = new BoolField(config.rootPanel, "", "v_newLevelToggle", false);
			((ConfigField)newLevelToggle).hidden = true;
			ConfigPanel rootPanel = config.rootPanel;
			object obj3 = <>c.<>9__118_1;
			if (obj3 == null)
			{
				OpenPanelEventDelegate val2 = delegate
				{
					if (newLevelToggle.value)
					{
						newLevelNotifier.text = string.Join("\n", from level in newLevelNotifierLevels.value.Split('`')
							where !string.IsNullOrEmpty(level)
							select level into name
							select "<color=#00FF00>New level: " + name + "</color>");
						((ConfigField)newLevelNotifier).hidden = false;
						newLevelNotifierLevels.value = "";
					}
					newLevelToggle.value = false;
				};
				<>c.<>9__118_1 = val2;
				obj3 = (object)val2;
			}
			rootPanel.onPannelOpenEvent += (OpenPanelEventDelegate)obj3;
			newLevelNotifier = new ConfigHeader(config.rootPanel, "<color=#00FF00>New levels are available!</color>", 16);
			((ConfigField)newLevelNotifier).hidden = true;
			levelUpdateNotifier = new ConfigHeader(config.rootPanel, "<color=#00FF00>Level updates available!</color>", 16);
			((ConfigField)levelUpdateNotifier).hidden = true;
			OnlineLevelsManager.onlineLevelsPanel = new ConfigPanel(internalConfig.rootPanel, "Online Levels", "b_onlineLevels", (PanelFieldType)1);
			new ConfigBridge((ConfigField)(object)OnlineLevelsManager.onlineLevelsPanel, config.rootPanel);
			OnlineLevelsManager.onlineLevelsPanel.SetIconWithURL("file://" + Path.Combine(workingDir, "online-icon.png"));
			ConfigPanel onlineLevelsPanel = OnlineLevelsManager.onlineLevelsPanel;
			object obj4 = <>c.<>9__118_2;
			if (obj4 == null)
			{
				OpenPanelEventDelegate val3 = delegate
				{
					((ConfigField)newLevelNotifier).hidden = true;
				};
				<>c.<>9__118_2 = val3;
				obj4 = (object)val3;
			}
			onlineLevelsPanel.onPannelOpenEvent += (OpenPanelEventDelegate)obj4;
			OnlineLevelsManager.Init();
			leaderboardsDivision = new ConfigDivision(config.rootPanel, "leaderboardsDivision");
			((ConfigField)leaderboardsDivision).hidden = !leaderboardToggle.value;
			bannedModsPanel = new ConfigPanel((ConfigPanel)(object)leaderboardsDivision, "Leaderboard banned mods", "bannedModsPanel", (PanelFieldType)1);
			bannedModsPanel.SetIconWithURL("file://" + Path.Combine(workingDir, "banned-mods-icon.png"));
			((ConfigField)bannedModsPanel).hidden = true;
			bannedModsText = new ConfigHeader(bannedModsPanel, "", 24, (TextAnchor)3);
			pendingRecords = new ConfigPanel((ConfigPanel)(object)leaderboardsDivision, "Pending records", "pendingRecords", (PanelFieldType)1);
			pendingRecords.SetIconWithURL("file://" + Path.Combine(workingDir, "pending.png"));
			sendPendingRecords = new ButtonField(pendingRecords, "Send Pending Records", "sendPendingRecordsButton");
			ButtonField obj5 = sendPendingRecords;
			object obj6 = <>O.<1>__ProcessPendingRecords;
			if (obj6 == null)
			{
				OnClick val4 = ProcessPendingRecords;
				<>O.<1>__ProcessPendingRecords = val4;
				obj6 = (object)val4;
			}
			obj5.onClick += (OnClick)obj6;
			pendingRecordsStatus = new ConfigHeader(pendingRecords, "", 20, (TextAnchor)3);
			new ConfigSpace(pendingRecords, 5f);
			pendingRecordsInfo = new ConfigHeader(pendingRecords, "", 18, (TextAnchor)3);
			UpdatePendingRecordsUI();
			difficultyField = new DifficultyField(config.rootPanel);
			bundleSortingMode = new EnumField<BundleSorting>(internalConfig.rootPanel, "Bundle sorting", "s_bundleSortingMode", BundleSorting.LastPlayed);
			bundleSortingMode.onValueChange += delegate(EnumValueChangeEvent<BundleSorting> e)
			{
				bundleSortingMode.value = e.value;
				SortBundles();
			};
			bundleSortingMode.SetEnumDisplayName(BundleSorting.LastPlayed, "Last Played");
			bundleSortingMode.SetEnumDisplayName(BundleSorting.LastUpdate, "Last Update");
			new ConfigBridge((ConfigField)(object)bundleSortingMode, config.rootPanel);
			ConfigHeader difficultyOverrideWarning = new ConfigHeader(config.rootPanel, "Difficulty is overridden by gamemode\nWarning: Some levels may not be compatible with gamemodes", 18);
			difficultyOverrideWarning.textColor = Color.yellow;
			((ConfigField)difficultyOverrideWarning).hidden = true;
			DifficultyField obj7 = difficultyField;
			obj7.postDifficultyChange = (PostStringListValueChangeEvent)Delegate.Combine((Delegate?)(object)obj7.postDifficultyChange, (Delegate?)(PostStringListValueChangeEvent)delegate(string difficultyName, int difficultyIndex)
			{
				selectedDifficulty = Array.IndexOf(difficultyList.ToArray(), difficultyName);
				if (selectedDifficulty == -1)
				{
					logger.LogWarning((object)"Invalid difficulty, setting to violent");
					selectedDifficulty = 3;
					difficultyField.difficultyListValue = "VIOLENT";
				}
				else if (difficultyName == "ULTRAPAIN")
				{
					selectedDifficulty = 100;
				}
				else if (difficultyName == "HEAVEN OR HELL")
				{
					selectedDifficulty = 101;
				}
				if (difficultyField.gamemodeListValueIndex == 1 || difficultyField.gamemodeListValueIndex == 2)
				{
					((ConfigField)difficultyOverrideWarning).hidden = false;
					difficultyField.difficultyInteractable = false;
					difficultyField.ForceSetDifficultyUI(0);
					selectedDifficulty = 0;
				}
				else
				{
					((ConfigField)difficultyOverrideWarning).hidden = true;
					difficultyField.difficultyInteractable = true;
					difficultyField.ForceSetDifficultyUI(selectedDifficulty);
				}
			});
			DifficultyField obj8 = difficultyField;
			PostStringListValueChangeEvent postGamemodeChange = obj8.postGamemodeChange;
			object obj9 = <>c.<>9__118_23;
			if (obj9 == null)
			{
				PostStringListValueChangeEvent val5 = delegate
				{
					difficultyField.TriggerPostDifficultyChangeEvent();
				};
				<>c.<>9__118_23 = val5;
				obj9 = (object)val5;
			}
			obj8.postGamemodeChange = (PostStringListValueChangeEvent)Delegate.Combine((Delegate?)(object)postGamemodeChange, (Delegate?)obj9);
			ConfigPanel rootPanel2 = config.rootPanel;
			object obj10 = <>c.<>9__118_4;
			if (obj10 == null)
			{
				OpenPanelEventDelegate val6 = delegate
				{
					difficultyField.TriggerPostDifficultyChangeEvent();
				};
				<>c.<>9__118_4 = val6;
				obj10 = (object)val6;
			}
			rootPanel2.onPannelOpenEvent += (OpenPanelEventDelegate)obj10;
			difficultyField.TriggerPostDifficultyChangeEvent();
			ConfigPanel settingsPanel = new ConfigPanel(internalConfig.rootPanel, "Settings", "p_settings", (PanelFieldType)0);
			new ConfigBridge((ConfigField)(object)settingsPanel, config.rootPanel);
			((ConfigField)settingsPanel).hidden = true;
			openButtons = new ButtonArrayField(settingsPanel, "settingButtons", 2, new float[2] { 0.5f, 0.5f }, new string[2] { "Open Levels Folder", "Changelog" }, 5f);
			ButtonClickEvent obj11 = openButtons.OnClickEventHandler(0);
			object obj12 = <>c.<>9__118_5;
			if (obj12 == null)
			{
				OnClick val7 = delegate
				{
					Application.OpenURL(levelsPath);
				};
				<>c.<>9__118_5 = val7;
				obj12 = (object)val7;
			}
			obj11.onClick += (OnClick)obj12;
			ButtonClickEvent obj13 = openButtons.OnClickEventHandler(1);
			object obj14 = <>c.<>9__118_6;
			if (obj14 == null)
			{
				OnClick val8 = delegate
				{
					openButtons.SetButtonInteractable(1, false);
					PluginUpdateHandler.CheckPluginUpdate();
				};
				<>c.<>9__118_6 = val8;
				obj14 = (object)val8;
			}
			obj13.onClick += (OnClick)obj14;
			reloadFileKeybind = new KeyCodeField(settingsPanel, "Reload File", "f_reloadFile", (KeyCode)0);
			KeyCodeField obj15 = reloadFileKeybind;
			object obj16 = <>c.<>9__118_7;
			if (obj16 == null)
			{
				KeyCodeValueChangeEventDelegate val9 = delegate(KeyCodeValueChangeEvent e)
				{
					//IL_0001: Unknown result type (might be due to invalid IL or missing references)
					//IL_000b: Invalid comparison between Unknown and I4
					//IL_000e: Unknown result type (might be due to invalid IL or missing references)
					//IL_0018: Invalid comparison between Unknown and I4
					//IL_001b: Unknown result type (might be due to invalid IL or missing references)
					//IL_0025: Invalid comparison between Unknown and I4
					if ((int)e.value == 323 || (int)e.value == 324 || (int)e.value == 325)
					{
						e.canceled = true;
					}
				};
				<>c.<>9__118_7 = val9;
				obj16 = (object)val9;
			}
			obj15.onValueChange += (KeyCodeValueChangeEventDelegate)obj16;
			new ConfigHeader(settingsPanel, "User Interface", 24).textColor = new Color(1f, 0.504717f, 0.9454f);
			customLevelButtonPosition = new EnumField<CustomLevelButtonPosition>(settingsPanel, "Custom level button position", "s_customLevelButtonPosition", CustomLevelButtonPosition.Bottom);
			customLevelButtonPosition.postValueChangeEvent += delegate(CustomLevelButtonPosition pos)
			{
				//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
				//IL_005e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0077: Unknown result type (might be due to invalid IL or missing references)
				//IL_0081: Unknown result type (might be due to invalid IL or missing references)
				//IL_0195: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
				//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
				//IL_0212: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
				//IL_011c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0130: Unknown result type (might be due to invalid IL or missing references)
				//IL_013a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0153: Unknown result type (might be due to invalid IL or missing references)
				//IL_0176: Unknown result type (might be due to invalid IL or missing references)
				if (!((Object)(object)currentCustomLevelButton == (Object)null))
				{
					((Component)currentCustomLevelButton).gameObject.SetActive(true);
					switch (pos)
					{
					case CustomLevelButtonPosition.Disabled:
						((Component)currentCustomLevelButton).gameObject.SetActive(false);
						break;
					case CustomLevelButtonPosition.Bottom:
						((Component)currentCustomLevelButton).transform.localPosition = new Vector3(((Component)currentCustomLevelButton).transform.localPosition.x, -303f, ((Component)currentCustomLevelButton).transform.localPosition.z);
						break;
					case CustomLevelButtonPosition.Top:
						((Component)currentCustomLevelButton).transform.localPosition = new Vector3(((Component)currentCustomLevelButton).transform.localPosition.x, 192f, ((Component)currentCustomLevelButton).transform.localPosition.z);
						break;
					}
					if ((Object)(object)bossRushButton != (Object)null)
					{
						if (pos == CustomLevelButtonPosition.Bottom)
						{
							currentCustomLevelButton.rect.sizeDelta = new Vector2(187.5f, 50f);
							((Component)currentCustomLevelButton).transform.localPosition = new Vector3(-96.25f, ((Component)currentCustomLevelButton).transform.localPosition.y, ((Component)currentCustomLevelButton).transform.localPosition.z);
							bossRushButton.sizeDelta = new Vector2(187.5f, 50f);
							((Component)bossRushButton).transform.localPosition = new Vector3(96.25f, -303f, 0f);
						}
						else
						{
							currentCustomLevelButton.rect.sizeDelta = new Vector2(380f, 50f);
							((Component)currentCustomLevelButton).transform.localPosition = new Vector3(0f, ((Component)currentCustomLevelButton).transform.localPosition.y, ((Component)currentCustomLevelButton).transform.localPosition.z);
							bossRushButton.sizeDelta = new Vector2(380f, 50f);
							((Component)bossRushButton).transform.localPosition = new Vector3(0f, -303f, 0f);
						}
					}
				}
			};
			ConfigPanel val10 = new ConfigPanel(settingsPanel, "Custom level button colors", "customLevelButtonPanel");
			customLevelButtonFrameColor = new ColorField(val10, "Custom level button frame color", "s_customLevelButtonFrameColor", Color.white);
			ColorField obj17 = customLevelButtonFrameColor;
			object obj18 = <>c.<>9__118_9;
			if (obj18 == null)
			{
				PostColorValueChangeEvent val11 = delegate(Color clr)
				{
					//IL_0010: Unknown result type (might be due to invalid IL or missing references)
					//IL_0030: Unknown result type (might be due to invalid IL or missing references)
					//IL_0038: Unknown result type (might be due to invalid IL or missing references)
					//IL_003e: Unknown result type (might be due to invalid IL or missing references)
					//IL_004a: Unknown result type (might be due to invalid IL or missing references)
					//IL_0050: Unknown result type (might be due to invalid IL or missing references)
					//IL_005c: Unknown result type (might be due to invalid IL or missing references)
					//IL_0062: Unknown result type (might be due to invalid IL or missing references)
					//IL_006e: Unknown result type (might be due to invalid IL or missing references)
					//IL_0082: Unknown result type (might be due to invalid IL or missing references)
					if (!((Object)(object)currentCustomLevelButton == (Object)null))
					{
						ColorBlock colors = default(ColorBlock);
						((ColorBlock)(ref colors)).colorMultiplier = 1f;
						((ColorBlock)(ref colors)).fadeDuration = 0.1f;
						((ColorBlock)(ref colors)).normalColor = clr;
						((ColorBlock)(ref colors)).selectedColor = clr * 0.8f;
						((ColorBlock)(ref colors)).highlightedColor = clr * 0.8f;
						((ColorBlock)(ref colors)).pressedColor = clr * 0.5f;
						((ColorBlock)(ref colors)).disabledColor = Color.gray;
						((Selectable)currentCustomLevelButton.button).colors = colors;
					}
				};
				<>c.<>9__118_9 = val11;
				obj18 = (object)val11;
			}
			obj17.postValueChangeEvent += (PostColorValueChangeEvent)obj18;
			customLevelButtonTextColor = new ColorField(val10, "Custom level button text color", "s_customLevelButtonTextColor", Color.white);
			ColorField obj19 = customLevelButtonTextColor;
			object obj20 = <>c.<>9__118_10;
			if (obj20 == null)
			{
				PostColorValueChangeEvent val12 = delegate(Color clr)
				{
					//IL_0018: Unknown result type (might be due to invalid IL or missing references)
					if (!((Object)(object)currentCustomLevelButton == (Object)null))
					{
						((Graphic)currentCustomLevelButton.text).color = clr;
					}
				};
				<>c.<>9__118_10 = val12;
				obj20 = (object)val12;
			}
			obj19.postValueChangeEvent += (PostColorValueChangeEvent)obj20;
			new ConfigHeader(settingsPanel, "Leaderboards", 24).textColor = new Color(1f, 0.692924f, 0.291f);
			new ConfigBridge((ConfigField)(object)leaderboardToggle, settingsPanel);
			showLeaderboardOnLevelEnd = new BoolField(settingsPanel, "Show leaderboard on level end", "showLeaderboardOnLevelEnd", true);
			showLeaderboardOnSecretLevelEnd = new BoolField(settingsPanel, "Show leaderboard on secret level end", "showLeaderboardOnSecretLevelEnd", true);
			new SpaceField(settingsPanel, 5f);
			defaultLeaderboardCategory = new EnumField<DefaultLeaderboardCategory>(settingsPanel, "Default leaderboard category", "defaultLeaderboardCategory", DefaultLeaderboardCategory.All);
			defaultLeaderboardCategory.SetEnumDisplayName(DefaultLeaderboardCategory.PRank, "P Rank");
			defaultLeaderboardCategory.SetEnumDisplayName(DefaultLeaderboardCategory.Nomo, "No Monsters");
			defaultLeaderboardCategory.SetEnumDisplayName(DefaultLeaderboardCategory.Nomow, "No Monsters/Weapons");
			defaultLeaderboardDifficulty = new EnumField<DefaultLeaderboardDifficulty>(settingsPanel, "Default leaderboard difficulty", "defaultLeaderboardDifficulty", DefaultLeaderboardDifficulty.Any);
			defaultLeaderboardFilter = new EnumField<DefaultLeaderboardFilter>(settingsPanel, "Default leaderboard filter", "defaultLeaderboardFilter", DefaultLeaderboardFilter.Global);
			new ConfigHeader(settingsPanel, "Online", 24).textColor = new Color(0.532f, 0.8284001f, 1f);
			refreshCatalogOnBoot = new BoolField(settingsPanel, "Refresh online catalog on boot", "s_refreshCatalogBoot", true);
			checkForUpdates = new BoolField(settingsPanel, "Check for updates on boot", "s_checkForUpdates", true);
			useDevelopmentBranch = new BoolField(settingsPanel, "Use development chanel", "s_useDevChannel", false);
			useLocalServer = new BoolField(settingsPanel, "Use local server", "s_useLocalServer", false);
			if (!devMode.value)
			{
				((ConfigField)useDevelopmentBranch).hidden = true;
				useDevelopmentBranch.value = false;
				((ConfigField)useLocalServer).hidden = true;
				useLocalServer.value = false;
			}
			levelUpdateNotifierToggle = new BoolField(settingsPanel, "Notify on level updates", "s_levelUpdateNofify", true);
			BoolField obj21 = levelUpdateNotifierToggle;
			object obj22 = <>c.<>9__118_11;
			if (obj22 == null)
			{
				BoolValueChangeEventDelegate val13 = delegate(BoolValueChangeEvent e)
				{
					levelUpdateNotifierToggle.value = e.value;
					OnlineLevelsManager.CheckLevelUpdateText();
				};
				<>c.<>9__118_11 = val13;
				obj22 = (object)val13;
			}
			obj21.onValueChange += (BoolValueChangeEventDelegate)obj22;
			levelUpdateIgnoreCustomBuilds = new BoolField(settingsPanel, "Ignore updates for custom build", "s_levelUpdateIgnoreCustomBuilds", false);
			BoolField obj23 = levelUpdateIgnoreCustomBuilds;
			object obj24 = <>c.<>9__118_12;
			if (obj24 == null)
			{
				BoolValueChangeEventDelegate val14 = delegate(BoolValueChangeEvent e)
				{
					levelUpdateIgnoreCustomBuilds.value = e.value;
					OnlineLevelsManager.CheckLevelUpdateText();
				};
				<>c.<>9__118_12 = val14;
				obj24 = (object)val14;
			}
			obj23.onValueChange += (BoolValueChangeEventDelegate)obj24;
			newLevelNotifierLevels = new StringField(settingsPanel, "h_New levels", "s_newLevelNotifierLevels", "", true);
			((ConfigField)newLevelNotifierLevels).hidden = true;
			newLevelNotifierToggle = new BoolField(settingsPanel, "Notify on new level release", "s_newLevelNotiftToggle", true);
			BoolField obj25 = newLevelNotifierToggle;
			object obj26 = <>c.<>9__118_13;
			if (obj26 == null)
			{
				BoolValueChangeEventDelegate val15 = delegate(BoolValueChangeEvent e)
				{
					newLevelNotifierToggle.value = e.value;
					if (!e.value)
					{
						((ConfigField)newLevelNotifier).hidden = true;
					}
				};
				<>c.<>9__118_13 = val15;
				obj26 = (object)val15;
			}
			obj25.onValueChange += (BoolValueChangeEventDelegate)obj26;
			new ConfigHeader(settingsPanel, "Scripts", 24).textColor = new Color(0.6248745f, 1f, 0.617f);
			scriptUpdateIgnoreCustom = new BoolField(settingsPanel, "Ignore updates for custom builds", "s_scriptUpdateIgnoreCustom", false);
			scriptAutoUpdate = new BoolField(settingsPanel, "Auto update scripts", "s_scriptAutoUpdate", true);
			scriptCertificateIgnoreField = new StringMultilineField(settingsPanel, "Certificate ignore", "s_scriptCertificateIgnore", "", true);
			scriptCertificateIgnore = scriptCertificateIgnoreField.value.Split('\n').ToList();
			new SpaceField(settingsPanel, 5f);
			new ConfigHeader(settingsPanel, "Danger Zone", 24).textColor = Color.red;
			StringField dataPathInput = new StringField(settingsPanel, "Data Path", "s_dataPathInput", dataPath, false, false);
			ButtonField val16 = new ButtonField(settingsPanel, "Move Data", "s_changeDataPath");
			ConfigHeader dataInfo = new ConfigHeader(settingsPanel, "<color=red>RESTART REQUIRED</color>", 18);
			((ConfigField)dataInfo).hidden = true;
			val16.onClick += (OnClick)delegate
			{
				string value = dataPathInput.value;
				if (!(value == configDataPath.value))
				{
					if (!Directory.Exists(value))
					{
						dataInfo.text = "<color=red>Could not find the directory</color>";
						((ConfigField)dataInfo).hidden = false;
					}
					else
					{
						string text4 = Path.Combine(value, "Levels");
						IOUtils.TryCreateDirectory(text4);
						string[] files = Directory.GetFiles(levelsPath);
						foreach (string text5 in files)
						{
							string text6 = Path.Combine(text4, Path.GetFileName(text5));
							if (File.Exists(text6))
							{
								File.Copy(text5, text6, overwrite: true);
								File.Delete(text5);
							}
							else
							{
								File.Move(text5, text6);
							}
						}
						Directory.Delete(levelsPath, recursive: true);
						levelsPath = text4;
						string text7 = Path.Combine(value, "LevelsUnpacked");
						IOUtils.TryCreateDirectory(text7);
						files = Directory.GetDirectories(tempFolderPath);
						foreach (string text8 in files)
						{
							string text9 = Path.Combine(text7, Path.GetFileName(text8));
							if (Directory.Exists(text9))
							{
								Directory.Delete(text9, recursive: true);
							}
							IOUtils.DirectoryCopy(text8, text9, copySubDirs: true, de

plugins/AngryLevelLoader/AngryUiComponents.dll

Decompiled 3 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using TMPro;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;

[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("AngryUiComponents")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+97ea9cb7f659eaa0c5b89bc1f974237406200004")]
[assembly: AssemblyProduct("AngryUiComponents")]
[assembly: AssemblyTitle("AngryUiComponents")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace AngryUiComponents;

public class AngryCustomLevelButtonComponent : MonoBehaviour
{
	public RectTransform rect;

	public Button button;

	public Image background;

	public TextMeshProUGUI text;
}
public class AngryDeleteBundleNotificationComponent : MonoBehaviour
{
	public Text body;

	public Text bundleName;

	public Image bundleIcon;

	public Button cancelButton;

	public Button deleteButton;

	public Text deleteText;
}
public class AngryDeleteOldBundlesNotificationComponent : MonoBehaviour
{
	public Text body;

	public Button cancelButton;

	public Text cancelButtonText;

	public Button deleteButton;

	public Text deleteButtonText;

	public GameObject loadingCircle;

	public Text deletionProgress;

	public Text deletionLog;
}
public class AngryDifficultyFieldComponent : MonoBehaviour
{
	public CanvasGroup group;

	public Dropdown difficultyList;

	public Dropdown gamemodeList;
}
public class AngryFolderButtonComponent : MonoBehaviour
{
	public TextMeshProUGUI folderName;

	public Button folderButton;

	public RawImage folderIcon;
}
public class AngryLeaderboardNotificationComponent : MonoBehaviour
{
	public Text header;

	public Dropdown category;

	public Dropdown difficulty;

	public Dropdown group;

	public GameObject localUserRecordContainer;

	public RawImage localUserPfp;

	public Text localUserRank;

	public Text localUserName;

	public Text localUserTime;

	public GameObject recordEnabler;

	public Transform recordContainer;

	public AngryLeaderboardRecordEntryComponent recordTemplate;

	public GameObject pageText;

	public Button nextPage;

	public Button prevPage;

	public InputField pageInput;

	public Button closeButton;

	public GameObject refreshCircle;

	public Text failMessage;

	public Button refreshButton;

	public GameObject reportToggle;

	public GameObject reportFormToggle;

	public GameObject reportResultToggle;

	public Text reportBody;

	public GameObject reportLoadCircle;

	public Toggle inappropriateName;

	public Toggle inappropriatePicture;

	public Toggle cheatedScore;

	public Toggle reportValidation;

	public Button reportCancel;

	public Button reportSend;

	public Button reportReturn;
}
public class AngryLeaderboardPermissionNotificationComponent : MonoBehaviour
{
	public Button cancelButton;

	public Button okButton;
}
public class AngryLeaderboardRecordEntryComponent : MonoBehaviour
{
	public Text rank;

	public Text username;

	public Text time;

	public RawImage profile;

	public Button reportButton;
}
public class AngryLevelFieldComponent : MonoBehaviour
{
	private class OnDisableCallback : MonoBehaviour
	{
		public Action callback;

		private void OnDisable()
		{
			if (callback != null)
			{
				callback();
			}
		}
	}

	[CompilerGenerated]
	private sealed class <>c__DisplayClass41_0
	{
		public Action cb;

		internal void <ResetButtonCoroutine>b__0()
		{
			if (cb != null)
			{
				cb();
			}
		}
	}

	[CompilerGenerated]
	private sealed class <ResetButtonCoroutine>d__41 : IEnumerator<object>, IEnumerator, IDisposable
	{
		private int <>1__state;

		private object <>2__current;

		public Action cb;

		public Button btn;

		public TextMeshProUGUI txt;

		private <>c__DisplayClass41_0 <>8__1;

		private int <i>5__2;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <ResetButtonCoroutine>d__41(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>8__1 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Expected O, but got Unknown
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Expected O, but got Unknown
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>8__1 = new <>c__DisplayClass41_0();
				<>8__1.cb = cb;
				((Selectable)btn).interactable = false;
				<i>5__2 = 3;
				break;
			case 1:
				<>1__state = -1;
				<i>5__2--;
				break;
			}
			if (<i>5__2 >= 1)
			{
				((TMP_Text)txt).text = $"Are you sure? ({<i>5__2})";
				<>2__current = (object)new WaitForSecondsRealtime(1f);
				<>1__state = 1;
				return true;
			}
			((TMP_Text)txt).text = "<color=red>Are you sure?</color>";
			((Selectable)btn).interactable = true;
			btn.onClick = new ButtonClickedEvent();
			((UnityEvent)btn.onClick).AddListener((UnityAction)delegate
			{
				if (<>8__1.cb != null)
				{
					<>8__1.cb();
				}
			});
			return false;
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	public Text levelHeader;

	public Image fieldImage;

	public RectTransform statContainer;

	public Image statContainerImage;

	public Text[] headers;

	public Text timeText;

	public Text killText;

	public Text styleText;

	public Text secretsText;

	public Text secretsHeader;

	public GameObject secretsIconContainer;

	public Image[] secretsIcons;

	public GameObject settingsPanel;

	public Button openSettingsButton;

	public Button closeSettingsButton;

	public Button resetStatsButton;

	public TextMeshProUGUI resetStatsText;

	public Button resetSecretsButton;

	public TextMeshProUGUI resetSecretsText;

	public Button resetChallengeButton;

	public TextMeshProUGUI resetChallengeText;

	public Button resetLevelVarsButton;

	public TextMeshProUGUI resetLevelVarsText;

	public Button resetBundleVarsButton;

	public TextMeshProUGUI resetBundleVarsText;

	public Button resetUserVarsButton;

	public TextMeshProUGUI resetUserVarsText;

	public Action onResetStats;

	public Action onResetSecrets;

	public Action onResetChallenge;

	public Action onResetLevelVars;

	public Action onResetBundleVars;

	public Action onResetUserVars;

	public Image finalRankContainerImage;

	public Text finalRankText;

	public RectTransform challengeContainer;

	public Image challengeContainerImage;

	public Text challengeText;

	public Image levelThumbnail;

	public Button levelButton;

	public Button leaderboardsButton;

	private void Awake()
	{
		settingsPanel.AddComponent<OnDisableCallback>().callback = delegate
		{
			((MonoBehaviour)this).StopAllCoroutines();
		};
		ResetSettingsButtons();
	}

	public void ResetSettingsButtons()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Expected O, but got Unknown
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Expected O, but got Unknown
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_003c: Expected O, but got Unknown
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: Expected O, but got Unknown
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Expected O, but got Unknown
		//IL_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: Expected O, but got Unknown
		//IL_008a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Expected O, but got Unknown
		//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: Expected O, but got Unknown
		//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c0: Expected O, but got Unknown
		//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dc: Expected O, but got Unknown
		//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ec: Expected O, but got Unknown
		//IL_0103: Unknown result type (might be due to invalid IL or missing references)
		//IL_010d: Expected O, but got Unknown
		resetStatsButton.onClick = new ButtonClickedEvent();
		((UnityEvent)resetStatsButton.onClick).AddListener(new UnityAction(OnResetStats));
		resetSecretsButton.onClick = new ButtonClickedEvent();
		((UnityEvent)resetSecretsButton.onClick).AddListener(new UnityAction(OnResetSecrets));
		resetChallengeButton.onClick = new ButtonClickedEvent();
		((UnityEvent)resetChallengeButton.onClick).AddListener(new UnityAction(OnResetChallenge));
		resetLevelVarsButton.onClick = new ButtonClickedEvent();
		((UnityEvent)resetLevelVarsButton.onClick).AddListener(new UnityAction(OnResetLevelVars));
		resetBundleVarsButton.onClick = new ButtonClickedEvent();
		((UnityEvent)resetBundleVarsButton.onClick).AddListener(new UnityAction(OnResetBundleVars));
		resetUserVarsButton.onClick = new ButtonClickedEvent();
		((UnityEvent)resetUserVarsButton.onClick).AddListener(new UnityAction(onResetUserVars.Invoke));
	}

	public void OnResetStats()
	{
		((Selectable)resetStatsButton).interactable = false;
		((MonoBehaviour)this).StartCoroutine(ResetButtonCoroutine(resetStatsButton, resetStatsText, onResetStats));
	}

	public void OnResetSecrets()
	{
		((Selectable)resetSecretsButton).interactable = false;
		((MonoBehaviour)this).StartCoroutine(ResetButtonCoroutine(resetSecretsButton, resetSecretsText, onResetSecrets));
	}

	public void OnResetChallenge()
	{
		((Selectable)resetChallengeButton).interactable = false;
		((MonoBehaviour)this).StartCoroutine(ResetButtonCoroutine(resetChallengeButton, resetChallengeText, onResetChallenge));
	}

	public void OnResetLevelVars()
	{
		((Selectable)resetLevelVarsButton).interactable = false;
		((MonoBehaviour)this).StartCoroutine(ResetButtonCoroutine(resetLevelVarsButton, resetLevelVarsText, onResetLevelVars));
	}

	public void OnResetBundleVars()
	{
		((Selectable)resetBundleVarsButton).interactable = false;
		((MonoBehaviour)this).StartCoroutine(ResetButtonCoroutine(resetBundleVarsButton, resetBundleVarsText, onResetBundleVars));
	}

	[IteratorStateMachine(typeof(<ResetButtonCoroutine>d__41))]
	private IEnumerator ResetButtonCoroutine(Button btn, TextMeshProUGUI txt, Action cb)
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <ResetButtonCoroutine>d__41(0)
		{
			btn = btn,
			txt = txt,
			cb = cb
		};
	}
}
public class AngryLevelUpdateNotificationComponent : MonoBehaviour
{
	public Text body;

	public Button cancel;

	public Button update;
}
public class AngryOnlineLevelFieldComponent : MonoBehaviour
{
	public RawImage thumbnail;

	public Text infoText;

	public Button changelog;

	public Button install;

	public Button update;

	public Button cancel;

	public Button upvoteButton;

	public Image upvoteImage;

	public Button downvoteButton;

	public Image downvoteImage;

	public Text votes;

	public RectTransform downloadContainer;

	public Text progressText;

	public RectTransform progressBar;
}
public class AngryPluginChangelogNotificationComponent : MonoBehaviour
{
	public Text header;

	public Text text;

	public Button cancel;

	public Button ignoreUpdate;
}
public class AngryReloadBundlePromptComponent : MonoBehaviour
{
	public CanvasGroup division;

	public AudioSource audio;

	public Text text;

	public Button ignoreButton;

	public Button reloadButton;

	private bool transparent;

	private const float TARGET_ALPHA = 0.6f;

	public void Awake()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Expected O, but got Unknown
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Expected O, but got Unknown
		ignoreButton.onClick = new ButtonClickedEvent();
		((UnityEvent)ignoreButton.onClick).AddListener((UnityAction)delegate
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Expected O, but got Unknown
			reloadButton.onClick = new ButtonClickedEvent();
			((Component)this).gameObject.SetActive(false);
		});
	}

	public void MakeTransparent(bool instant)
	{
		transparent = true;
		if (instant)
		{
			division.alpha = 0.6f;
		}
	}

	public void MakeOpaque(bool instant)
	{
		transparent = false;
		if (instant)
		{
			division.alpha = 1f;
		}
	}

	public void Update()
	{
		if (transparent && division.alpha != 0.6f)
		{
			division.alpha = Mathf.MoveTowards(division.alpha, 0.6f, Time.unscaledDeltaTime * 2f);
		}
		else if (!transparent && division.alpha != 1f)
		{
			division.alpha = Mathf.MoveTowards(division.alpha, 1f, Time.unscaledDeltaTime * 2f);
		}
	}
}
public class AngryResetUserMapVarNotificationComponent : MonoBehaviour
{
	public GameObject notFoundText;

	public AngryResetUserMapVarNotificationElementComponent template;

	public Button exitButton;

	public AngryResetUserMapVarNotificationElementComponent CreateTemplate()
	{
		GameObject obj = Object.Instantiate<GameObject>(((Component)template).gameObject, ((Component)template).transform.parent);
		obj.SetActive(true);
		return obj.GetComponent<AngryResetUserMapVarNotificationElementComponent>();
	}
}
public class AngryResetUserMapVarNotificationElementComponent : MonoBehaviour
{
	[CompilerGenerated]
	private sealed class <>c__DisplayClass5_0
	{
		public Action cb;

		internal void <ResetButtonCoroutine>b__0()
		{
			if (cb != null)
			{
				cb();
			}
		}
	}

	[CompilerGenerated]
	private sealed class <ResetButtonCoroutine>d__5 : IEnumerator<object>, IEnumerator, IDisposable
	{
		private int <>1__state;

		private object <>2__current;

		public Action cb;

		public Button btn;

		public TextMeshProUGUI txt;

		private <>c__DisplayClass5_0 <>8__1;

		private int <i>5__2;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <ResetButtonCoroutine>d__5(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>8__1 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Expected O, but got Unknown
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Expected O, but got Unknown
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>8__1 = new <>c__DisplayClass5_0();
				<>8__1.cb = cb;
				((Selectable)btn).interactable = false;
				<i>5__2 = 3;
				break;
			case 1:
				<>1__state = -1;
				<i>5__2--;
				break;
			}
			if (<i>5__2 >= 1)
			{
				((TMP_Text)txt).text = $"Are you sure? ({<i>5__2})";
				<>2__current = (object)new WaitForSecondsRealtime(1f);
				<>1__state = 1;
				return true;
			}
			((TMP_Text)txt).text = "<color=red>Are you sure?</color>";
			((Selectable)btn).interactable = true;
			btn.onClick = new ButtonClickedEvent();
			((UnityEvent)btn.onClick).AddListener((UnityAction)delegate
			{
				if (<>8__1.cb != null)
				{
					<>8__1.cb();
				}
			});
			return false;
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	public TextMeshProUGUI id;

	public Button resetButton;

	public TextMeshProUGUI resetButtonText;

	public Action onReset;

	public void SetButton()
	{
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Expected O, but got Unknown
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_003c: Expected O, but got Unknown
		((TMP_Text)resetButtonText).text = "Reset";
		resetButton.onClick = new ButtonClickedEvent();
		((UnityEvent)resetButton.onClick).AddListener((UnityAction)delegate
		{
			((MonoBehaviour)this).StartCoroutine(ResetButtonCoroutine(resetButton, resetButtonText, onReset));
		});
	}

	[IteratorStateMachine(typeof(<ResetButtonCoroutine>d__5))]
	private IEnumerator ResetButtonCoroutine(Button btn, TextMeshProUGUI txt, Action cb)
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <ResetButtonCoroutine>d__5(0)
		{
			btn = btn,
			txt = txt,
			cb = cb
		};
	}
}
public class AngryScriptUpdateNotificationComponent : MonoBehaviour
{
	public Transform content;

	public Button cancel;

	public Button update;

	public Button continueButton;
}
public class AngryScriptWarningNotificationComponent : MonoBehaviour
{
	public Text header;

	public Text body;

	public Button topButton;

	public Text topButtonText;

	public Button leftButton;

	public Text leftButtonText;

	public Button rightButton;

	public Text rightButtonText;
}
public class AngryUIPanelComponent : MonoBehaviour
{
	public AngryReloadBundlePromptComponent reloadBundlePrompt;
}

plugins/AngryLevelLoader/RudeLevelScripts.Essentials.dll

Decompiled 3 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using UnityEngine;
using UnityEngine.Events;

[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("RudeLevelScripts.Essentials")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+e1970fe89667b37a77824ccd6b8e6cecf9e4cd08")]
[assembly: AssemblyProduct("RudeLevelScripts.Essentials")]
[assembly: AssemblyTitle("RudeLevelScripts.Essentials")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace RudeLevelScript
{
	public class FinalRoomTarget : MonoBehaviour
	{
		[Tooltip("If a valid Unique ID of a Rude Level Data is written, the level will be loaded. This ID can be in other bundles. If the id is invalid or the level is not available, returns to the main menu")]
		public string targetLevelUniqueId = "";
	}
	[CreateAssetMenu]
	public class RudeLevelData : ScriptableObject
	{
		[SerializeField]
		[Tooltip("Scene which belongs to the data")]
		public Object targetScene;

		[SerializeField]
		[HideInInspector]
		public string[] requiredDllNames;

		[HideInInspector]
		public string scenePath = "";

		[Header("Level Locator")]
		[Tooltip("This ID is used to reference the level externally, such as final pit targets or activasion scripts. This field must not match any other data's id even accross bundles. Strong naming suggested, such as including author name in the id")]
		public string uniqueIdentifier = "";

		[Space(10f)]
		[Header("Level Info")]
		[Tooltip("Name which will be displayed on angry")]
		public string levelName = "";

		[Tooltip("If the level is secret and uses FirstRoomSecret variant, set to true. Enabling this field will disable rank and challenge panel on angry side")]
		public bool isSecretLevel;

		[Tooltip("Order of the level in angry. Lower valued levels are at the top")]
		public int prefferedLevelOrder;

		[Tooltip("Sprite containing the level thumbnail. Label the sprite as well")]
		public Sprite levelPreviewImage;

		[Space(10f)]
		[Tooltip("Enablind this field will hide the level from angry until accessed by a final pit. Implemented for secret levels")]
		public bool hideIfNotPlayed;

		[Tooltip("The level IDs required to be completed before the level can be played. If one of the level ID's are not completed, level will be locked")]
		public string[] requiredCompletedLevelIdsForUnlock;

		[Space(10f)]
		public bool levelChallengeEnabled;

		public string levelChallengeText = "";

		[Tooltip("Set exactly to the number of secret bonuses in the level")]
		public int secretCount;
	}
}
namespace RudeLevelScripts
{
	public class RudeMapVarHandler : MonoBehaviour
	{
		[Header("This is the id of the file to register the list of MapVars below with. Keep in mind, fileID's are not bundle or level specific.", order = 0)]
		[Header("With this in mind, please use an id that is unique to you.", order = 1)]
		public string fileID;

		[Space(10f)]
		[Header("Every MapVar key you list here will be registered to be set/read from the provided fileID. ", order = 2)]
		[Header("For any MapVarSetter components that use keys in this list,", order = 3)]
		[Header("their persistence setting will be ignored and it will only read/write to the provided fileID.", order = 4)]
		public List<string> varList;

		private const int MAX_FILE_NAME_LENGTH = 48;

		public bool IsValid()
		{
			if (string.IsNullOrEmpty(fileID) || string.IsNullOrWhiteSpace(fileID))
			{
				Debug.LogError((object)("(" + ((Object)this).name + ") RudeMapVarHandler.fileID is empty, null, or whitespace."));
				return false;
			}
			if (fileID.IndexOfAny(Path.GetInvalidFileNameChars()) != -1)
			{
				Debug.LogError((object)("(" + ((Object)this).name + ") RudeMapVarHandler.fileID contains invalid characters."));
				return false;
			}
			if (fileID.Length > 48)
			{
				Debug.LogError((object)string.Format("({0}) {1}.{2} is too long. Max length is {3} characters.", ((Object)this).name, "RudeMapVarHandler", "fileID", 48));
				return false;
			}
			return true;
		}

		private void OnValidate()
		{
			if (fileID == null)
			{
				fileID = Guid.NewGuid().ToString();
			}
			char[] invalidFileNameChars = Path.GetInvalidFileNameChars();
			if (fileID.IndexOfAny(invalidFileNameChars) != -1)
			{
				Debug.LogError((object)"RudeMapVarHandler: fileID of RudeMapVarHandler contains invalid characters.");
				for (int i = 0; i < invalidFileNameChars.Length; i++)
				{
					fileID = fileID.Replace(invalidFileNameChars[i], '_');
				}
			}
			if (fileID.Length > 48)
			{
				fileID = fileID.Substring(0, Mathf.Min(fileID.Length, 48));
			}
		}
	}
}
namespace RudeLevelScripts.Essentials
{
	public class ExecuteOnSceneLoad : MonoBehaviour
	{
		[Tooltip("Lower value ExecuteOnSceneLoad are executed first")]
		public int relativeExecutionOrder;

		public UnityEvent onSceneLoad;

		public void Execute()
		{
			if (onSceneLoad != null)
			{
				onSceneLoad.Invoke();
			}
		}
	}
	[CreateAssetMenu]
	public class RudeBundleData : ScriptableObject
	{
		[Tooltip("Will be shown on the angry bundle list")]
		public string bundleName;

		[Tooltip("Will be shown below the bundle name")]
		public string author;

		[Tooltip("Icon shown right next to the level name. Must be in png format. If not square, gets cropped")]
		public Sprite levelIcon;
	}
}

plugins/AngryLevelLoader/Scripts/AngryLoaderAPI.dll

Decompiled 3 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using AngryLevelLoader;

[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("AngryLoaderAPI")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+e1970fe89667b37a77824ccd6b8e6cecf9e4cd08")]
[assembly: AssemblyProduct("AngryLoaderAPI")]
[assembly: AssemblyTitle("AngryLoaderAPI")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace AngryLoaderAPI;

public static class BundleInterface
{
	public static bool BundleExists(string bundleGuid)
	{
		return RudeBundleInterface.BundleExists(bundleGuid);
	}

	public static string GetBundleBuildHash(string bundleGuid)
	{
		return RudeBundleInterface.GetBundleBuildHash(bundleGuid);
	}
}
public static class LevelInterface
{
	public static char INCOMPLETE_LEVEL_CHAR = RudeLevelInterface.INCOMPLETE_LEVEL_CHAR;

	public static char GetLevelRank(string levelId)
	{
		return RudeLevelInterface.GetLevelRank(levelId);
	}

	public static bool GetLevelChallenge(string levelId)
	{
		return RudeLevelInterface.GetLevelChallenge(levelId);
	}

	public static bool GetLevelSecret(string levelId, int secretIndex)
	{
		return RudeLevelInterface.GetLevelSecret(levelId, secretIndex);
	}

	public static string GetCurrentLevelId()
	{
		return RudeLevelInterface.GetCurrentLevelId();
	}
}

plugins/AngryLevelLoader/Scripts/RudeLevelScripts.dll

Decompiled 3 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using AngryLoaderAPI;
using RudeLevelScript;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Events;
using UnityEngine.ResourceManagement.AsyncOperations;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("RudeLevelScripts")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+e1970fe89667b37a77824ccd6b8e6cecf9e4cd08")]
[assembly: AssemblyProduct("RudeLevelScripts")]
[assembly: AssemblyTitle("RudeLevelScripts")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace RudeLevelScript
{
	[Serializable]
	public class LayerInfo
	{
		public string layerName = "";

		public string[] layerLevels = new string[0];
	}
	public class FirstRoomSpawner : MonoBehaviour, ISerializationCallbackReceiver
	{
		[HideInInspector]
		internal class PlayerForcedMovement : MonoBehaviour
		{
			public NewMovement player;

			private Rigidbody rb;

			public static float defaultMoveForce = 67f;

			public float force = defaultMoveForce;

			public void Awake()
			{
				if ((Object)(object)player == (Object)null)
				{
					player = MonoSingleton<NewMovement>.Instance;
				}
				rb = ((Component)player).GetComponent<Rigidbody>();
				rb.useGravity = false;
			}

			public void LateUpdate()
			{
				//IL_0017: Unknown result type (might be due to invalid IL or missing references)
				rb.velocity = new Vector3(0f, force, 0f);
			}

			public void DestroyComp()
			{
				rb.useGravity = true;
				Object.Destroy((Object)(object)this);
			}
		}

		[HideInInspector]
		private class LocalMoveTowards : MonoBehaviour
		{
			public Vector3 targetLocalPosition;

			public bool active = false;

			public float speed = 10f;

			public void Update()
			{
				//IL_001c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0022: Unknown result type (might be due to invalid IL or missing references)
				//IL_0033: Unknown result type (might be due to invalid IL or missing references)
				//IL_0044: Unknown result type (might be due to invalid IL or missing references)
				//IL_004a: Unknown result type (might be due to invalid IL or missing references)
				if (active)
				{
					((Component)this).transform.localPosition = Vector3.MoveTowards(((Component)this).transform.localPosition, targetLocalPosition, Time.deltaTime * speed);
					if (((Component)this).transform.localPosition == targetLocalPosition)
					{
						Object.Destroy((Object)(object)this);
					}
				}
			}

			public void Activate()
			{
				active = true;
			}
		}

		[HideInInspector]
		private class CustomHellmapCursor : MonoBehaviour
		{
			public Vector2 targetPosition;

			public Image targetImage;

			public AudioSource aud;

			private bool white = true;

			private RectTransform rect;

			private void Start()
			{
				rect = ((Component)this).GetComponent<RectTransform>();
				((MonoBehaviour)this).Invoke("FlashImage", 0.075f);
			}

			private void Update()
			{
				//IL_000d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				//IL_0029: Unknown result type (might be due to invalid IL or missing references)
				//IL_002e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0034: Unknown result type (might be due to invalid IL or missing references)
				//IL_0039: Unknown result type (might be due to invalid IL or missing references)
				//IL_0044: Unknown result type (might be due to invalid IL or missing references)
				rect.anchoredPosition = Vector2.MoveTowards(rect.anchoredPosition, targetPosition, Time.deltaTime * 4f * Vector3.Distance(Vector2.op_Implicit(rect.anchoredPosition), Vector2.op_Implicit(targetPosition)));
			}

			private void FlashImage()
			{
				//IL_006a: Unknown result type (might be due to invalid IL or missing references)
				//IL_002d: Unknown result type (might be due to invalid IL or missing references)
				if (white)
				{
					white = false;
					((Graphic)targetImage).color = new Color(0f, 0f, 0f, 0f);
					if (!((Component)this).gameObject.activeSelf)
					{
						return;
					}
					aud.Play();
				}
				else
				{
					white = true;
					((Graphic)targetImage).color = Color.white;
				}
				if (((Component)this).gameObject.activeInHierarchy)
				{
					((MonoBehaviour)this).Invoke("FlashImage", 0.075f);
				}
			}
		}

		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static UnityAction <>9__35_5;

			public static Func<GameObject, bool> <>9__36_0;

			internal void <ConvertToAscendingFirstRoom>b__35_5()
			{
				//IL_000f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				MonoSingleton<StatsManager>.instance.spawnPos = ((Component)MonoSingleton<NewMovement>.instance).transform.position;
			}

			internal bool <Spawn>b__36_0(GameObject o)
			{
				return ((Object)o).name == "Canvas";
			}
		}

		[Tooltip("Player will be moved to this position if the room is not ascending variant. If null, default position is used")]
		public Transform playerSpawnPos;

		[Tooltip("If set to true, room will not be deleted. Else, it will be replaced in game")]
		public bool doNotReplace = false;

		[Header("Replace Settings")]
		[Tooltip("Enabling this field causes room to be spawned as the secret variant")]
		public bool secretRoom = false;

		[Tooltip("Enabling this field causes room to be spawned as the prime variant")]
		public bool primeRoom = false;

		[Tooltip("Enabling this field causes the whole room to be converted into the ascending variant where the player is spawned at the bottom and ascends upwards instead of falling")]
		public bool convertToUpwardRoom = false;

		[Tooltip("This clip will be played when the trap door closes beneath the player for ascending rooms")]
		public AudioClip upwardRoomDoorCloseClip;

		[Tooltip("If bottom part of the ascending room collides with out of bounds triggers, this list can temporarely disable them while the player is ascending")]
		public List<GameObject> upwardRoomOutOfBoundsToDisable;

		[Header("Player Fields")]
		[Space(10f)]
		public CameraClearFlags cameraFillMode = (CameraClearFlags)2;

		public Color backgroundColor = Color.black;

		[Header("Level Fields")]
		[Space(10f)]
		[Tooltip("If set to true, level title will be displayed when the door is opened")]
		public bool displayLevelTitle = true;

		[Tooltip("If set to true, music will start when the door is opened")]
		public bool startMusic = true;

		[Header("Hellmap")]
		[Tooltip("Enable the layer and level map when the player spawn")]
		[Space(10f)]
		public bool enableHellMap = false;

		[Tooltip("Sound clip which is played for each beep while falling")]
		public AudioClip hellmapBeepClip;

		[Tooltip("Each layer has a layer name and number of levels. For limbo the header is LIMBO and levels are [1-1, 1-2, 1-3, 1-4]")]
		public List<LayerInfo> layersAndLevels = new List<LayerInfo>();

		[HideInInspector]
		public List<int> levelSizes = new List<int>();

		[HideInInspector]
		public List<string> layerNames = new List<string>();

		[HideInInspector]
		public List<string> levelNames = new List<string>();

		[Tooltip("Which layer the cursor starts from. First layer is 0 and at the top")]
		public int layerIndexToStartFrom;

		[Tooltip("Which level in the layer the cursor starts from. The first level is 0 and is just below the layer title (the uppermost level)")]
		public int levelIndexToStartFrom;

		[Tooltip("Which layer the cursor ends at. First layer is 0 and at the top")]
		public int layerIndexToEndAt;

		[Tooltip("Which level in the layer the cursor ends at. The first level is 0 and is just below the layer title (the uppermost level)")]
		public int levelIndexToEndAt;

		private bool spawned = false;

		public static float upDisablePos = 60f;

		public static float doorClosePos = 10f;

		public static float doorCloseSpeed = 10f;

		public static float actDelay = 0.5f;

		public static float ascendingPlayerSpawnPos = -55f;

		public void OnBeforeSerialize()
		{
			levelSizes.Clear();
			layerNames.Clear();
			levelNames.Clear();
			for (int i = 0; i < layersAndLevels.Count; i++)
			{
				layerNames.Add(layersAndLevels[i].layerName);
				levelSizes.Add(layersAndLevels[i].layerLevels.Length);
				levelNames.AddRange(layersAndLevels[i].layerLevels);
			}
		}

		public void Deserialize()
		{
			layersAndLevels.Clear();
			int num = 0;
			for (int i = 0; i < levelSizes.Count; i++)
			{
				LayerInfo layerInfo = new LayerInfo();
				layerInfo.layerName = layerNames[i];
				int num2 = levelSizes[i];
				layerInfo.layerLevels = new string[num2];
				for (int j = 0; j < num2; j++)
				{
					layerInfo.layerLevels[j] = levelNames[num++];
				}
				layersAndLevels.Add(layerInfo);
			}
		}

		public void OnAfterDeserialize()
		{
		}

		private static Text MakeText(Transform parent)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject();
			RectTransform val2 = val.AddComponent<RectTransform>();
			((Transform)val2).SetParent(parent);
			val.transform.localScale = Vector3.one;
			return val.AddComponent<Text>();
		}

		private static RectTransform MakeRect(Transform parent)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			GameObject val = new GameObject();
			RectTransform val2 = val.AddComponent<RectTransform>();
			((Transform)val2).SetParent(parent);
			return val2;
		}

		public static void ConvertToAscendingFirstRoom(GameObject firstRoom, AudioClip doorCloseAud, List<GameObject> toEnable, List<GameObject> toDisable, bool doNotReplace)
		{
			//IL_02be: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0379: Unknown result type (might be due to invalid IL or missing references)
			//IL_038f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0399: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bd: Expected O, but got Unknown
			//IL_03f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0402: Unknown result type (might be due to invalid IL or missing references)
			//IL_0423: Unknown result type (might be due to invalid IL or missing references)
			//IL_0473: Unknown result type (might be due to invalid IL or missing references)
			//IL_047d: Expected O, but got Unknown
			//IL_0484: Unknown result type (might be due to invalid IL or missing references)
			//IL_048e: Expected O, but got Unknown
			//IL_04a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ab: Expected O, but got Unknown
			//IL_04ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b3: Expected O, but got Unknown
			//IL_04e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0519: Unknown result type (might be due to invalid IL or missing references)
			//IL_0569: Unknown result type (might be due to invalid IL or missing references)
			//IL_0573: Expected O, but got Unknown
			//IL_057a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0584: Expected O, but got Unknown
			//IL_0597: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a1: Expected O, but got Unknown
			//IL_05b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05bf: Expected O, but got Unknown
			//IL_05d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05dd: Expected O, but got Unknown
			//IL_05f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0603: Expected O, but got Unknown
			//IL_060a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0614: Expected O, but got Unknown
			//IL_0627: Unknown result type (might be due to invalid IL or missing references)
			//IL_0631: Expected O, but got Unknown
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_021d: Unknown result type (might be due to invalid IL or missing references)
			//IL_026c: Unknown result type (might be due to invalid IL or missing references)
			//IL_028d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0652: Unknown result type (might be due to invalid IL or missing references)
			//IL_0657: Unknown result type (might be due to invalid IL or missing references)
			//IL_065d: Expected O, but got Unknown
			Transform val = firstRoom.transform.Find("Room");
			if (!doNotReplace)
			{
				Transform val2 = val.Find("Pit (3)");
				((Component)val2).transform.localPosition = new Vector3(0f, 2f, 41.72f);
				((Component)val2).transform.localRotation = Quaternion.Euler(0f, 0f, 180f);
				Object.Destroy((Object)(object)((Component)((Component)val).transform.Find("Room/Ceiling")).gameObject);
				Transform val3 = ((Component)val).transform.Find("Room/Floor");
				GameObject gameObject = ((Component)val3.GetChild(0)).gameObject;
				GameObject val4 = Object.Instantiate<GameObject>(gameObject, val3);
				val4.transform.localPosition = new Vector3(-15f, 9.7f, 20.28f);
				val4.transform.localRotation = Quaternion.identity;
				GameObject val5 = Object.Instantiate<GameObject>(gameObject, val3);
				val5.transform.localPosition = new Vector3(5f, 9.7f, 20.28f);
				val5.transform.localRotation = Quaternion.identity;
				GameObject val6 = Object.Instantiate<GameObject>(gameObject, val3);
				val6.transform.localPosition = new Vector3(-5f, 9.7f, 0.2f);
				val6.transform.localRotation = Quaternion.Euler(0f, -90f, 0f);
				GameObject val7 = Object.Instantiate<GameObject>(gameObject, val3);
				val7.transform.localPosition = new Vector3(5f, 9.7f, 10.28f);
				val7.transform.localRotation = Quaternion.identity;
				((Renderer)val7.GetComponent<MeshRenderer>()).materials = (Material[])(object)new Material[2]
				{
					Utils.metalDec20,
					Utils.metalDec20
				};
				GameObject val8 = Object.Instantiate<GameObject>(gameObject, val3);
				val8.transform.localPosition = new Vector3(-15f, 9.7f, 10.28f);
				val8.transform.localRotation = Quaternion.identity;
				((Renderer)val8.GetComponent<MeshRenderer>()).materials = (Material[])(object)new Material[2]
				{
					Utils.metalDec20,
					Utils.metalDec20
				};
				GameObject val9 = Object.Instantiate<GameObject>(gameObject, val3);
				val9.transform.localPosition = new Vector3(-5f, -0.3f, 20.28f);
				val9.transform.localRotation = Quaternion.Euler(0f, -90f, -180f);
			}
			Transform val10 = val.Find("Decorations");
			Transform child = val10.GetChild(12);
			child.localPosition = new Vector3(-5f, 2f, 52f);
			LocalMoveTowards floorMover = ((Component)child).gameObject.AddComponent<LocalMoveTowards>();
			floorMover.targetLocalPosition = new Vector3(-5f, 2f, 42f);
			floorMover.speed = doorCloseSpeed;
			AudioSource floorTileAud = ((Component)child).gameObject.AddComponent<AudioSource>();
			floorTileAud.playOnAwake = false;
			floorTileAud.loop = false;
			floorTileAud.clip = doorCloseAud;
			PlayerActivator act = firstRoom.GetComponentsInChildren<PlayerActivator>().First();
			((Component)act).gameObject.SetActive(false);
			NewMovement instance = MonoSingleton<NewMovement>.instance;
			((Component)instance).transform.localPosition = new Vector3(((Component)instance).transform.localPosition.x, ascendingPlayerSpawnPos, ((Component)instance).transform.localPosition.z);
			PlayerForcedMovement focedMov = ((Component)instance).gameObject.AddComponent<PlayerForcedMovement>();
			GameObject val11 = new GameObject();
			val11.transform.SetParent(((Component)act).transform.parent);
			val11.transform.localPosition = new Vector3(0f, upDisablePos, 0f);
			val11.transform.localRotation = Quaternion.identity;
			val11.transform.localScale = new Vector3(80f, 0.2f, 80f);
			val11.layer = ((Component)act).gameObject.layer;
			BoxCollider val12 = val11.AddComponent<BoxCollider>();
			((Collider)val12).isTrigger = true;
			ObjectActivator val13 = val11.AddComponent<ObjectActivator>();
			val13.dontActivateOnEnable = true;
			val13.oneTime = true;
			val13.events = new UltrakillEvent();
			val13.events.onActivate = new UnityEvent();
			val13.events.onActivate.AddListener((UnityAction)delegate
			{
				focedMov.DestroyComp();
			});
			GameObject val14 = new GameObject();
			val14.transform.SetParent(((Component)act).transform.parent);
			val14.transform.localPosition = new Vector3(0f, doorClosePos, 0f);
			val14.transform.localRotation = Quaternion.identity;
			val14.transform.localScale = new Vector3(80f, 0.2f, 80f);
			val14.layer = ((Component)act).gameObject.layer;
			BoxCollider val15 = val14.AddComponent<BoxCollider>();
			((Collider)val15).isTrigger = true;
			ObjectActivator val16 = val14.AddComponent<ObjectActivator>();
			val16.dontActivateOnEnable = true;
			val16.oneTime = true;
			val16.events = new UltrakillEvent();
			val16.events.onActivate = new UnityEvent();
			val16.events.onActivate.AddListener((UnityAction)delegate
			{
				floorMover.Activate();
			});
			val16.events.onActivate.AddListener((UnityAction)delegate
			{
				floorTileAud.Play();
			});
			val16.events.onActivate.AddListener((UnityAction)delegate
			{
				foreach (GameObject item in toEnable)
				{
					item.SetActive(true);
				}
				foreach (GameObject item2 in toDisable)
				{
					item2.SetActive(false);
				}
			});
			ObjectActivator val17 = val14.AddComponent<ObjectActivator>();
			val17.dontActivateOnEnable = true;
			val17.oneTime = true;
			val17.events = new UltrakillEvent();
			val17.events.onActivate = new UnityEvent();
			val17.events.onActivate.AddListener((UnityAction)delegate
			{
				((Component)act).gameObject.SetActive(true);
			});
			UnityEvent onActivate = val17.events.onActivate;
			object obj = <>c.<>9__35_5;
			if (obj == null)
			{
				UnityAction val18 = delegate
				{
					//IL_000f: Unknown result type (might be due to invalid IL or missing references)
					//IL_0014: Unknown result type (might be due to invalid IL or missing references)
					MonoSingleton<StatsManager>.instance.spawnPos = ((Component)MonoSingleton<NewMovement>.instance).transform.position;
				};
				<>c.<>9__35_5 = val18;
				obj = (object)val18;
			}
			onActivate.AddListener((UnityAction)obj);
			val17.delay = actDelay;
		}

		public void Spawn()
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			//IL_0233: Unknown result type (might be due to invalid IL or missing references)
			//IL_0316: Unknown result type (might be due to invalid IL or missing references)
			//IL_031b: Unknown result type (might be due to invalid IL or missing references)
			//IL_031c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0324: Unknown result type (might be due to invalid IL or missing references)
			//IL_0338: Unknown result type (might be due to invalid IL or missing references)
			//IL_034f: Unknown result type (might be due to invalid IL or missing references)
			//IL_035c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0369: Unknown result type (might be due to invalid IL or missing references)
			//IL_0373: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_043b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0440: Unknown result type (might be due to invalid IL or missing references)
			//IL_0441: Unknown result type (might be due to invalid IL or missing references)
			//IL_0449: Unknown result type (might be due to invalid IL or missing references)
			//IL_045d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0474: Unknown result type (might be due to invalid IL or missing references)
			//IL_0481: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_050a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0517: Unknown result type (might be due to invalid IL or missing references)
			//IL_0524: Unknown result type (might be due to invalid IL or missing references)
			//IL_053b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0548: Unknown result type (might be due to invalid IL or missing references)
			//IL_0555: Unknown result type (might be due to invalid IL or missing references)
			//IL_0942: Unknown result type (might be due to invalid IL or missing references)
			//IL_0947: Unknown result type (might be due to invalid IL or missing references)
			//IL_0950: Unknown result type (might be due to invalid IL or missing references)
			//IL_0980: Unknown result type (might be due to invalid IL or missing references)
			//IL_0985: Unknown result type (might be due to invalid IL or missing references)
			//IL_098e: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_09bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_09bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_09c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_09d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_09f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a0c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a19: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a26: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a94: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a96: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ad6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ae0: Expected O, but got Unknown
			//IL_0591: Unknown result type (might be due to invalid IL or missing references)
			//IL_0596: Unknown result type (might be due to invalid IL or missing references)
			//IL_0597: Unknown result type (might be due to invalid IL or missing references)
			//IL_059f: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_061c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0621: Unknown result type (might be due to invalid IL or missing references)
			//IL_0622: Unknown result type (might be due to invalid IL or missing references)
			//IL_062a: Unknown result type (might be due to invalid IL or missing references)
			//IL_063e: Unknown result type (might be due to invalid IL or missing references)
			//IL_064b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0667: Unknown result type (might be due to invalid IL or missing references)
			//IL_06dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0705: Unknown result type (might be due to invalid IL or missing references)
			//IL_071c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0729: Unknown result type (might be due to invalid IL or missing references)
			//IL_0740: Unknown result type (might be due to invalid IL or missing references)
			//IL_074d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0797: Unknown result type (might be due to invalid IL or missing references)
			//IL_079c: Unknown result type (might be due to invalid IL or missing references)
			//IL_079d: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_07fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0808: Unknown result type (might be due to invalid IL or missing references)
			//IL_0840: Unknown result type (might be due to invalid IL or missing references)
			//IL_0845: Unknown result type (might be due to invalid IL or missing references)
			//IL_0846: Unknown result type (might be due to invalid IL or missing references)
			//IL_084e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0862: Unknown result type (might be due to invalid IL or missing references)
			//IL_0879: Unknown result type (might be due to invalid IL or missing references)
			//IL_0894: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a1: Unknown result type (might be due to invalid IL or missing references)
			if (spawned)
			{
				return;
			}
			GameObject val = ((Component)this).gameObject;
			GameObject val2 = Addressables.LoadAssetAsync<GameObject>((object)(secretRoom ? "FirstRoom Secret" : (primeRoom ? "FirstRoom Prime" : "FirstRoom"))).WaitForCompletion();
			if (!doNotReplace)
			{
				val = Object.Instantiate<GameObject>(val2, ((Component)this).transform.parent);
			}
			else
			{
				GameObject val3 = Object.Instantiate<GameObject>(val2, ((Component)this).transform.position, ((Component)this).transform.rotation, ((Component)this).transform.parent);
				Object.Destroy((Object)(object)((Component)val3.transform.Find("Room")).gameObject);
			}
			MeshCollider[] componentsInChildren = val.GetComponentsInChildren<MeshCollider>();
			MeshFilter val5 = default(MeshFilter);
			foreach (MeshCollider val4 in componentsInChildren)
			{
				if (((Component)val4).gameObject.TryGetComponent<MeshFilter>(ref val5))
				{
					val5.mesh = val4.sharedMesh;
				}
			}
			Transform transform = ((Component)MonoSingleton<NewMovement>.instance).transform;
			((Component)transform).transform.parent = val.transform;
			val.transform.position = ((Component)this).transform.position;
			val.transform.rotation = ((Component)this).transform.rotation;
			((Component)transform).transform.parent = null;
			Quaternion rotation = ((Component)this).transform.rotation;
			Utils.SetPlayerWorldRotation(Quaternion.Euler(0f, ((Quaternion)(ref rotation)).eulerAngles.y, 0f));
			if ((Object)(object)playerSpawnPos != (Object)null)
			{
				((Component)transform).transform.parent = ((Component)playerSpawnPos).transform.parent;
				((Component)transform).transform.localPosition = playerSpawnPos.localPosition;
				Utils.SetPlayerWorldRotation(playerSpawnPos.rotation);
				((Component)transform).transform.SetParent((Transform)null);
			}
			MonoSingleton<StatsManager>.instance.spawnPos = ((Component)transform).transform.position;
			try
			{
				Transform val6 = val.transform.Find("Room/FinalDoor");
				FinalDoor component = ((Component)val6).GetComponent<FinalDoor>();
				Camera main = Camera.main;
				main.backgroundColor = backgroundColor;
				main.clearFlags = cameraFillMode;
				FinalDoorOpener component2 = ((Component)val.transform.Find("Room/FinalDoor/FinalDoorOpener")).GetComponent<FinalDoorOpener>();
				component2.startMusic = startMusic;
				FinalDoor component3 = ((Component)val.transform.Find("Room/FinalDoor")).GetComponent<FinalDoor>();
				GameObject val7 = null;
				if (enableHellMap)
				{
					Deserialize();
					Transform obj = ((Component)MonoSingleton<NewMovement>.instance).transform.Find("Canvas");
					if (obj == null)
					{
						Scene activeScene = SceneManager.GetActiveScene();
						obj = (from o in ((Scene)(ref activeScene)).GetRootGameObjects()
							where ((Object)o).name == "Canvas"
							select o).First().transform;
					}
					Transform parent = obj;
					RectTransform val8 = MakeRect(parent);
					((Object)val8).name = "Hellmap";
					val7 = ((Component)val8).gameObject;
					Vector2 anchorMin = (val8.anchorMax = new Vector2(0.5f, 0.5f));
					val8.anchorMin = anchorMin;
					val8.pivot = new Vector2(0.5f, 0.5f);
					val8.sizeDelta = new Vector2(250f, 650f);
					val8.anchoredPosition = Vector2.zero;
					((Transform)val8).localScale = Vector3.one * 0.82244f;
					((Transform)val8).SetAsFirstSibling();
					RectTransform val10 = MakeRect(((Component)val8).transform);
					((Object)val10).name = "Hellmap Container";
					val10.anchorMin = Vector2.zero;
					val10.anchorMax = Vector2.one;
					val10.pivot = new Vector2(0.5f, 0.5f);
					val10.sizeDelta = Vector2.zero;
					val10.anchoredPosition = Vector2.zero;
					((Transform)val10).localScale = Vector3.one;
					float num = 0f;
					Stack<RectTransform> stack = new Stack<RectTransform>();
					foreach (LayerInfo layersAndLevel in layersAndLevels)
					{
						RectTransform val11 = MakeRect((Transform)(object)val10);
						anchorMin = (val11.anchorMax = new Vector2(0f, 1f));
						val11.anchorMin = anchorMin;
						val11.sizeDelta = new Vector2(250f, 50f);
						val11.pivot = new Vector2(0f, 1f);
						((Transform)val11).localScale = Vector3.one;
						val11.anchoredPosition = new Vector2(0f, (num == 0f) ? (-3.051758E-05f) : num);
						num -= 50f;
						Text val13 = MakeText((Transform)(object)val11);
						val13.text = layersAndLevel.layerName;
						val13.fontSize = 36;
						val13.font = Utils.gameFont;
						val13.alignment = (TextAnchor)3;
						((Graphic)val13).color = Color.white;
						RectTransform component4 = ((Component)val13).GetComponent<RectTransform>();
						component4.anchorMin = Vector2.zero;
						component4.anchorMax = Vector2.one;
						component4.sizeDelta = Vector2.zero;
						component4.pivot = new Vector2(0.5f, 0.5f);
						((Transform)component4).localScale = Vector3.one;
						component4.anchoredPosition = Vector2.zero;
						string[] layerLevels = layersAndLevel.layerLevels;
						foreach (string text in layerLevels)
						{
							RectTransform val14 = MakeRect((Transform)(object)val10);
							anchorMin = (val14.anchorMax = new Vector2(0f, 1f));
							val14.anchorMin = anchorMin;
							val14.pivot = new Vector2(0f, 1f);
							((Transform)val14).localScale = Vector3.one;
							val14.anchoredPosition = new Vector2(60f, num);
							val14.sizeDelta = new Vector2(125f, 45f);
							num -= 50f;
							RectTransform val16 = MakeRect(((Component)val14).transform);
							anchorMin = (val16.anchorMax = new Vector2(0.5f, 0.5f));
							val16.anchorMin = anchorMin;
							val16.sizeDelta = new Vector2(25f, 9f);
							val16.anchoredPosition = Vector2.zero;
							((Transform)val16).localScale = new Vector3(5f, 5f, 5f);
							Image val18 = ((Component)val16).gameObject.AddComponent<Image>();
							val18.type = (Type)1;
							val18.sprite = Utils.levelPanel;
							val18.pixelsPerUnitMultiplier = 1f;
							Text val19 = MakeText(((Component)val14).transform);
							val19.text = text;
							val19.font = Utils.gameFont;
							val19.fontSize = 32;
							val19.alignment = (TextAnchor)4;
							((Graphic)val19).color = Color.black;
							RectTransform component5 = ((Component)val19).gameObject.GetComponent<RectTransform>();
							component5.anchorMin = Vector2.zero;
							component5.anchorMax = Vector2.one;
							component5.pivot = new Vector2(0.5f, 0.5f);
							component5.sizeDelta = Vector2.zero;
							component5.anchoredPosition = new Vector2(0f, 0f);
							((Transform)component5).localScale = Vector3.one;
						}
						if (layersAndLevel.layerLevels.Length != 0)
						{
							RectTransform val20 = MakeRect((Transform)(object)val10);
							anchorMin = (val20.anchorMax = new Vector2(0.5f, 1f));
							val20.anchorMin = anchorMin;
							val20.pivot = new Vector2(0.5f, 0f);
							val20.anchoredPosition = new Vector2(-95f, num + 25f);
							val20.sizeDelta = new Vector2(3f, (float)layersAndLevel.layerLevels.Length * 50f - 27.5f);
							((Transform)val20).localScale = Vector3.one;
							((Component)val20).gameObject.AddComponent<Image>();
							for (int k = 0; k < layersAndLevel.layerLevels.Length; k++)
							{
								RectTransform val22 = MakeRect((Transform)(object)val20);
								anchorMin = (val22.anchorMax = new Vector2(0.5f, 0f));
								val22.anchorMin = anchorMin;
								val22.pivot = new Vector2(0f, 0.5f);
								val22.sizeDelta = new Vector2(20f, 3f);
								val22.anchoredPosition = new Vector2(-1.5f, (float)k * 50f);
								((Transform)val22).localScale = Vector3.one;
								((Component)val22).gameObject.AddComponent<Image>();
							}
							stack.Push(val20);
						}
					}
					while (stack.Count != 0)
					{
						RectTransform val24 = stack.Pop();
						((Transform)val24).SetAsLastSibling();
					}
					Vector2 anchoredPosition = ((Component)((Transform)val10).GetChild(GetChildIndexFromLayerAndLevel(layerIndexToStartFrom, levelIndexToStartFrom))).GetComponent<RectTransform>().anchoredPosition;
					((Vector2)(ref anchoredPosition))..ctor(210f, anchoredPosition.y - 22.5f);
					Vector2 anchoredPosition2 = ((Component)((Transform)val10).GetChild(GetChildIndexFromLayerAndLevel(layerIndexToEndAt, levelIndexToEndAt))).GetComponent<RectTransform>().anchoredPosition;
					((Vector2)(ref anchoredPosition2))..ctor(210f, anchoredPosition2.y - 22.5f);
					RectTransform val25 = MakeRect((Transform)(object)val8);
					anchorMin = (val25.anchorMax = new Vector2(0f, 1f));
					val25.anchorMin = anchorMin;
					val25.pivot = new Vector2(0.5f, 0.5f);
					val25.sizeDelta = new Vector2(35f, 35f);
					((Transform)val25).rotation = Quaternion.Euler(0f, 0f, 90f);
					((Transform)val25).localScale = Vector3.one;
					val25.anchoredPosition = anchoredPosition;
					AudioSource val27 = ((Component)val25).gameObject.AddComponent<AudioSource>();
					val27.playOnAwake = false;
					val27.loop = false;
					val27.clip = hellmapBeepClip;
					val27.volume = 0.1f;
					Image val28 = ((Component)val25).gameObject.AddComponent<Image>();
					val28.sprite = Utils.hellmapArrow;
					CustomHellmapCursor customHellmapCursor = ((Component)val25).gameObject.AddComponent<CustomHellmapCursor>();
					customHellmapCursor.targetPosition = anchoredPosition2;
					customHellmapCursor.aud = val27;
					customHellmapCursor.targetImage = val28;
					ObjectActivator val29 = ((Component)UnityUtils.GetComponentInChildrenRecursive<PlayerActivator>(val.transform)).gameObject.AddComponent<ObjectActivator>();
					val29.dontActivateOnEnable = true;
					val29.oneTime = true;
					val29.events = new UltrakillEvent();
					val29.events.toDisActivateObjects = (GameObject[])(object)new GameObject[1] { ((Component)val8).gameObject };
				}
				if (!convertToUpwardRoom)
				{
					return;
				}
				foreach (GameObject item in upwardRoomOutOfBoundsToDisable)
				{
					item.SetActive(false);
				}
				List<GameObject> list = new List<GameObject>();
				if ((Object)(object)val7 != (Object)null)
				{
					list.Add(val7);
				}
				List<GameObject> list2 = new List<GameObject>();
				list2.AddRange(upwardRoomOutOfBoundsToDisable);
				ConvertToAscendingFirstRoom(val, upwardRoomDoorCloseClip, list2, list, doNotReplace);
			}
			catch (Exception ex)
			{
				throw ex;
			}
			finally
			{
				spawned = true;
			}
			int GetChildIndexFromLayerAndLevel(int layer, int level)
			{
				int num2 = 0;
				for (int l = 0; l < layer; l++)
				{
					num2 += 1 + levelSizes[l];
				}
				return num2 + 1 + level;
			}
		}

		public void Awake()
		{
			Spawn();
		}

		public void Start()
		{
			if ((Object)(object)MonoSingleton<OnLevelStart>.Instance != (Object)null)
			{
				MonoSingleton<OnLevelStart>.Instance.levelNameOnStart = displayLevelTitle;
			}
			else
			{
				Debug.LogWarning((object)"Could not find OnLevelStart");
			}
			if (!doNotReplace)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
		}
	}
	public class RudeLevelChallengeChecker : MonoBehaviour
	{
		public string targetLevelId = null;

		public UltrakillEvent onSuccess = null;

		public UltrakillEvent onFailure = null;

		public bool activateOnEnable = true;

		public void OnEnable()
		{
			if (activateOnEnable)
			{
				Activate();
			}
		}

		public void Activate()
		{
			if (LevelInterface.GetLevelChallenge(targetLevelId))
			{
				if (onSuccess != null)
				{
					onSuccess.Invoke("");
				}
			}
			else if (onFailure != null)
			{
				onFailure.Invoke("");
			}
		}
	}
	public enum LevelRanks
	{
		NotCompleted,
		Completed,
		CompletedWithCheats,
		CompletedWithoutCheats,
		D,
		AtLeastD,
		AtMostD,
		C,
		AtLeastC,
		AtMostC,
		B,
		AtLeastB,
		AtMostB,
		A,
		AtLeastA,
		AtMostA,
		S,
		AtLeastS,
		AtMostS,
		P
	}
	public class RudeLevelRankChecker : MonoBehaviour
	{
		public string targetLevelUniqueId = "";

		public LevelRanks requiredFinalRank = LevelRanks.Completed;

		public UltrakillEvent OnSuccess = null;

		public UltrakillEvent OnFail = null;

		public bool activateOnEnable = true;

		public void OnEnable()
		{
			if (activateOnEnable)
			{
				Activate();
			}
		}

		public static int GetRankScore(char rank)
		{
			return rank switch
			{
				'D' => 1, 
				'C' => 2, 
				'B' => 3, 
				'A' => 4, 
				'S' => 5, 
				'P' => 6, 
				_ => -1, 
			};
		}

		public void Activate()
		{
			char levelRank = LevelInterface.GetLevelRank(targetLevelUniqueId);
			int rankScore = GetRankScore(levelRank);
			bool flag = false;
			switch (requiredFinalRank)
			{
			case LevelRanks.NotCompleted:
				flag = levelRank == '-';
				break;
			case LevelRanks.Completed:
				flag = levelRank != '-';
				break;
			case LevelRanks.CompletedWithCheats:
				flag = levelRank == ' ';
				break;
			case LevelRanks.CompletedWithoutCheats:
				flag = levelRank != ' ' && levelRank != '-';
				break;
			case LevelRanks.D:
				flag = levelRank == 'D';
				break;
			case LevelRanks.C:
				flag = levelRank == 'C';
				break;
			case LevelRanks.B:
				flag = levelRank == 'B';
				break;
			case LevelRanks.A:
				flag = levelRank == 'A';
				break;
			case LevelRanks.S:
				flag = levelRank == 'S';
				break;
			case LevelRanks.P:
				flag = levelRank == 'P';
				break;
			case LevelRanks.AtLeastD:
				flag = rankScore >= GetRankScore('D');
				break;
			case LevelRanks.AtMostD:
				flag = rankScore <= GetRankScore('D');
				break;
			case LevelRanks.AtLeastC:
				flag = rankScore >= GetRankScore('C');
				break;
			case LevelRanks.AtMostC:
				flag = rankScore <= GetRankScore('C');
				break;
			case LevelRanks.AtLeastB:
				flag = rankScore >= GetRankScore('B');
				break;
			case LevelRanks.AtMostB:
				flag = rankScore <= GetRankScore('B');
				break;
			case LevelRanks.AtLeastA:
				flag = rankScore >= GetRankScore('A');
				break;
			case LevelRanks.AtMostA:
				flag = rankScore <= GetRankScore('A');
				break;
			case LevelRanks.AtLeastS:
				flag = rankScore >= GetRankScore('S');
				break;
			case LevelRanks.AtMostS:
				flag = rankScore <= GetRankScore('S');
				break;
			}
			if (flag)
			{
				if (OnSuccess != null)
				{
					OnSuccess.Invoke("");
				}
			}
			else if (OnFail != null)
			{
				OnFail.Invoke("");
			}
		}
	}
	public class RudeLevelSecretChecker : MonoBehaviour
	{
		public string targetLevelId = "";

		public int targetSecretIndex = 0;

		public UltrakillEvent onSuccess = null;

		public UltrakillEvent onFailure = null;

		public bool activateOnEnable = true;

		public void OnEnable()
		{
			if (activateOnEnable)
			{
				Activate();
			}
		}

		public void Activate()
		{
			if (LevelInterface.GetLevelSecret(targetLevelId, targetSecretIndex))
			{
				if (onSuccess != null)
				{
					onSuccess.Invoke("");
				}
			}
			else if (onFailure != null)
			{
				onFailure.Invoke("");
			}
		}
	}
	public static class Utils
	{
		private static Font _gameFont;

		private static Sprite _levelPanel;

		private static Sprite _hellmapArrow;

		private static Material _metalDec20;

		public static Font gameFont
		{
			get
			{
				//IL_0015: Unknown result type (might be due to invalid IL or missing references)
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)_gameFont == (Object)null)
				{
					_gameFont = Addressables.LoadAssetAsync<Font>((object)"Assets/Fonts/VCR_OSD_MONO_1.001.ttf").WaitForCompletion();
				}
				return _gameFont;
			}
		}

		public static Sprite levelPanel
		{
			get
			{
				//IL_0015: Unknown result type (might be due to invalid IL or missing references)
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)_levelPanel == (Object)null)
				{
					_levelPanel = Addressables.LoadAssetAsync<Sprite>((object)"Assets/Textures/UI/meter.png").WaitForCompletion();
				}
				return _levelPanel;
			}
		}

		public static Sprite hellmapArrow
		{
			get
			{
				//IL_0015: Unknown result type (might be due to invalid IL or missing references)
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)_hellmapArrow == (Object)null)
				{
					_hellmapArrow = Addressables.LoadAssetAsync<Sprite>((object)"Assets/Textures/UI/arrow.png").WaitForCompletion();
				}
				return _hellmapArrow;
			}
		}

		public static Material metalDec20
		{
			get
			{
				//IL_0015: Unknown result type (might be due to invalid IL or missing references)
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)_metalDec20 == (Object)null)
				{
					_metalDec20 = Addressables.LoadAssetAsync<Material>((object)"Assets/Materials/Environment/Metal/Metal Decoration 20.mat").WaitForCompletion();
				}
				return _metalDec20;
			}
		}

		public static void SetPlayerWorldRotation(Quaternion newRotation)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			((Component)MonoSingleton<CameraController>.Instance).transform.rotation = newRotation;
			float x = ((Component)MonoSingleton<CameraController>.Instance).transform.localEulerAngles.x;
			float rotationX = x;
			if (x <= 90f && x >= 0f)
			{
				rotationX = 0f - x;
			}
			else if (x >= 270f && x <= 360f)
			{
				rotationX = Mathf.Lerp(0f, 90f, Mathf.InverseLerp(360f, 270f, x));
			}
			Quaternion rotation = ((Component)MonoSingleton<CameraController>.Instance).transform.rotation;
			float y = ((Quaternion)(ref rotation)).eulerAngles.y;
			MonoSingleton<CameraController>.Instance.rotationX = rotationX;
			MonoSingleton<CameraController>.Instance.rotationY = y;
		}
	}
	public static class UnityUtils
	{
		[CompilerGenerated]
		private sealed class <GetComponentsInChildrenRecursive>d__0<T> : IEnumerable<object>, IEnumerable, IEnumerator<object>, IEnumerator, IDisposable where T : Component
		{
			private int <>1__state;

			private object <>2__current;

			private int <>l__initialThreadId;

			private Transform parent;

			public Transform <>3__parent;

			private IEnumerator <>s__1;

			private Transform <child>5__2;

			private T <comp>5__3;

			private IEnumerator <>s__4;

			private T <childComp>5__5;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <GetComponentsInChildrenRecursive>d__0(int <>1__state)
			{
				this.<>1__state = <>1__state;
				<>l__initialThreadId = Environment.CurrentManagedThreadId;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				int num = <>1__state;
				if ((uint)(num - -4) <= 1u || (uint)(num - 1) <= 1u)
				{
					try
					{
						if (num == -4 || num == 2)
						{
							try
							{
							}
							finally
							{
								<>m__Finally2();
							}
						}
					}
					finally
					{
						<>m__Finally1();
					}
				}
				<>s__1 = null;
				<child>5__2 = null;
				<comp>5__3 = default(T);
				<>s__4 = null;
				<childComp>5__5 = default(T);
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_005e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0068: Expected O, but got Unknown
				try
				{
					switch (<>1__state)
					{
					default:
						return false;
					case 0:
						<>1__state = -1;
						<>s__1 = parent.GetEnumerator();
						<>1__state = -3;
						goto IL_013b;
					case 1:
						<>1__state = -3;
						goto IL_00a5;
					case 2:
						{
							<>1__state = -4;
							<childComp>5__5 = default(T);
							goto IL_010c;
						}
						IL_013b:
						if (<>s__1.MoveNext())
						{
							<child>5__2 = (Transform)<>s__1.Current;
							if (((Component)<child>5__2).TryGetComponent<T>(ref <comp>5__3))
							{
								<>2__current = <comp>5__3;
								<>1__state = 1;
								return true;
							}
							goto IL_00a5;
						}
						<>m__Finally1();
						<>s__1 = null;
						return false;
						IL_00a5:
						<>s__4 = GetComponentsInChildrenRecursive<T>(<child>5__2).GetEnumerator();
						<>1__state = -4;
						goto IL_010c;
						IL_010c:
						if (<>s__4.MoveNext())
						{
							<childComp>5__5 = (T)<>s__4.Current;
							<>2__current = <childComp>5__5;
							<>1__state = 2;
							return true;
						}
						<>m__Finally2();
						<>s__4 = null;
						<comp>5__3 = default(T);
						<child>5__2 = null;
						goto IL_013b;
					}
				}
				catch
				{
					//try-fault
					((IDisposable)this).Dispose();
					throw;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			private void <>m__Finally1()
			{
				<>1__state = -1;
				if (<>s__1 is IDisposable disposable)
				{
					disposable.Dispose();
				}
			}

			private void <>m__Finally2()
			{
				<>1__state = -3;
				if (<>s__4 is IDisposable disposable)
				{
					disposable.Dispose();
				}
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}

			[DebuggerHidden]
			IEnumerator<object> IEnumerable<object>.GetEnumerator()
			{
				<GetComponentsInChildrenRecursive>d__0<T> <GetComponentsInChildrenRecursive>d__;
				if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
				{
					<>1__state = 0;
					<GetComponentsInChildrenRecursive>d__ = this;
				}
				else
				{
					<GetComponentsInChildrenRecursive>d__ = new <GetComponentsInChildrenRecursive>d__0<T>(0);
				}
				<GetComponentsInChildrenRecursive>d__.parent = <>3__parent;
				return <GetComponentsInChildrenRecursive>d__;
			}

			[DebuggerHidden]
			IEnumerator IEnumerable.GetEnumerator()
			{
				return ((IEnumerable<object>)this).GetEnumerator();
			}
		}

		[IteratorStateMachine(typeof(<GetComponentsInChildrenRecursive>d__0<>))]
		public static IEnumerable GetComponentsInChildrenRecursive<T>(Transform parent) where T : Component
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <GetComponentsInChildrenRecursive>d__0<T>(-2)
			{
				<>3__parent = parent
			};
		}

		public static T GetComponentInChildrenRecursive<T>(Transform parent) where T : Component
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			T result = default(T);
			foreach (Transform item in parent)
			{
				Transform val = item;
				if (((Component)val).TryGetComponent<T>(ref result))
				{
					return result;
				}
				T componentInChildrenRecursive = GetComponentInChildrenRecursive<T>(val);
				if ((Object)(object)componentInChildrenRecursive != (Object)null)
				{
					return componentInChildrenRecursive;
				}
			}
			return default(T);
		}
	}
}
namespace RudeLevelScripts
{
	public class AscendingFinalRoom : MonoBehaviour
	{
		private void OnTriggerEnter(Collider other)
		{
			GameObject gameObject = ((Component)MonoSingleton<NewMovement>.instance).gameObject;
			if ((Object)(object)((Component)other).gameObject == (Object)(object)gameObject && Object.op_Implicit((Object)(object)MonoSingleton<NewMovement>.Instance) && MonoSingleton<NewMovement>.Instance.hp > 0)
			{
				FirstRoomSpawner.PlayerForcedMovement playerForcedMovement = gameObject.AddComponent<FirstRoomSpawner.PlayerForcedMovement>();
				playerForcedMovement.force = 100f;
			}
		}
	}
	public class EnemyInfoPageDataLoader : MonoBehaviour
	{
		[CompilerGenerated]
		private sealed class <LoadDataAndDestroyAsync>d__6 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public EnemyInfoPageDataLoader <>4__this;

			private AsyncOperationHandle<SpawnableObjectsDatabase> <handle>5__1;

			private List<SpawnableObject> <newEnemies>5__2;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <LoadDataAndDestroyAsync>d__6(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				<handle>5__1 = default(AsyncOperationHandle<SpawnableObjectsDatabase>);
				<newEnemies>5__2 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0053: Unknown result type (might be due to invalid IL or missing references)
				//IL_0058: Unknown result type (might be due to invalid IL or missing references)
				//IL_005f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0095: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					if (<>4__this._taskStarted)
					{
						return false;
					}
					<>4__this._taskStarted = true;
					if ((Object)(object)database == (Object)null)
					{
						<handle>5__1 = Addressables.LoadAssetAsync<SpawnableObjectsDatabase>((object)"Assets/Data/Bestiary Database.asset");
						<>2__current = <handle>5__1;
						<>1__state = 1;
						return true;
					}
					break;
				case 1:
					<>1__state = -1;
					database = <handle>5__1.Result;
					<handle>5__1 = default(AsyncOperationHandle<SpawnableObjectsDatabase>);
					break;
				}
				if ((Object)(object)<>4__this.target == (Object)null)
				{
					<>4__this.target = ((Component)<>4__this).GetComponent<EnemyInfoPage>();
				}
				<>4__this.target.objects = Object.Instantiate<SpawnableObjectsDatabase>(database);
				if (<>4__this.additionalEnemies != null && <>4__this.additionalEnemies.Count != 0)
				{
					<newEnemies>5__2 = <>4__this.target.objects.enemies.ToList();
					<newEnemies>5__2.AddRange(<>4__this.additionalEnemies);
					<>4__this.target.objects.enemies = <newEnemies>5__2.ToArray();
					<newEnemies>5__2 = null;
				}
				Object.Destroy((Object)(object)<>4__this);
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		public EnemyInfoPage target;

		public List<SpawnableObject> additionalEnemies;

		private static SpawnableObjectsDatabase database;

		private bool _taskStarted = false;

		public void Awake()
		{
			LoadDataAndDestroy();
		}

		public void LoadDataAndDestroy()
		{
			((MonoBehaviour)this).StartCoroutine(LoadDataAndDestroyAsync());
		}

		[IteratorStateMachine(typeof(<LoadDataAndDestroyAsync>d__6))]
		private IEnumerator LoadDataAndDestroyAsync()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <LoadDataAndDestroyAsync>d__6(0)
			{
				<>4__this = this
			};
		}
	}
	internal static class GameObjectExtensions
	{
		public static bool TryGetComponentInChildren<T>(this GameObject obj, out T result) where T : Component
		{
			result = obj.GetComponentInChildren<T>();
			return (Object)(object)result != (Object)null;
		}
	}
	public class FirstRoomGameControllerLoader : MonoBehaviour
	{
		public void RunAndDestroy()
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			if (((Component)this).gameObject.TryGetComponentInChildren<PlayerTracker>(out PlayerTracker result) && (Object)(object)result.platformerPlayerPrefab == (Object)null)
			{
				result.platformerPlayerPrefab = Addressables.LoadAssetAsync<GameObject>((object)"Assets/Prefabs/Player/PlatformerController.prefab").WaitForCompletion();
			}
			if (((Component)this).gameObject.TryGetComponentInChildren<SandboxSaver>(out SandboxSaver result2) && (Object)(object)result2.objects == (Object)null)
			{
				result2.objects = Addressables.LoadAssetAsync<SpawnableObjectsDatabase>((object)"Assets/Data/Sandbox/Spawnable Objects Database.asset").WaitForCompletion();
			}
			if (((Component)this).gameObject.TryGetComponentInChildren<TimeController>(out TimeController result3) && (Object)(object)result3.parryLight == (Object)null)
			{
				result3.parryLight = Addressables.LoadAssetAsync<GameObject>((object)"Assets/Particles/ParryLight.prefab").WaitForCompletion();
			}
		}
	}
}