Decompiled source of AngryLevelLoader v2.10.1
plugins/AngryLevelLoader/AngryLevelLoader.dll
Decompiled a month ago
The result has been truncated due to the large size, download it to view full contents!
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.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 Train; using UltraFunGuns; using UltraTweaker; using UltraTweaker.Tweaks; using UltraTweaker.Tweaks.Impl; using Ultrapain; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.AddressableAssets.ResourceLocators; using UnityEngine.Audio; 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.0", FrameworkDisplayName = ".NET Standard 2.0")] [assembly: AssemblyCompany("AngryLevelLoader")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Loads level made with Rude level editor")] [assembly: AssemblyFileVersion("2.10.1.0")] [assembly: AssemblyInformationalVersion("2.10.1+60fc41de87f03e7ae027f46de8db249e2e38693b")] [assembly: AssemblyProduct("AngryLevelLoader")] [assembly: AssemblyTitle("AngryLevelLoader")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.10.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 GameObject backgroundUpdater; 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() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown if (instance == null) { mainThread = Thread.CurrentThread; instance = new CrossThreadInvoker(); backgroundUpdater = new GameObject(); Object.DontDestroyOnLoad((Object)(object)backgroundUpdater); backgroundUpdater.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, "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", "2.10.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<string, string> <>9__43_0; public static Func<string, bool> <>9__46_0; public static Func<AngryBundleContainer, string> <>9__47_0; public static Func<AngryBundleContainer, string> <>9__47_1; public static Func<AngryBundleContainer, long> <>9__47_2; public static Func<AngryBundleContainer, long> <>9__47_3; public static Func<GameObject, bool> <>9__110_0; public static Func<GameObject, bool> <>9__113_0; public static FileSystemEventHandler <>9__115_0; public static RenamedEventHandler <>9__115_1; public static FileSystemEventHandler <>9__115_2; public static FileSystemEventHandler <>9__115_3; public static PostPresetChangeEvent <>9__116_0; public static Func<string, bool> <>9__116_20; public static Func<string, string> <>9__116_21; public static OpenPanelEventDelegate <>9__116_1; public static OpenPanelEventDelegate <>9__116_2; public static EnumValueChangeEventDelegate<BundleSorting> <>9__116_3; public static PostStringListValueChangeEvent <>9__116_23; public static OpenPanelEventDelegate <>9__116_4; public static OnClick <>9__116_5; public static OnClick <>9__116_6; public static KeyCodeValueChangeEventDelegate <>9__116_7; public static PostEnumValueChangeEvent<CustomLevelButtonPosition> <>9__116_8; public static PostColorValueChangeEvent <>9__116_9; public static PostColorValueChangeEvent <>9__116_10; public static PostColorValueChangeEvent <>9__116_11; public static BoolValueChangeEventDelegate <>9__116_12; public static BoolValueChangeEventDelegate <>9__116_13; public static BoolValueChangeEventDelegate <>9__116_14; public static OnClick <>9__116_17; public static Func<RudeLevelData, string> <>9__116_25; public static Func<RudeLevelData, int> <>9__116_26; public static Func<Task, bool> <>9__123_0; public static BoolValueChangeEventDelegate <>9__126_0; public static PostBoolValueChangeEvent <>9__126_1; public static UnityAction<Scene, LoadSceneMode> <>9__126_2; public static OpenPanelEventDelegate <>9__126_4; public static OpenPanelEventDelegate <>9__126_5; public static Action <>9__126_7; public static Action<bool> <>9__126_8; internal string <UpdateBundleSearch>b__43_0(string keyword) { return keyword.ToLower(); } internal bool <ScanForLevels>b__46_0(string path) { return validImageExts.Contains<string>(Path.GetExtension(path)); } internal string <SortBundles>b__47_0(AngryBundleContainer b) { return b.bundleData.bundleName; } internal string <SortBundles>b__47_1(AngryBundleContainer b) { return b.bundleData.bundleAuthor; } internal long <SortBundles>b__47_2(AngryBundleContainer b) { if (lastPlayed.TryGetValue(b.bundleData.bundleGuid, out var value)) { return value; } return 0L; } internal long <SortBundles>b__47_3(AngryBundleContainer b) { if (lastUpdate.TryGetValue(b.bundleData.bundleGuid, out var value)) { return value; } return 0L; } internal bool <CreateCustomLevelButtonOnMainMenu>b__110_0(GameObject obj) { return ((Object)obj).name == "Canvas"; } internal bool <CreateAngryUI>b__113_0(GameObject obj) { return ((Object)obj).name == "Canvas"; } internal void <InitializeFileWatcher>b__115_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__115_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__115_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__115_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__116_0(string b, string a) { UpdateAllUI(); } internal void <InitializeConfig>b__116_1(bool external) { if (newLevelToggle.value) { newLevelNotifier.text = string.Join("\n", from level in newLevelNotifierLevels.value.Split(new char[1] { '`' }) 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__116_20(string level) { return !string.IsNullOrEmpty(level); } internal string <InitializeConfig>b__116_21(string name) { return "<color=#00FF00>New level: " + name + "</color>"; } internal void <InitializeConfig>b__116_2(bool e) { ((ConfigField)newLevelNotifier).hidden = true; } internal void <InitializeConfig>b__116_3(EnumValueChangeEvent<BundleSorting> e) { bundleSortingMode.value = e.value; SortBundles(); } internal void <InitializeConfig>b__116_23(string gamemodeName, int gamemodeIndex) { difficultyField.TriggerPostDifficultyChangeEvent(); } internal void <InitializeConfig>b__116_4(bool externally) { difficultyField.TriggerPostDifficultyChangeEvent(); } internal void <InitializeConfig>b__116_5() { Application.OpenURL(levelsPath); } internal void <InitializeConfig>b__116_6() { openButtons.SetButtonInteractable(1, false); PluginUpdateHandler.CheckPluginUpdate(); } internal void <InitializeConfig>b__116_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__116_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__116_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__116_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.background).color = clr; } } internal void <InitializeConfig>b__116_11(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__116_12(BoolValueChangeEvent e) { levelUpdateNotifierToggle.value = e.value; OnlineLevelsManager.CheckLevelUpdateText(); } internal void <InitializeConfig>b__116_13(BoolValueChangeEvent e) { levelUpdateIgnoreCustomBuilds.value = e.value; OnlineLevelsManager.CheckLevelUpdateText(); } internal void <InitializeConfig>b__116_14(BoolValueChangeEvent e) { newLevelNotifierToggle.value = e.value; if (!e.value) { ((ConfigField)newLevelNotifier).hidden = true; } } internal void <InitializeConfig>b__116_17() { ScanForLevels(); } internal string <InitializeConfig>b__116_25(RudeLevelData data) { return data.uniqueIdentifier; } internal int <InitializeConfig>b__116_26(RudeLevelData d) { return d.prefferedLevelOrder; } internal bool <ProcessPendingRecords>b__123_0(Task task) { return ((ConfigField)sendPendingRecords).interactable = true; } internal void <PostAwake>b__126_0(BoolValueChangeEvent e) { if (e.value) { e.canceled = true; NotificationPanel.Open((Notification)(object)new LeaderboardPermissionNotification()); } } internal void <PostAwake>b__126_1(bool newVal) { ((ConfigField)leaderboardsDivision).hidden = newVal; } internal void <PostAwake>b__126_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) { return; } if (AngrySceneManager.isInCustomLevel) { switch (AngrySceneManager.currentBundleContainer.bundleData.bundleVersion) { case 2: LegacyPatchManager.SetLegacyPatchState(LegacyPatchState.Ver2); break; case 3: LegacyPatchManager.SetLegacyPatchState(LegacyPatchState.Ver3); break; case 4: LegacyPatchManager.SetLegacyPatchState(LegacyPatchState.Ver4); break; default: LegacyPatchManager.SetLegacyPatchState(LegacyPatchState.None); break; } } else { LegacyPatchManager.SetLegacyPatchState(LegacyPatchState.None); } } internal void <PostAwake>b__126_4(bool externally) { if (AngryLeaderboards.bannedModsListLoaded) { CheckForBannedMods(); } else { AngryLeaderboards.LoadBannedModsList(); } } internal void <PostAwake>b__126_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__DisplayClass126_0 CS$<>8__locals0 = new <>c__DisplayClass126_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__126_7() { searchBar.value = ""; } internal void <PostAwake>b__126_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__DisplayClass126_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); } } } public const string PLUGIN_NAME = "AngryLevelLoader"; public const string PLUGIN_GUID = "com.eternalUnion.angryLevelLoader"; public const string PLUGIN_VERSION = "2.10.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 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 customLevelButtonBackgroundColor; 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.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.Count != 0) { ((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.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)) { 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); } return; } catch (Exception arg) { logger.LogWarning((object)$"Exception thrown while loading level bundle: {arg}"); if (!string.IsNullOrEmpty(errorText.text)) { ConfigHeader obj = errorText; obj.text += "\n"; } ConfigHeader obj2 = errorText; obj2.text = obj2.text + "<color=red>Error loading " + Path.GetFileNameWithoutExtension(path) + "</color>. Check the logs for more information"; return; } } 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 obj3 = errorText; obj3.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); } else { bool num = !IOUtils.PathEquals(value3.pathToAngryBundle, path); value3.pathToAngryBundle = path; ((ConfigField)value3.rootPanel).interactable = true; ((ConfigField)value3.rootPanel).hidden = false; if (num) { value3.UpdateScenes(forceReload: false, lazyLoad: false); } value2.Add(value3); } } 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() { 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)); } 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() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Expected O, but got Unknown //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Expected O, but got Unknown Scene activeScene = SceneManager.GetActiveScene(); GameObject canvasObj = (from obj in ((Scene)(ref activeScene)).GetRootGameObjects() where ((Object)obj).name == "Canvas" select obj).FirstOrDefault(); if ((Object)(object)canvasObj == (Object)null) { logger.LogWarning((object)"Angry tried to create main menu buttons, but root canvas was not found!"); return; } Transform chapterSelect = canvasObj.transform.Find("Chapter Select"); if ((Object)(object)chapterSelect != (Object)null) { GameObject obj2 = Addressables.InstantiateAsync((object)"AngryLevelLoader/UI/CustomLevels.prefab", chapterSelect, false, true).WaitForCompletion(); Transform val = chapterSelect.Find("Boss Rush Button"); if ((Object)(object)val != (Object)null) { bossRushButton = ((Component)val).gameObject.GetComponent<RectTransform>(); } currentCustomLevelButton = obj2.GetComponent<AngryCustomLevelButtonComponent>(); currentCustomLevelButton.button.onClick = new ButtonClickedEvent(); ((UnityEvent)currentCustomLevelButton.button.onClick).AddListener((UnityAction)delegate { //IL_0147: Unknown result type (might be due to invalid IL or missing references) ((Component)chapterSelect).gameObject.SetActive(false); Transform val2 = canvasObj.transform.Find("OptionsMenu"); if ((Object)(object)val2 == (Object)null) { logger.LogError((object)"Angry tried to find the options menu but failed!"); ((Component)chapterSelect).gameObject.SetActive(true); } else { ((Component)val2).gameObject.SetActive(true); Transform val3 = ((Component)val2).transform.Find("Panel/PluginConfiguratorButton(Clone)"); if ((Object)(object)val3 == (Object)null) { val3 = ((Component)val2).transform.Find("Panel/PluginConfiguratorButton"); } if ((Object)(object)val3 == (Object)null) { logger.LogError((object)"Angry tried to find the plugin configurator button but failed!"); } else { Transform val4 = val2.Find("Panel"); ButtonHighlightParent val5 = default(ButtonHighlightParent); if ((Object)(object)val4 != (Object)null && ((Component)val4).gameObject.TryGetComponent<ButtonHighlightParent>(ref val5) && (val5.buttons == null || val5.buttons.Length == 0)) { val5.Start(); } ((UnityEvent)((Component)val3).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(); customLevelButtonBackgroundColor.TriggerPostValueChangeEvent(); customLevelButtonTextColor.TriggerPostValueChangeEvent(); } else { logger.LogWarning((object)"Angry tried to find chapter select menu, but root canvas was not found!"); } } private static void CreateAngryUI() { //IL_000e: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)currentPanel != (Object)null)) { 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; } currentPanel = Addressables.InstantiateAsync((object)"AngryLevelLoader/UI/AngryUIPanel.prefab", val.transform, false, true).WaitForCompletion().GetComponent<AngryUIPanelComponent>(); currentPanel.reloadBundlePrompt.MakeTransparent(true); } } 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_0636: Unknown result type (might be due to invalid IL or missing references) //IL_0641: Unknown result type (might be due to invalid IL or missing references) //IL_064b: Expected O, but got Unknown //IL_0646: Unknown result type (might be due to invalid IL or missing references) //IL_0650: 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_0683: Unknown result type (might be due to invalid IL or missing references) //IL_068d: Expected O, but got Unknown //IL_0688: Unknown result type (might be due to invalid IL or missing references) //IL_0692: Expected O, but got Unknown //IL_0669: Unknown result type (might be due to invalid IL or missing references) //IL_066e: Unknown result type (might be due to invalid IL or missing references) //IL_0674: Expected O, but got Unknown //IL_06c8: Unknown result type (might be due to invalid IL or missing references) //IL_06dc: Unknown result type (might be due to invalid IL or missing references) //IL_06f1: Unknown result type (might be due to invalid IL or missing references) //IL_0708: Unknown result type (might be due to invalid IL or missing references) //IL_0712: Expected O, but got Unknown //IL_0723: Unknown result type (might be due to invalid IL or missing references) //IL_072d: Expected O, but got Unknown //IL_07cc: Unknown result type (might be due to invalid IL or missing references) //IL_07e0: 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_0805: Expected O, but got Unknown //IL_0816: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Expected O, but got Unknown //IL_0831: Unknown result type (might be due to invalid IL or missing references) //IL_083b: Expected O, but got Unknown //IL_084c: Unknown result type (might be due to invalid IL or missing references) //IL_0856: Expected O, but got Unknown //IL_06ab: Unknown result type (might be due to invalid IL or missing references) //IL_06b0: Unknown result type (might be due to invalid IL or missing references) //IL_06b6: Expected O, but got Unknown //IL_089f: Unknown result type (might be due to invalid IL or missing references) //IL_08a9: Expected O, but got Unknown //IL_08e3: Unknown result type (might be due to invalid IL or missing references) //IL_08ed: Expected O, but got Unknown //IL_08c2: Unknown result type (might be due to invalid IL or missing references) //IL_08c7: Unknown result type (might be due to invalid IL or missing references) //IL_08cd: Expected O, but got Unknown //IL_092c: Unknown result type (might be due to invalid IL or missing references) //IL_0936: Expected O, but got Unknown //IL_0952: Unknown result type (might be due to invalid IL or missing references) //IL_095c: Expected O, but got Unknown //IL_0906: Unknown result type (might be due to invalid IL or missing references) //IL_090b: Unknown result type (might be due to invalid IL or missing references) //IL_0911: Expected O, but got Unknown //IL_0992: Unknown result type (might be due to invalid IL or missing references) //IL_09a6: Unknown result type (might be due to invalid IL or missing references) //IL_09c1: Unknown result type (might be due to invalid IL or missing references) //IL_09cb: Expected O, but got Unknown //IL_09dc: Unknown result type (might be due to invalid IL or missing references) //IL_09e6: Expected O, but got Unknown //IL_09fc: Unknown result type (might be due to invalid IL or missing references) //IL_0a06: Expected O, but got Unknown //IL_0a48: Unknown result type (might be due to invalid IL or missing references) //IL_0a4d: Unknown result type (might be due to invalid IL or missing references) //IL_0a6f: Unknown result type (might be due to invalid IL or missing references) //IL_0a79: Expected O, but got Unknown //IL_0a89: Unknown result type (might be due to invalid IL or missing references) //IL_0a9c: Unknown result type (might be due to invalid IL or missing references) //IL_0aa6: Expected O, but got Unknown //IL_0ab9: Unknown result type (might be due to invalid IL or missing references) //IL_0ac3: Expected O, but got Unknown //IL_0b04: Unknown result type (might be due to invalid IL or missing references) //IL_0b09: Unknown result type (might be due to invalid IL or missing references) //IL_0b17: Unknown result type (might be due to invalid IL or missing references) //IL_0b21: Expected O, but got Unknown //IL_0975: Unknown result type (might be due to invalid IL or missing references) //IL_097a: Unknown result type (might be due to invalid IL or missing references) //IL_0980: Expected O, but got Unknown //IL_0b60: Unknown result type (might be due to invalid IL or missing references) //IL_0b66: Expected O, but got Unknown //IL_0b3b: Unknown result type (might be due to invalid IL or missing references) //IL_0b40: Unknown result type (might be due to invalid IL or missing references) //IL_0b46: Expected O, but got Unknown //IL_0b81: Unknown result type (might be due to invalid IL or missing references) //IL_0b8e: Unknown result type (might be due to invalid IL or missing references) //IL_0b98: Expected O, but got Unknown //IL_0ba8: Unknown result type (might be due to invalid IL or missing references) //IL_0bae: Expected O, but got Unknown //IL_0bc5: Unknown result type (might be due to invalid IL or missing references) //IL_0bcf: Expected O, but got Unknown //IL_0bdf: Unknown result type (might be due to invalid IL or missing references) //IL_0bed: Unknown result type (might be due to invalid IL or missing references) //IL_0bfd: Unknown result type (might be due to invalid IL or missing references) //IL_0c07: 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_0c23: Unknown result type (might be due to invalid IL or missing references) //IL_0c2d: Expected O, but got Unknown //IL_0c34: Unknown result type (might be due to invalid IL or missing references) //IL_0c3e: Expected O, but got Unknown //IL_0c50: Unknown result type (might be due to invalid IL or missing references) //IL_0c5a: Expected O, but got Unknown //IL_0c6b: Unknown result type (might be due to invalid IL or missing references) //IL_0c75: Expected O, but got Unknown //IL_0c98: Unknown result type (might be due to invalid IL or missing references) //IL_0ca2: Expected O, but got Unknown //IL_0cb1: Unknown result type (might be due to invalid IL or missing references) //IL_0cbb: Expected O, but got Unknown //IL_0ccc: Unknown result type (might be due to invalid IL or missing references) //IL_0cd6: Expected O, but got Unknown //IL_0cdb: 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__116_0; if (obj2 == null) { PostPresetChangeEvent val = delegate { UpdateAllUI(); }; <>c.<>9__116_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__116_1; if (obj3 == null) { OpenPanelEventDelegate val2 = delegate { if (newLevelToggle.value) { newLevelNotifier.text = string.Join("\n", from level in newLevelNotifierLevels.value.Split(new char[1] { '`' }) 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__116_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__116_2; if (obj4 == null) { OpenPanelEventDelegate val3 = delegate { ((ConfigField)newLevelNotifier).hidden = true; }; <>c.<>9__116_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__116_23; if (obj9 == null) { PostStringListValueChangeEvent val5 = delegate { difficultyField.TriggerPostDifficultyChangeEvent(); }; <>c.<>9__116_23 = val5; obj9 = (object)val5; } obj8.postGamemodeChange = (PostStringListValueChangeEvent)Delegate.Combine((Delegate?)(object)postGamemodeChange, (Delegate?)obj9); ConfigPanel rootPanel2 = config.rootPanel; object obj10 = <>c.<>9__116_4; if (obj10 == null) { OpenPanelEventDelegate val6 = delegate { difficultyField.TriggerPostDifficultyChangeEvent(); }; <>c.<>9__116_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__116_5; if (obj12 == null) { OnClick val7 = delegate { Application.OpenURL(levelsPath); }; <>c.<>9__116_5 = val7; obj12 = (object)val7; } obj11.onClick += (OnClick)obj12; ButtonClickEvent obj13 = openButtons.OnClickEventHandler(1); object obj14 = <>c.<>9__116_6; if (obj14 == null) { OnClick val8 = delegate { openButtons.SetButtonInteractable(1, false); PluginUpdateHandler.CheckPluginUpdate(); }; <>c.<>9__116_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__116_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__116_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__116_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__116_9 = val11; obj18 = (object)val11; } obj17.postValueChangeEvent += (PostColorValueChangeEvent)obj18; customLevelButtonBackgroundColor = new ColorField(val10, "Custom level button background color", "s_customLevelButtonBgColor", Color.black); ColorField obj19 = customLevelButtonBackgroundColor; object obj20 = <>c.<>9__116_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.background).color = clr; } }; <>c.<>9__116_10 = val12; obj20 = (object)val12; } obj19.postValueChangeEvent += (PostColorValueChangeEvent)obj20; customLevelButtonTextColor = new ColorField(val10, "Custom level button text color", "s_customLevelButtonTextColor", Color.white); ColorField obj21 = customLevelButtonTextColor; object obj22 = <>c.<>9__116_11; if (obj22 == null) { PostColorValueChangeEvent val13 = 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__116_11 = val13; obj22 = (object)val13; } obj21.postValueChangeEvent += (PostColorValueChangeEvent)obj22; 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 obj23 = levelUpdateNotifierToggle; object obj24 = <>c.<>9__116_12; if (obj24 == null) { BoolValueChangeEventDelegate val14 = delegate(BoolValueChangeEvent e) { levelUpdateNotifierToggle.value = e.value; OnlineLevelsManager.CheckLevelUpdateText(); }; <>c.<>9__116_12 = val14; obj24 = (object)val14; } obj23.onValueChange += (BoolValueChangeEventDelegate)obj24; levelUpdateIgnoreCustomBuilds = new BoolField(settingsPanel, "Ignore updates for custom build", "s_levelUpdateIgnoreCustomBuilds", false); BoolField obj25 = levelUpdateIgnoreCustomBuilds; object obj26 = <>c.<>9__116_13; if (obj26 == null) { BoolValueChangeEventDelegate val15 = delegate(BoolValueChangeEvent e) { levelUpdateIgnoreCustomBuilds.value = e.value; OnlineLevelsManager.CheckLevelUpdateText(); }; <>c.<>9__116_13 = val15; obj26 = (object)val15; } obj25.onValueChange += (BoolValueChangeEventDelegate)obj26; 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 obj27 = newLevelNotifierToggle; object obj28 = <>c.<>9__116_14; if (obj28 == null) { BoolValueChangeEventDelegate val16 = delegate(BoolValueChangeEvent e) { newLevelNotifierToggle.value = e.value; if (!e.value) { ((ConfigField)newLevelNotifier).hidden = true; } }; <>c.<>9__116_14 = val16; obj28 = (object)val16; } obj27.onValueChange += (BoolValueChangeEventDelegate)obj28; 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(new char[1] { '\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 val17 = new ButtonField(settingsPanel, "Move Data", "s_changeDataPath"); ConfigHeader dataInfo = new ConfigHeader(settingsPanel, "<color=red>RESTART REQUIRED</color>", 18); ((ConfigField)dataInfo).hidden = true; val17.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, deleteSource: true); } Directory.Delete(tempFolderPath, recursive: true); tempFolderPath = text7; string text10 = Path.Combine(value, "MapVars"); IOUtils.TryCreateDirectory(text10); files = Directory.GetDirectories(Path.Combine(dataPath, "MapVars")); foreach (string text11 in files) { string text12 = Path.Combine(text10, Path.GetFileName(text11)); if (Directory.Exists(text12)) { Directory.Delete(text12, recursive: true); } IOUtils.DirectoryCopy(text11, text12, copySubDirs: true, deleteSource: true); } if (Directory.Exists(Path.Combine(dataPath, "MapVars"))) { Directory.Delete(Path.Combine(dataPath, "MapVars"), recursive: true); } dataInfo.text = "<color=red>RESTART REQUIRED</color>"; ((ConfigField)dataInfo).hidden = false; configDataPath.value = value; DisableAllConfig(); } } }; ButtonArrayField val18 = new ButtonArrayField(config.rootPanel, "settingsAndReload", 2, new float[2] { 0.5f, 0.5f }, new string[2] { "Settings", "Scan For Levels" }, 5f); val18.OnClickEventHandler(0).onClick += (OnClick)delegate { settingsPanel.OpenPanel(); }; ButtonClickEvent obj29 = val18.OnClickEventHandler(1); object obj30 = <>c.<>9__116_17; if (obj30 == null) { OnClick val19 = delegate { ScanForLevels(); }; <>c.<>9__116_17 = val19; obj30 = (object)val19; } obj29.onClick += (OnClick)obj30; ConfigPanel val20 = new ConfigPanel(config.rootPanel, "Developer Panel", "devPanel", (PanelFieldType)3); if (!devMode.value) { ((ConfigField)val20).hidden = true; } new ConfigHeader(val20, "Angry Server Interface", 24); ConfigDivision devDiv = new ConfigDivision(val20, "devDiv"); ButtonField val21 = new ButtonField((ConfigPanel)(object)devDiv, "Update All Bundles", "updateAllBundles"); StringField angryLevelsPath = new StringField((ConfigPanel)(object)devDiv, "Path to AngryLevels", "dev_pathToAngryLevels", "/", false); ButtonField val22 = new ButtonField((ConfigPanel)(object)devDiv, "Update Angry Levels Catalog", "updateAngryLevelsCatalog"); new ConfigHeader(val20, "Output", 18, (TextAnchor)3); ConfigHeader processInfo = new ConfigHeader(val20, "", 18, (TextAnchor)3); ConfigHeader debugInfo = new ConfigHeader(val20, "", 18, (TextAnchor)3); val21.onClick += (OnClick)async delegate { ((ConfigField)devDiv).interactable = false; processInfo.text = ""; debugInfo.text = ""; try { if (OnlineLevelsManager.catalog == null) { processInfo.text = "<color=red>Catalog is not loaded</color>"; } else { debugInfo.text = "<color=grey>Fetching existing bundles...</color>"; AngryAdmin.GetAllLevelInfoResult existingBundles = await AngryAdmin.GetAllLevelInfoTask(); if (existingBundles.networkError) { processInfo.text = "Network error, check connection"; } else if (existingBundles.httpError) { processInfo.text = "Http error, check server"; } else if (existingBundles.status != 0) { processInfo.text = $"Status error: {existingBundles.message}:{existingBundles.status}"; } else { foreach (BundleInfo bundle2 in OnlineLevelsManager.catalog.Levels) { processInfo.text = "\nChecking " + bundle2.Name + "..."; AngryAdmin.BundleLevelInfo existingBundle = existingBundles.response.result.Where((AngryAdmin.BundleLevelInfo b) => b.bundleGuid == bundle2.Guid).FirstOrDefault(); if (existingBundle == null) { ConfigHeader obj33 = debugInfo; obj33.text += "\nMissing, adding to the server"; ConfigHeader obj34 = debugInfo; obj34.text = obj34.text + "\n<color=grey>command: add_bundle " + bundle2.Guid + "</color>"; AngryAdmin.CommandResult commandResult = await AngryAdmin.SendCommand("add_bundle " + bundle2.Guid); if (commandResult.completedSuccessfully && commandResult.status == AngryAdmin.CommandStatus.OK) { ConfigHeader obj35 = debugInfo; obj35.text = obj35.text + "\n" + commandResult.response.result; } else if (commandResult.networkError) { ConfigHeader obj36 = debugInfo; obj36.text += "\n<color=red>NETWORK ERROR</color> Check conntection"; } else if (commandResult.httpError) { ConfigHeader obj37 = debugInfo; obj37.text += "\n<color=red>HTTP ERROR</color> Check server"; } else if (commandResult.response != null) { ConfigHeader obj38 = debugInfo; obj38.text += $"\n<color=red>ERROR: </color>{commandResult.message}:{commandResult.status}"; } else { ConfigHeader obj39 = debugInfo; obj39.text = obj39.text + "\n<color=red>ERROR: </color>Encountered unknown error. Status: " + commandResult.status; } } if (existingBundle == null || existingBundle.hash != bundle2.Hash) { ConfigHeader obj40 = debugInfo; obj40.text += "\nOut of date hash, updating"; ConfigHeader val26 = debugInfo; val26.text = val26.text + "\n<color=grey>command: update_leaderboard_hash " + bundle2.Guid + " " + bundle2.Hash + "</color>"; AngryAdmin.CommandResult commandResult2 = await AngryAdmin.SendCommand("update_leaderboard_hash " + bundle2.Guid + " " + bundle2.Hash); if (commandResult2.completedSuccessfully && commandResult2.status == AngryAdmin.CommandStatus.OK) {
plugins/AngryLevelLoader/AngryUiComponents.dll
Decompiled a month agousing System; using System.Collections; 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.0", FrameworkDisplayName = ".NET Standard 2.0")] [assembly: AssemblyCompany("AngryUiComponents")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+f44186ee15b885a7ceb5a6096143d437eb3e3b95")] [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 Text 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 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(); } } } 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)); } private IEnumerator ResetButtonCoroutine(Button btn, TextMeshProUGUI txt, Action cb) { ((Selectable)btn).interactable = false; for (int i = 3; i >= 1; i--) { ((TMP_Text)txt).text = $"Are you sure? ({i})"; yield return (object)new WaitForSecondsRealtime(1f); } ((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 (cb != null) { 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 { 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)); }); } private IEnumerator ResetButtonCoroutine(Button btn, TextMeshProUGUI txt, Action cb) { ((Selectable)btn).interactable = false; for (int i = 3; i >= 1; i--) { ((TMP_Text)txt).text = $"Are you sure? ({i})"; yield return (object)new WaitForSecondsRealtime(1f); } ((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 (cb != null) { 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 a month agousing 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.0", FrameworkDisplayName = ".NET Standard 2.0")] [assembly: AssemblyCompany("RudeLevelScripts.Essentials")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+f44186ee15b885a7ceb5a6096143d437eb3e3b95")] [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 a month agousing 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.0", FrameworkDisplayName = ".NET Standard 2.0")] [assembly: AssemblyCompany("AngryLoaderAPI")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+625039668297256cd56900110bac6364b13990f8")] [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 a month agousing 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.AddressableAssets.ResourceLocators; using UnityEngine.Events; using UnityEngine.ResourceManagement.ResourceLocations; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")] [assembly: AssemblyCompany("RudeLevelScripts")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+625039668297256cd56900110bac6364b13990f8")] [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_0016: 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; public float speed = 10f; public void Update() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_003c: 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) 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_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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) //IL_0033: 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_0043: 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_005b: 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) 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; [Header("Replace Settings")] [Tooltip("Enabling this field causes room to be spawned as the secret variant")] public bool secretRoom; [Tooltip("Enabling this field causes room to be spawned as the prime variant")] public bool primeRoom; [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; [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; [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; 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_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(); ((Transform)val.AddComponent<RectTransform>()).SetParent(parent); val.transform.localScale = Vector3.one; return val.AddComponent<Text>(); } private static RectTransform MakeRect(Transform parent) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) RectTransform obj = new GameObject().AddComponent<RectTransform>(); ((Transform)obj).SetParent(parent); return obj; } public static void ConvertToAscendingFirstRoom(GameObject firstRoom, AudioClip doorCloseAud, List<GameObject> toEnable, List<GameObject> toDisable, bool doNotReplace) { //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_034e: 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_036e: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_03a8: Unknown result type (might be due to invalid IL or missing references) //IL_03ae: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_03ed: Unknown result type (might be due to invalid IL or missing references) //IL_040d: Unknown result type (might be due to invalid IL or missing references) //IL_0417: Expected O, but got Unknown //IL_041d: Unknown result type (might be due to invalid IL or missing references) //IL_0427: Expected O, but got Unknown //IL_0438: Unknown result type (might be due to invalid IL or missing references) //IL_0442: Expected O, but got Unknown //IL_0442: Unknown result type (might be due to invalid IL or missing references) //IL_0447: Unknown result type (might be due to invalid IL or missing references) //IL_0462: Unknown result type (might be due to invalid IL or missing references) //IL_0477: 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_0487: Unknown result type (might be due to invalid IL or missing references) //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_04a6: Unknown result type (might be due to invalid IL or missing references) //IL_04b0: Unknown result type (might be due to invalid IL or missing references) //IL_04c6: Unknown result type (might be due to invalid IL or missing references) //IL_04d2: Unknown result type (might be due to invalid IL or missing references) //IL_04e7: Unknown result type (might be due to invalid IL or missing references) //IL_04f1: Expected O, but got Unknown //IL_04f7: Unknown result type (might be due to invalid IL or missing references) //IL_0501: Expected O, but got Unknown //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_051d: Expected O, but got Unknown //IL_052f: Unknown result type (might be due to invalid IL or missing references) //IL_0539: Expected O, but got Unknown //IL_054a: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Expected O, but got Unknown //IL_0568: Unknown result type (might be due to invalid IL or missing references) //IL_0572: Expected O, but got Unknown //IL_0578: Unknown result type (might be due to invalid IL or missing references) //IL_0582: Expected O, but got Unknown //IL_0594: Unknown result type (might be due to invalid IL or missing references) //IL_059e: Expected O, but got Unknown //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_05bd: Unknown result type (might be due to invalid IL or missing references) //IL_05c2: Unknown result type (might be due to invalid IL or missing references) //IL_05c8: Expected O, but got Unknown Transform val = firstRoom.transform.Find("Room"); if (!doNotReplace) { Transform obj = val.Find("Pit (3)"); ((Component)obj).transform.localPosition = new Vector3(0f, 2f, 41.72f); ((Component)obj).transform.localRotation = Quaternion.Euler(0f, 0f, 180f); Object.Destroy((Object)(object)((Component)((Component)val).transform.Find("Room/Ceiling")).gameObject); Transform val2 = ((Component)val).transform.Find("Room/Floor"); GameObject gameObject = ((Component)val2.GetChild(0)).gameObject; GameObject obj2 = Object.Instantiate<GameObject>(gameObject, val2); obj2.transform.localPosition = new Vector3(-15f, 9.7f, 20.28f); obj2.transform.localRotation = Quaternion.identity; GameObject obj3 = Object.Instantiate<GameObject>(gameObject, val2); obj3.transform.localPosition = new Vector3(5f, 9.7f, 20.28f); obj3.transform.localRotation = Quaternion.identity; GameObject obj4 = Object.Instantiate<GameObject>(gameObject, val2); obj4.transform.localPosition = new Vector3(-5f, 9.7f, 0.2f); obj4.transform.localRotation = Quaternion.Euler(0f, -90f, 0f); GameObject obj5 = Object.Instantiate<GameObject>(gameObject, val2); obj5.transform.localPosition = new Vector3(5f, 9.7f, 10.28f); obj5.transform.localRotation = Quaternion.identity; ((Renderer)obj5.GetComponent<MeshRenderer>()).materials = (Material[])(object)new Material[2] { Utils.metalDec20, Utils.metalDec20 }; GameObject obj6 = Object.Instantiate<GameObject>(gameObject, val2); obj6.transform.localPosition = new Vector3(-15f, 9.7f, 10.28f); obj6.transform.localRotation = Quaternion.identity; ((Renderer)obj6.GetComponent<MeshRenderer>()).materials = (Material[])(object)new Material[2] { Utils.metalDec20, Utils.metalDec20 }; GameObject obj7 = Object.Instantiate<GameObject>(gameObject, val2); obj7.transform.localPosition = new Vector3(-5f, -0.3f, 20.28f); obj7.transform.localRotation = Quaternion.Euler(0f, -90f, -180f); } Transform child = val.Find("Decorations").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 val3 = new GameObject(); val3.transform.SetParent(((Component)act).transform.parent); val3.transform.localPosition = new Vector3(0f, upDisablePos, 0f); val3.transform.localRotation = Quaternion.identity; val3.transform.localScale = new Vector3(80f, 0.2f, 80f); val3.layer = ((Component)act).gameObject.layer; ((Collider)val3.AddComponent<BoxCollider>()).isTrigger = true; ObjectActivator obj8 = val3.AddComponent<ObjectActivator>(); obj8.dontActivateOnEnable = true; obj8.oneTime = true; obj8.events = new UltrakillEvent(); obj8.events.onActivate = new UnityEvent(); obj8.events.onActivate.AddListener((UnityAction)delegate { focedMov.DestroyComp(); }); GameObject val4 = new GameObject(); val4.transform.SetParent(((Component)act).transform.parent); val4.transform.localPosition = new Vector3(0f, doorClosePos, 0f); val4.transform.localRotation = Quaternion.identity; val4.transform.localScale = new Vector3(80f, 0.2f, 80f); val4.layer = ((Component)act).gameObject.layer; ((Collider)val4.AddComponent<BoxCollider>()).isTrigger = true; ObjectActivator obj9 = val4.AddComponent<ObjectActivator>(); obj9.dontActivateOnEnable = true; obj9.oneTime = true; obj9.events = new UltrakillEvent(); obj9.events.onActivate = new UnityEvent(); obj9.events.onActivate.AddListener((UnityAction)delegate { floorMover.Activate(); }); obj9.events.onActivate.AddListener((UnityAction)delegate { floorTileAud.Play(); }); obj9.events.onActivate.AddListener((UnityAction)delegate { foreach (GameObject item in toEnable) { item.SetActive(true); } foreach (GameObject item2 in toDisable) { item2.SetActive(false); } }); ObjectActivator obj10 = val4.AddComponent<ObjectActivator>(); obj10.dontActivateOnEnable = true; obj10.oneTime = true; obj10.events = new UltrakillEvent(); obj10.events.onActivate = new UnityEvent(); obj10.events.onActivate.AddListener((UnityAction)delegate { ((Component)act).gameObject.SetActive(true); }); UnityEvent onActivate = obj10.events.onActivate; object obj11 = <>c.<>9__35_5; if (obj11 == null) { UnityAction val5 = 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 = val5; obj11 = (object)val5; } onActivate.AddListener((UnityAction)obj11); obj10.delay = actDelay; } public void Spawn() { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0110: 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_0136: 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_0149: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_0386: Unknown result type (might be due to invalid IL or missing references) //IL_0392: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Unknown result type (might be due to invalid IL or missing references) //IL_0410: Unknown result type (might be due to invalid IL or missing references) //IL_06c9: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06d7: Unknown result type (might be due to invalid IL or missing references) //IL_0707: Unknown result type (might be due to invalid IL or missing references) //IL_070c: Unknown result type (might be due to invalid IL or missing references) //IL_0715: Unknown result type (might be due to invalid IL or missing references) //IL_073a: Unknown result type (might be due to invalid IL or missing references) //IL_073f: 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_0747: Unknown result type (might be due to invalid IL or missing references) //IL_0759: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0788: Unknown result type (might be due to invalid IL or missing references) //IL_0793: Unknown result type (might be due to invalid IL or missing references) //IL_079e: Unknown result type (might be due to invalid IL or missing references) //IL_07ff: Unknown result type (might be due to invalid IL or missing references) //IL_0801: Unknown result type (might be due to invalid IL or missing references) //IL_0839: Unknown result type (might be due to invalid IL or missing references) //IL_0843: Expected O, but got Unknown //IL_0432: 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_0483: Unknown result type (might be due to invalid IL or missing references) //IL_048e: Unknown result type (might be due to invalid IL or missing references) //IL_0499: Unknown result type (might be due to invalid IL or missing references) //IL_04ae: Unknown result type (might be due to invalid IL or missing references) //IL_04b9: 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_04f8: Unknown result type (might be due to invalid IL or missing references) //IL_04fd: Unknown result type (might be due to invalid IL or missing references) //IL_04fe: Unknown result type (might be due to invalid IL or missing references) //IL_0505: 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_0522: Unknown result type (might be due to invalid IL or missing references) //IL_0534: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_0574: Unknown result type (might be due to invalid IL or missing references) //IL_0579: Unknown result type (might be due to invalid IL or missing references) //IL_057a: Unknown result type (might be due to invalid IL or missing references) //IL_0581: Unknown result type (might be due to invalid IL or missing references) //IL_0593: Unknown result type (might be due to invalid IL or missing references) //IL_059e: Unknown result type (might be due to invalid IL or missing references) //IL_05b8: Unknown result type (might be due to invalid IL or missing references) //IL_0615: 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_0635: Unknown result type (might be due to invalid IL or missing references) //IL_064a: Unknown result type (might be due to invalid IL or missing references) //IL_0655: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0674: Unknown result type (might be due to invalid IL or missing references) if (spawned) { return; } GameObject val = ((Component)this).gameObject; GameObject val2 = Utils.LoadObject<GameObject>(secretRoom ? "FirstRoom Secret" : (primeRoom ? "FirstRoom Prime" : "FirstRoom")); if (!doNotReplace) { val = Object.Instantiate<GameObject>(val2, ((Component)this).transform.parent); } else { Object.Destroy((Object)(object)((Component)Object.Instantiate<GameObject>(val2, ((Component)this).transform.position, ((Component)this).transform.rotation, ((Component)this).transform.parent).transform.Find("Room")).gameObject); } MeshCollider[] componentsInChildren = val.GetComponentsInChildren<MeshCollider>(); MeshFilter val4 = default(MeshFilter); foreach (MeshCollider val3 in componentsInChildren) { if (((Component)val3).gameObject.TryGetComponent<MeshFilter>(ref val4)) { val4.mesh = val3.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 { ((Component)val.transform.Find("Room/FinalDoor")).GetComponent<FinalDoor>(); Camera main = Camera.main; main.backgroundColor = backgroundColor; main.clearFlags = cameraFillMode; ((Component)val.transform.Find("Room/FinalDoor/FinalDoorOpener")).GetComponent<FinalDoorOpener>().startMusic = startMusic; ((Component)val.transform.Find("Room/FinalDoor")).GetComponent<FinalDoor>().levelNameOnOpen = displayLevelTitle; GameObject val5 = 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; } RectTransform val6 = MakeRect(obj); ((Object)val6).name = "Hellmap"; val5 = ((Component)val6).gameObject; Vector2 anchorMin = (val6.anchorMax = new Vector2(0.5f, 0.5f)); val6.anchorMin = anchorMin; val6.pivot = new Vector2(0.5f, 0.5f); val6.sizeDelta = new Vector2(250f, 650f); val6.anchoredPosition = Vector2.zero; ((Transform)val6).localScale = Vector3.one * 0.82244f; ((Transform)val6).SetAsFirstSibling(); RectTransform val8 = MakeRect(((Component)val6).transform); ((Object)val8).name = "Hellmap Container"; val8.anchorMin = Vector2.zero; val8.anchorMax = Vector2.one; val8.pivot = new Vector2(0.5f, 0.5f); val8.sizeDelta = Vector2.zero; val8.anchoredPosition = Vector2.zero; ((Transform)val8).localScale = Vector3.one; float num = 0f; foreach (LayerInfo layersAndLevel in layersAndLevels) { RectTransform obj2 = MakeRect((Transform)(object)val8); anchorMin = (obj2.anchorMax = new Vector2(0f, 1f)); obj2.anchorMin = anchorMin; obj2.sizeDelta = new Vector2(250f, 50f); obj2.pivot = new Vector2(0f, 1f); ((Transform)obj2).localScale = Vector3.one; obj2.anchoredPosition = new Vector2(0f, (num == 0f) ? (-3.051758E-05f) : num); num -= 50f; Text obj3 = MakeText((Transform)(object)obj2); obj3.text = layersAndLevel.layerName; obj3.fontSize = 36; obj3.font = Utils.gameFont; obj3.alignment = (TextAnchor)3; ((Graphic)obj3).color = Color.white; RectTransform component = ((Component)obj3).GetComponent<RectTransform>(); component.anchorMin = Vector2.zero; component.anchorMax = Vector2.one; component.sizeDelta = Vector2.zero; component.pivot = new Vector2(0.5f, 0.5f); ((Transform)component).localScale = Vector3.one; component.anchoredPosition = Vector2.zero; string[] layerLevels = layersAndLevel.layerLevels; foreach (string text in layerLevels) { RectTransform obj4 = MakeRect((Transform)(object)val8); anchorMin = (obj4.anchorMax = new Vector2(0f, 1f)); obj4.anchorMin = anchorMin; obj4.pivot = new Vector2(0f, 1f); ((Transform)obj4).localScale = Vector3.one; obj4.anchoredPosition = new Vector2(60f, num); obj4.sizeDelta = new Vector2(125f, 45f); num -= 50f; RectTransform obj5 = MakeRect(((Component)obj4).transform); anchorMin = (obj5.anchorMax = new Vector2(0.5f, 0.5f)); obj5.anchorMin = anchorMin; obj5.sizeDelta = new Vector2(25f, 9f); obj5.anchoredPosition = Vector2.zero; ((Transform)obj5).localScale = new Vector3(5f, 5f, 5f); Image obj6 = ((Component)obj5).gameObject.AddComponent<Image>(); obj6.type = (Type)1; obj6.sprite = Utils.levelPanel; obj6.pixelsPerUnitMultiplier = 1f; Text obj7 = MakeText(((Component)obj4).transform); obj7.text = text; obj7.font = Utils.gameFont; obj7.fontSize = 32; obj7.alignment = (TextAnchor)4; ((Graphic)obj7).color = Color.black; RectTransform component2 = ((Component)obj7).gameObject.GetComponent<RectTransform>(); component2.anchorMin = Vector2.zero; component2.anchorMax = Vector2.one; component2.pivot = new Vector2(0.5f, 0.5f); component2.sizeDelta = Vector2.zero; component2.anchoredPosition = new Vector2(0f, 0f); ((Transform)component2).localScale = Vector3.one; } } Vector2 anchoredPosition = ((Component)((Transform)val8).GetChild(GetChildIndexFromLayerAndLevel(layerIndexToStartFrom, levelIndexToStartFrom))).GetComponent<RectTransform>().anchoredPosition; ((Vector2)(ref anchoredPosition))..ctor(35f, anchoredPosition.y - 22.5f); Vector2 anchoredPosition2 = ((Component)((Transform)val8).GetChild(GetChildIndexFromLayerAndLevel(layerIndexToEndAt, levelIndexToEndAt))).GetComponent<RectTransform>().anchoredPosition; ((Vector2)(ref anchoredPosition2))..ctor(35f, anchoredPosition2.y - 22.5f); RectTransform obj8 = MakeRect((Transform)(object)val6); anchorMin = (obj8.anchorMax = new Vector2(0f, 1f)); obj8.anchorMin = anchorMin; obj8.pivot = new Vector2(0.5f, 0.5f); obj8.sizeDelta = new Vector2(35f, 35f); ((Transform)obj8).rotation = Quaternion.Euler(0f, 0f, -90f); ((Transform)obj8).localScale = Vector3.one; obj8.anchoredPosition = anchoredPosition; AudioSource val13 = ((Component)obj8).gameObject.AddComponent<AudioSource>(); val13.playOnAwake = false; val13.loop = false; val13.clip = hellmapBeepClip; val13.volume = 0.1f; Image val14 = ((Component)obj8).gameObject.AddComponent<Image>(); val14.sprite = Utils.hellmapArrow; CustomHellmapCursor customHellmapCursor = ((Component)obj8).gameObject.AddComponent<CustomHellmapCursor>(); customHellmapCursor.targetPosition = anchoredPosition2; customHellmapCursor.aud = val13; customHellmapCursor.targetImage = val14; ObjectActivator obj9 = ((Component)UnityUtils.GetComponentInChildrenRecursive<PlayerActivator>(val.transform)).gameObject.AddComponent<ObjectActivator>(); obj9.dontActivateOnEnable = true; obj9.oneTime = true; obj9.events = new UltrakillEvent(); obj9.events.toDisActivateObjects = (GameObject[])(object)new GameObject[1] { ((Component)val6).gameObject }; } if (!convertToUpwardRoom) { return; } foreach (GameObject item in upwardRoomOutOfBoundsToDisable) { item.SetActive(false); } List<GameObject> list = new List<GameObject>(); if ((Object)(object)val5 != (Object)null) { list.Add(val5); } List<GameObject> list2 = new List<GameObject>(); list2.AddRange(upwardRoomOutOfBoundsToDisable); ConvertToAscendingFirstRoom(val, upwardRoomDoorCloseClip, list2, list, doNotReplace); } catch (Exception ex) { throw ex; } finally { spawned = true; if (!doNotReplace) { Object.Destroy((Object)(object)((Component)this).gameObject); } } int GetChildIndexFromLayerAndLevel(int layer, int level) { int num2 = 0; for (int j = 0; j < layer; j++) { num2 += 1 + levelSizes[j]; } return num2 + 1 + level; } } public void Awake() { Spawn(); } } public class RudeLevelChallengeChecker : MonoBehaviour { public string targetLevelId; public UltrakillEvent onSuccess; public UltrakillEvent onFailure; 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; public UltrakillEvent OnFail; 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; public UltrakillEvent onSuccess; public UltrakillEvent onFailure; 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 ResourceLocationMap resourceMap; public static Font gameFont { get { if ((Object)(object)_gameFont == (Object)null) { _gameFont = LoadObject<Font>("Assets/Fonts/VCR_OSD_MONO_1.001.ttf"); } return _gameFont; } } public static Sprite levelPanel { get { if ((Object)(object)_levelPanel == (Object)null) { _levelPanel = LoadObject<Sprite>("Assets/Textures/UI/meter.png"); } return _levelPanel; } } public static Sprite hellmapArrow { get { if ((Object)(object)_hellmapArrow == (Object)null) { _hellmapArrow = LoadObject<Sprite>("Assets/Textures/UI/arrow.png"); } return _hellmapArrow; } } public static Material metalDec20 { get { if ((Object)(object)_metalDec20 == (Object)null) { _metalDec20 = LoadObject<Material>("Assets/Materials/Environment/Metal/Metal Decoration 20.mat"); } return _metalDec20; } } public static T LoadObject<T>(string path) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) if (resourceMap == null) { Addressables.InitializeAsync().WaitForCompletion(); IResourceLocator obj = Addressables.ResourceLocators.First(); resourceMap = (ResourceLocationMap)(object)((obj is ResourceLocationMap) ? obj : null); } Debug.Log((object)("Loading " + path)); KeyValuePair<object, IList<IResourceLocation>> keyValuePair; try { keyValuePair = resourceMap.Locations.Where((KeyValuePair<object, IList<IResourceLocation>> pair) => pair.Key as string == path).First(); } catch (Exception) { return default(T); } return Addressables.LoadAssetAsync<T>(keyValuePair.Value.First()).WaitForCompletion(); } public static void SetPlayerWorldRotation(Quaternion newRotation) { //IL_000a: 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) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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 { public static IEnumerable GetComponentsInChildrenRecursive<T>(Transform parent) where T : Component { T val = default(T); foreach (Transform item in parent) { Transform child = item; if (((Component)child).TryGetComponent<T>(ref val)) { yield return val; } foreach (T item2 in GetComponentsInChildrenRecursive<T>(child)) { yield return item2; } } } public static T GetComponentInChildrenRecursive<T>(Transform parent) where T : Component { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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) { gameObject.AddComponent<FirstRoomSpawner.PlayerForcedMovement>().force = 100f; } } } [RequireComponent(typeof(EnemyInfoPage))] public class EnemyInfoPageDataLoader : MonoBehaviour { public List<SpawnableObject> additionalEnemies; public void LoadDataAndDestroy() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) EnemyInfoPage component = ((Component)this).GetComponent<EnemyInfoPage>(); component.objects = Object.Instantiate<SpawnableObjectsDatabase>(Addressables.LoadAssetAsync<SpawnableObjectsDatabase>((object)"Assets/Data/Bestiary Database.asset").WaitForCompletion()); if (additionalEnemies != null && additionalEnemies.Count != 0) { List<SpawnableObject> list = component.objects.enemies.ToList(); list.AddRange(additionalEnemies); component.objects.enemies = list.ToArray(); } Object.Destroy((Object)(object)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_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: 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(); } } } }