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 BepInEx; using BepInEx.Bootstrap; using BepInEx.Logging; using Microsoft.CodeAnalysis; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("TitleScreenQuickAccess")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+ff867110100cd39994eddef134b703e5596719d9")] [assembly: AssemblyProduct("TitleScreenQuickAccess")] [assembly: AssemblyTitle("TitleScreenQuickAccess")] [assembly: AssemblyVersion("1.0.0.0")] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.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] [Microsoft.CodeAnalysis.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 TitleScreenQuickAccess { [BepInPlugin("com.github.end-4.titleScreenQuickAccess", "TitleScreenQuickAccess", "1.0.2")] public class Core : BaseUnityPlugin { internal class TooltipHandler : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler, IPointerClickHandler, ISelectHandler, IDeselectHandler { public string message = ""; private static GameObject? tooltipObj; private static TMP_Text? textComp; private bool hasMouse; private Vector3 prevMousePos; public void hideTooltip() { handleExit(); } private void handleEnter() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_0073: 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) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Expected O, but got Unknown //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)tooltipObj == (Object)null) { tooltipObj = new GameObject("QuickAccessTooltip"); GameObject val = GameObject.Find("Canvas"); if ((Object)(object)val != (Object)null) { tooltipObj.transform.SetParent(val.transform, false); } RectTransform val2 = tooltipObj.GetComponent(); if ((Object)(object)val2 == (Object)null) { val2 = tooltipObj.AddComponent(); } val2.pivot = new Vector2(0.5f, 0f); GameObject val3 = new GameObject("TooltipBackground"); val3.transform.SetParent(tooltipObj.transform, false); RectTransform obj = val3.AddComponent(); obj.anchorMin = Vector2.zero; obj.anchorMax = Vector2.one; obj.sizeDelta = Vector2.zero; Image val4 = val3.AddComponent(); Image component = ((Component)this).GetComponent(); if ((Object)(object)component != (Object)null) { val4.sprite = component.sprite; val4.type = component.type; val4.pixelsPerUnitMultiplier = component.pixelsPerUnitMultiplier; } ((Graphic)val4).color = new Color(1f, 1f, 1f, 1f); ((Graphic)val4).raycastTarget = false; val3.AddComponent().ignoreLayout = true; ContentSizeFitter obj2 = tooltipObj.AddComponent(); obj2.horizontalFit = (FitMode)2; obj2.verticalFit = (FitMode)2; ((LayoutGroup)tooltipObj.AddComponent()).padding = new RectOffset(15, 15, 10, 10); GameObject val5 = new GameObject("Text"); val5.transform.SetParent(tooltipObj.transform, false); textComp = (TMP_Text?)(object)val5.AddComponent(); textComp.fontSize = 20f; textComp.alignment = (TextAlignmentOptions)514; ((Graphic)textComp).raycastTarget = false; } TMP_Text componentInChildren = ((Component)this).GetComponentInChildren(true); if ((Object)(object)componentInChildren != (Object)null && (Object)(object)textComp != (Object)null) { textComp.font = componentInChildren.font; } tooltipObj.SetActive(true); textComp.text = message; } private void handleExit() { if ((Object)(object)tooltipObj != (Object)null) { tooltipObj.SetActive(false); } hasMouse = false; } private void positionTooltipHere() { //IL_0016: 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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)tooltipObj == (Object)null)) { RectTransform component = ((Component)this).GetComponent(); Rect rect = component.rect; float num = ((Rect)(ref rect)).height * (1f - component.pivot.y) + 15f; rect = component.rect; float num2 = ((Rect)(ref rect)).width * (1f - component.pivot.x) / 2f; tooltipObj.transform.position = ((Component)this).transform.position + new Vector3(num2, num, 0f); } } public void OnPointerEnter(PointerEventData eventData) { handleEnter(); hasMouse = true; } public void OnSelect(BaseEventData eventData) { handleEnter(); if (!hasMouse) { positionTooltipHere(); } } public void OnPointerExit(PointerEventData eventData) { handleExit(); } public void OnPointerClick(PointerEventData eventData) { handleExit(); } public void OnDeselect(BaseEventData eventData) { handleExit(); } private void Update() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) if (hasMouse && !(prevMousePos == Input.mousePosition)) { prevMousePos = Input.mousePosition; if ((Object)(object)tooltipObj != (Object)null && tooltipObj.activeSelf) { tooltipObj.transform.position = prevMousePos + new Vector3(0f, 40f, 0f); } } } } public static string workingPath = Assembly.GetExecutingAssembly().Location; public static string workingDir = Path.GetDirectoryName(workingPath); internal static ManualLogSource Log; public bool hasAngry; public bool hasPluginConfigurator; private void Awake() { //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: 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) Log = ((BaseUnityPlugin)this).Logger; foreach (KeyValuePair pluginInfo in Chainloader.PluginInfos) { string gUID = pluginInfo.Value.Metadata.GUID; if (!(gUID == "com.eternalUnion.angryLevelLoader")) { if (gUID == "com.eternalUnion.pluginConfigurator") { hasPluginConfigurator = true; } } else { hasAngry = true; } } SceneManager.sceneLoaded += OnSceneLoaded; Log.LogInfo((object)"TitleScreenQuickAccess loaded!"); Scene activeScene = SceneManager.GetActiveScene(); if (IsMainMenu(activeScene)) { Log.LogInfo((object)"Detected Main Menu on Awake, creating button..."); CreateQuickAccessButtons(); } } private void OnSceneLoaded(Scene scene, LoadSceneMode mode) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) Log.LogInfo((object)("Scene Loaded: " + ((Scene)(ref scene)).name + " | Path: " + ((Scene)(ref scene)).path)); if (IsMainMenu(scene)) { CreateQuickAccessButtons(); } } private bool IsMainMenu(Scene scene) { if (!(((Scene)(ref scene)).name == "Main Menu") && !(((Scene)(ref scene)).name == "b3e7f2f8052488a45b35549efb98d902")) { return ((Scene)(ref scene)).path.Contains("Main Menu"); } return true; } public static Sprite? LoadSpriteFromFile(string path, float pixelsPerUnit = 100f, Vector2? pivot = null, TextureFormat textureFormat = 4, bool mipmap = false) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_0058: 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) //IL_005d: 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_007c: Unknown result type (might be due to invalid IL or missing references) try { if (string.IsNullOrEmpty(path) || !File.Exists(path)) { return null; } byte[] array = File.ReadAllBytes(path); Texture2D val = new Texture2D(2, 2, textureFormat, mipmap); if (!ImageConversion.LoadImage(val, array)) { return null; } val.Apply(); Vector2 val2 = (Vector2)(((??)pivot) ?? new Vector2(0.5f, 0.5f)); return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), val2, pixelsPerUnit); } catch (Exception) { return null; } } private GameObject? FindNestedObject(GameObject baseObject, string path) { Transform val = baseObject.transform; string[] array = path.Split("/"); foreach (string text in array) { val = ((Component)val).transform.Find(text); if ((Object)(object)val == (Object)null) { Log.LogWarning((object)(text + " not found for object path " + ((Object)baseObject).name + "/" + path)); return null; } } return ((Component)val).gameObject; } public GameObject? FindByChildText(GameObject parent, string targetText) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown foreach (Transform item in parent.transform) { Transform val = item; TMP_Text componentInChildren = ((Component)val).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && componentInChildren.text == targetText) { return ((Component)val).gameObject; } } return null; } private GameObject CreateTitleScreenButton(string name, Vector2 offset, string tooltip = "") { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Expected O, but got Unknown GameObject gameObject = ((Component)((Component)GameObject.Find("Canvas/Main Menu (1)").transform).transform.Find("LeftSide")).gameObject; GameObject val = Object.Instantiate(((Component)gameObject.transform.Find("Options")).gameObject, gameObject.transform); ((Object)val).name = name; RectTransform component = val.GetComponent(); component.anchoredPosition += new Vector2(offset.x, offset.y + 75f); ((Behaviour)val.GetComponent()).enabled = true; val.SetActive(true); val.GetComponent