using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Threading.Tasks; using BepInEx; using BepInEx.Bootstrap; using HarmonyLib; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using PluginConfig.API; using Steamworks; using TMPro; using UltrakillLayerConfigurator.Data; using UltrakillLayerConfigurator.Data.Layers; using UltrakillLayerConfigurator.Patches; using UltrakillLayerConfigurator.Scripts; using UltrakillModLib; using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("UltrakillLayerConfigurator")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+98ffb30681c4a473fb602eb6e0156488686dee0f")] [assembly: AssemblyProduct("UltrakillLayerConfigurator")] [assembly: AssemblyTitle("UltrakillLayerConfigurator")] [assembly: AssemblyVersion("1.0.0.0")] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace UltrakillLayerConfigurator { [BepInPlugin("net.zephyr.ultrakill.LayerConfigurator", "Menu Cleaner", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class LayerPlugin : BaseUnityPlugin { internal static DebugLog Log; private PluginConfigurator config; public const string ModName = "Zephyr's Menu Cleaner"; public const string ModPath = "net.zephyr.ultrakill.LayerConfigurator"; private const string ConfigLocationButtonName = "Open CONFIG Folder"; private const string FeedbackButtonName = "Send FEEDBACK / REPORT BUG (discord)"; public static bool isBillionNemesisInstalled; public static LayerPlugin Instance { get; private set; } public LayerPlugin() { Instance = this; CreateConfig(); } private void Awake() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown Harmony val = new Harmony("net.zephyr.ultrakill.LayerConfigurator"); val.CreateClassProcessor(typeof(ChapterSelectButtonPatch)).Patch(); val.CreateClassProcessor(typeof(DifficultySelectButtonPatch)).Patch(); val.CreateClassProcessor(typeof(GearCheckEnablerPatch)).Patch(); val.CreateClassProcessor(typeof(GetMissionName)).Patch(); if (Chainloader.PluginInfos.ContainsKey("billy.billionnemesis")) { val.CreateClassProcessor(typeof(BillionRankStuffPatch)).Patch(); } Log = new DebugLog("Zephyr's Menu Cleaner", ConsoleColor.DarkCyan, false); Log.Log("The goop is in the bag."); } private void Start() { isBillionNemesisInstalled = Chainloader.PluginInfos.ContainsKey("billy.billionnemesis"); if (isBillionNemesisInstalled) { Log.Log("BILLION NEMESIS is ACTIVE"); } foreach (string key in Chainloader.PluginInfos.Keys) { PluginInfo val = Chainloader.PluginInfos[key]; string location = val.Location; string fileName = Path.GetFileName(location); location = location.Replace(fileName, ""); if (Directory.Exists(location)) { Log.LogDebug("FILE PATH: " + location + " \n EXISTS"); string[] files = Directory.GetFiles(location, "*.json", SearchOption.AllDirectories); string[] array = files; foreach (string path in array) { JsonReader.RegisterFullPath(key, path); } } } } private void Update() { } private void SetIcon() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string text = Path.Combine(directoryName, "icon.png"); if (!string.IsNullOrEmpty(text)) { byte[] array = File.ReadAllBytes(text); if (array.Length != 0) { Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); ImageConversion.LoadImage(val, array); Sprite image = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f)); config.image = image; } } } private void CreateConfig() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007d: 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 config = PluginConfigurator.Create("Zephyr's Menu Cleaner", "net.zephyr.ultrakill.LayerConfigurator"); SetIcon(); ConfigPanel configLocationButton = new ConfigPanel(config.rootPanel, "Open CONFIG Folder", "feedback_button", (PanelFieldType)3); configLocationButton.onPannelOpenEvent += (OpenPanelEventDelegate)delegate { string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string text = Path.Combine(directoryName, "data/"); Application.OpenURL(directoryName); configLocationButton.ClosePanel(); }; ConfigPanel feedbackButton = new ConfigPanel(config.rootPanel, "Send FEEDBACK / REPORT BUG (discord)", "feedback_button", (PanelFieldType)3); feedbackButton.onPannelOpenEvent += (OpenPanelEventDelegate)delegate { Process.Start("https://discord.gg/KcsjvKa6jw"); feedbackButton.ClosePanel(); }; } private static Sprite SetUserIcon(Friend friend) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(); RawImage val2 = val.AddComponent(); SteamController.FetchAvatar(val2, friend); Texture2D val3 = FlipTexture((Texture2D)val2.texture); Sprite result = Sprite.Create(val3, new Rect(0f, 0f, (float)((Texture)val3).width, (float)((Texture)val3).height), Vector2.one * 0.5f); Object.Destroy((Object)(object)val); return result; } private static Texture2D FlipTexture(Texture2D original) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(((Texture)original).width, ((Texture)original).height); for (int i = 0; i < ((Texture)original).width; i++) { for (int j = 0; j < ((Texture)original).height; j++) { val.SetPixel(i, ((Texture)original).height - j - 1, original.GetPixel(i, j)); } } val.Apply(); return val; } } } namespace UltrakillLayerConfigurator.Scripts { public class ChapterTitle : MonoBehaviour { public List