Decompiled source of UKMDUnlocker v0.1.0

UKMDUnlocker.dll

Decompiled 11 hours ago
using System;
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 BepInEx;
using Microsoft.CodeAnalysis;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("UKMDUnlocker")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Adds ULTRAKILL MUST DIE to the difficulty selection menu.")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyInformationalVersion("0.1.0")]
[assembly: AssemblyProduct("UKMDUnlocker")]
[assembly: AssemblyTitle("UKMDUnlocker")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.0.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;
		}
	}
}
namespace UKMDUnlocker
{
	[BepInPlugin("whyis2plus2.UKMDUnlocker", "UKMDUnlocker", "0.1.0")]
	public class PluginLoader : BaseUnityPlugin
	{
		private void Awake()
		{
			SceneManager.sceneLoaded += delegate
			{
				//IL_0011: Unknown result type (might be due to invalid IL or missing references)
				//IL_0017: Expected O, but got Unknown
				if ((Object)(object)Plugin.Instance == (Object)null)
				{
					GameObject val = new GameObject();
					val.transform.SetParent((Transform)null);
					val.AddComponent<Plugin>();
				}
			};
		}
	}
	public class Plugin : MonoBehaviour
	{
		public static Plugin Instance;

		public bool Initialized;

		private void Awake()
		{
			Object.DontDestroyOnLoad((Object)(object)(Instance = this));
			MonoSingleton<PrefsManager>.Instance.propertyValidators.Clear();
			SceneManager.activeSceneChanged += OnSceneChange;
		}

		public void OnSceneChange(Scene _0, Scene _1)
		{
			//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_002b: 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_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Expected O, but got Unknown
			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e1: Expected O, but got Unknown
			string text = "b3e7f2f8052488a45b35549efb98d902";
			Scene activeScene = SceneManager.GetActiveScene();
			string name = ((Scene)(ref activeScene)).name;
			if (name == text)
			{
				activeScene = SceneManager.GetActiveScene();
				Transform val = (from obj in ((Scene)(ref activeScene)).GetRootGameObjects()
					where ((Object)obj).name == "Canvas"
					select obj).First().transform.Find("Difficulty Select (1)").Find("Interactables");
				GameObject val2 = Object.Instantiate<GameObject>(((Component)val.Find("Brutal")).gameObject, val);
				val2.GetComponent<DifficultySelectButton>().difficulty = 5;
				((Component)val2.transform.Find("Name")).GetComponent<TMP_Text>().text = "ULTRAKILL MUST DIE";
				((Transform)val2.GetComponent<RectTransform>()).position = Vector2.op_Implicit(new Vector2(30f, 157.5f));
				val2.gameObject.SetActive(true);
				val.Find("V1 Must Die").localScale = new Vector3(0f, 0f, 0f);
				GameObject ukmdInfo = Object.Instantiate<GameObject>(((Component)val.Find("Brutal Info")).gameObject, val);
				TMP_Text component = ((Component)ukmdInfo.transform.Find("Title (1)")).GetComponent<TMP_Text>();
				component.fontSize = 29f;
				component.text = "--ULTRAKILL MUST DIE--";
				((Component)ukmdInfo.transform.Find("Text")).GetComponent<TMP_Text>().text = "<color=white>Extremely aggressive enemies and very high damage.\r\n\r\nQuick reflexes and extensive knowledge of the game are expected. Any mistake made is likely to be deadly.</color>\r\n\r\n<b>Recommended only for those who are worthy.</b>";
				EventTrigger component2 = val2.GetComponent<EventTrigger>();
				component2.triggers.Clear();
				Entry val3 = new Entry
				{
					eventID = (EventTriggerType)0
				};
				((UnityEvent<BaseEventData>)(object)val3.callback).AddListener((UnityAction<BaseEventData>)delegate
				{
					ukmdInfo.SetActive(true);
				});
				Entry val4 = new Entry
				{
					eventID = (EventTriggerType)1
				};
				((UnityEvent<BaseEventData>)(object)val4.callback).AddListener((UnityAction<BaseEventData>)delegate
				{
					ukmdInfo.SetActive(false);
				});
				component2.triggers.Add(val3);
				component2.triggers.Add(val4);
			}
		}
	}
}