using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using Microsoft.CodeAnalysis; using TMPro; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyCompany("LethalOddysey.MainMenu")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("LethalOddysey.MainMenu")] [assembly: AssemblyTitle("LethalOddysey.MainMenu")] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 LethalOddysey.MainMenu { internal class EmberField : MonoBehaviour { private class Spark { public RectTransform Rect; public Image Image; public float Speed; public float DriftPhase; public float DriftSpeed; public float TwinklePhase; public float TwinkleSpeed; public float BaseAlpha; public float Width; public float Height; } private Spark[] _sparks; private RectTransform _bounds; public void Init(RectTransform bounds, Sprite sparkSprite, int count, Color[] palette) { //IL_004b: 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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: 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_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) _bounds = bounds; _sparks = new Spark[count]; for (int i = 0; i < count; i++) { GameObject val = new GameObject("Spark" + i, new Type[2] { typeof(RectTransform), typeof(Image) }); val.transform.SetParent(((Component)this).transform, false); Image component = val.GetComponent(); component.sprite = sparkSprite; ((Graphic)component).raycastTarget = false; float num = Random.Range(3f, 8f); float num2 = Random.Range(0.12f, 0.45f); Color val2 = palette[Random.Range(0, palette.Length)]; ((Graphic)component).color = new Color(val2.r, val2.g, val2.b, num2); RectTransform component2 = val.GetComponent(); component2.sizeDelta = new Vector2(num, num); Spark obj = new Spark { Rect = component2, Image = component, Speed = Random.Range(6f, 18f), DriftPhase = Random.Range(0f, (float)Math.PI * 2f), DriftSpeed = Random.Range(0.15f, 0.4f), TwinklePhase = Random.Range(0f, (float)Math.PI * 2f), TwinkleSpeed = Random.Range(0.3f, 0.9f), BaseAlpha = num2 }; Rect rect = bounds.rect; obj.Width = ((Rect)(ref rect)).width; rect = bounds.rect; obj.Height = ((Rect)(ref rect)).height; Spark spark = obj; PlaceRandom(spark, anyHeight: true); _sparks[i] = spark; } } private void PlaceRandom(Spark s, bool anyHeight) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) float num = Random.Range((0f - s.Width) * 0.5f, s.Width * 0.5f); float num2 = (anyHeight ? Random.Range((0f - s.Height) * 0.5f, s.Height * 0.5f) : ((0f - s.Height) * 0.5f - 20f)); s.Rect.anchoredPosition = new Vector2(num, num2); } private void Update() { //IL_0027: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_010b: 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_0128: Unknown result type (might be due to invalid IL or missing references) if (_sparks == null) { return; } float unscaledTime = Time.unscaledTime; Spark[] sparks = _sparks; foreach (Spark spark in sparks) { Vector2 anchoredPosition = spark.Rect.anchoredPosition; anchoredPosition.y += spark.Speed * Time.unscaledDeltaTime; anchoredPosition.x += Mathf.Sin((unscaledTime + spark.DriftPhase) * spark.DriftSpeed) * 4f * Time.unscaledDeltaTime; if (anchoredPosition.y > spark.Height * 0.5f + 20f) { anchoredPosition.y = (0f - spark.Height) * 0.5f - 20f; anchoredPosition.x = Random.Range((0f - spark.Width) * 0.5f, spark.Width * 0.5f); } spark.Rect.anchoredPosition = anchoredPosition; float num = 0.6f + 0.4f * Mathf.Sin((unscaledTime + spark.TwinklePhase) * spark.TwinkleSpeed * (float)Math.PI * 2f); Color color = ((Graphic)spark.Image).color; color.a = spark.BaseAlpha * num; ((Graphic)spark.Image).color = color; } } } internal class FadeInCanvasGroup : MonoBehaviour { public float Duration = 0.6f; private void Start() { ((MonoBehaviour)this).StartCoroutine(Fade()); } private IEnumerator Fade() { CanvasGroup cg = ((Component)this).GetComponent(); if (!((Object)(object)cg == (Object)null)) { float t = 0f; cg.alpha = 0f; while (t < Duration) { t += Time.unscaledDeltaTime; cg.alpha = Mathf.Clamp01(t / Duration); yield return null; } cg.alpha = 1f; } } } internal class MenuOverhaul : MonoBehaviour { private Canvas _canvas; private Transform _mainButtons; private Image _header; private RectTransform _selectionBox; private readonly List _menuButtons = new List(); private readonly Dictionary _labels = new Dictionary(); private Color _labelColor = new Color(0.98f, 0.55f, 0.16f); private bool _boxVisible; private RectTransform _lastHoverTarget; private MenuManager _menuManager; private TMP_FontAsset _menuFont; private float _setupRetryTimer; private bool _ready; private void Start() { TrySetup(); } private void Update() { if (!_ready) { _setupRetryTimer += Time.unscaledDeltaTime; if (_setupRetryTimer > 0.25f) { _setupRetryTimer = 0f; TrySetup(); } } } private void LateUpdate() { //IL_0064: 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_0078: Unknown result type (might be due to invalid IL or missing references) if (!_ready) { return; } if (Plugin.CfgHideVanillaLogo.Value && (Object)(object)_header != (Object)null && ((Behaviour)_header).enabled) { ((Behaviour)_header).enabled = false; } foreach (KeyValuePair label in _labels) { TextMeshProUGUI value = label.Value; if ((Object)(object)value != (Object)null && ((Graphic)value).color != _labelColor) { ((Graphic)value).color = _labelColor; } } UpdateSelectionBox(); } private void TrySetup() { GameObject val = GameObject.Find("Canvas/MenuContainer"); if ((Object)(object)val == (Object)null) { return; } _canvas = val.GetComponentInParent(); if ((Object)(object)_canvas == (Object)null) { return; } GameObject val2 = GameObject.Find("Canvas/MenuContainer/MainButtons/HeaderImage"); if (!((Object)(object)val2 == (Object)null)) { _header = val2.GetComponent(); _mainButtons = val2.transform.parent; _menuManager = Object.FindObjectOfType(); Transform obj = _mainButtons.Find("HostButton"); TextMeshProUGUI val3 = ((obj != null) ? ((Component)obj).GetComponentInChildren() : null); _menuFont = (((Object)(object)val3 != (Object)null) ? ((TMP_Text)val3).font : null); Image component = ((Component)_mainButtons).GetComponent(); if ((Object)(object)component != (Object)null) { ((Behaviour)component).enabled = false; } if (Plugin.CfgBackdrop.Value) { BuildBackdrop(); } if (Plugin.CfgTerminalHud.Value) { BuildTerminalHud(); } if (Plugin.CfgMenuAccents.Value) { ((MonoBehaviour)this).StartCoroutine(BuildAccentsWhenSettled()); } _ready = true; Plugin.Log.LogInfo((object)"Lethal Oddysey menu v2 applied."); } } private void BuildBackdrop() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0123: 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_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_0173: 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_018d: 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_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) Transform transform = ((Component)_canvas).transform; if (!((Object)(object)transform.Find("OddyseyBackdrop") != (Object)null)) { GameObject val = new GameObject("OddyseyBackdrop", new Type[2] { typeof(RectTransform), typeof(CanvasGroup) }); val.transform.SetParent(transform, false); val.transform.SetSiblingIndex(0); StretchFull(val.GetComponent()); val.AddComponent().Duration = 1f; if ((Object)(object)Plugin.BgTexture != (Object)null) { RawImage obj = ((Component)NewLayer(val.transform, "Artwork")).gameObject.AddComponent(); ((Graphic)obj).raycastTarget = false; obj.texture = (Texture)(object)Plugin.BgTexture; ((Graphic)obj).color = Color.white; obj.uvRect = CoverCropUv(Plugin.BgTexture); } else { RawImage obj2 = ((Component)NewLayer(val.transform, "Wash")).gameObject.AddComponent(); ((Graphic)obj2).raycastTarget = false; obj2.texture = (Texture)(object)TextureFactory.CreateVerticalGradient(new Color(0.07f, 0.03f, 0.01f, 1f), new Color(0.01f, 0.008f, 0.01f, 1f)); } RawImage obj3 = ((Component)NewLayer(val.transform, "Scanlines")).gameObject.AddComponent(); ((Graphic)obj3).raycastTarget = false; obj3.texture = (Texture)(object)TextureFactory.CreateScanlines(); ((Graphic)obj3).color = new Color(1f, 1f, 1f, 0.16f); Rect pixelRect = _canvas.pixelRect; float num = Mathf.Max(1f, ((Rect)(ref pixelRect)).height / 3f); obj3.uvRect = new Rect(0f, 0f, 1f, num); Image obj4 = ((Component)NewLayer(val.transform, "Vignette")).gameObject.AddComponent(); ((Graphic)obj4).raycastTarget = false; obj4.sprite = TextureFactory.ToSprite(TextureFactory.CreateVignette(512, 288, new Color(0.01f, 0.004f, 0f), 0.55f)); int num2 = Mathf.Clamp(Plugin.CfgEmberCount.Value, 0, 60); if (num2 > 0) { RectTransform val2 = NewLayer(val.transform, "Embers"); ((Component)val2).gameObject.AddComponent().Init(val2, Plugin.SoftCircle, num2, (Color[])(object)new Color[3] { Plugin.Accent, Plugin.Accent, Plugin.AccentDim }); } BuildBorder(val.transform); } } private Rect CoverCropUv(Texture2D tex) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) Rect rect = ((Component)_canvas).GetComponent().rect; float num = ((((Rect)(ref rect)).height > 1f) ? (((Rect)(ref rect)).width / ((Rect)(ref rect)).height) : 1.7777778f); float num2 = (float)((Texture)tex).width / (float)((Texture)tex).height; if (num2 > num) { float num3 = num / num2; return new Rect((1f - num3) / 2f, 0f, num3, 1f); } float num4 = num2 / num; return new Rect(0f, (1f - num4) / 2f, 1f, num4); } private void BuildBorder(Transform parent) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0072: 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_0086: 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_00ab: 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_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_014a: 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_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: 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_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0242: 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_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) RectTransform parent2 = NewLayer(parent, "Border"); Color color = default(Color); ((Color)(ref color))..ctor(Plugin.Accent.r, Plugin.Accent.g, Plugin.Accent.b, 0.55f); EdgeRect(parent2, "Top", new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(0.5f, 1f), new Vector2(0f, -9f), new Vector2(-18f, 1.6f), color); EdgeRect(parent2, "Bottom", new Vector2(0f, 0f), new Vector2(1f, 0f), new Vector2(0.5f, 0f), new Vector2(0f, 9f), new Vector2(-18f, 1.6f), color); EdgeRect(parent2, "Left", new Vector2(0f, 0f), new Vector2(0f, 1f), new Vector2(0f, 0.5f), new Vector2(9f, 0f), new Vector2(1.6f, -18f), color); EdgeRect(parent2, "Right", new Vector2(1f, 0f), new Vector2(1f, 1f), new Vector2(1f, 0.5f), new Vector2(-9f, 0f), new Vector2(1.6f, -18f), color); Color color2 = default(Color); ((Color)(ref color2))..ctor(Plugin.Accent.r, Plugin.Accent.g, Plugin.Accent.b, 0.95f); CornerMark(parent2, new Vector2(0f, 1f), new Vector2(1f, -1f), color2, 26f, 3f, 9f); CornerMark(parent2, new Vector2(1f, 1f), new Vector2(-1f, -1f), color2, 26f, 3f, 9f); CornerMark(parent2, new Vector2(0f, 0f), new Vector2(1f, 1f), color2, 26f, 3f, 9f); CornerMark(parent2, new Vector2(1f, 0f), new Vector2(-1f, 1f), color2, 26f, 3f, 9f); } private static void EdgeRect(RectTransform parent, string name, Vector2 anchorMin, Vector2 anchorMax, Vector2 pivot, Vector2 pos, Vector2 size, Color color) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_0057: 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) GameObject val = new GameObject(name, new Type[2] { typeof(RectTransform), typeof(Image) }); val.transform.SetParent((Transform)(object)parent, false); RectTransform component = val.GetComponent(); component.anchorMin = anchorMin; component.anchorMax = anchorMax; component.pivot = pivot; component.anchoredPosition = pos; component.sizeDelta = size; Image component2 = val.GetComponent(); ((Graphic)component2).color = color; ((Graphic)component2).raycastTarget = false; } private static void CornerMark(RectTransform parent, Vector2 corner, Vector2 dir, Color color, float len, float thick, float inset) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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_0012: 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_0022: 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_003c: 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_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0047: 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_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) float num = inset - 2f; EdgeRect(parent, "CornerH", corner, corner, corner, new Vector2(dir.x * num, dir.y * num), new Vector2(len, thick), color); EdgeRect(parent, "CornerV", corner, corner, corner, new Vector2(dir.x * num, dir.y * num), new Vector2(thick, len), color); } private void BuildTerminalHud() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: 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_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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) Transform transform = ((Component)_canvas).transform; if ((Object)(object)transform.Find("OddyseyHud") != (Object)null) { return; } GameObject val = new GameObject("OddyseyHud", new Type[2] { typeof(RectTransform), typeof(CanvasGroup) }); val.transform.SetParent(transform, false); val.transform.SetSiblingIndex(1); StretchFull(val.GetComponent()); val.AddComponent().Duration = 1.6f; int result = 0; GameObject obj = GameObject.Find("Canvas/MenuContainer/VersionNum"); TextMeshProUGUI val2 = ((obj != null) ? obj.GetComponent() : null); if ((Object)(object)val2 != (Object)null) { Match match = Regex.Match(((TMP_Text)val2).text ?? "", "\\d+"); if (match.Success) { int.TryParse(match.Value, out result); } } if (result == 0 && (Object)(object)GameNetworkManager.Instance != (Object)null) { result = GameNetworkManager.Instance.gameVersionNum; if (result > 9950) { result -= 9950; } } bool flag = (Object)(object)GameNetworkManager.Instance != (Object)null && GameNetworkManager.Instance.disableSteam; Color color = default(Color); ((Color)(ref color))..ctor(Plugin.Accent.r, Plugin.Accent.g, Plugin.Accent.b, 0.85f); HudText(val.transform, "TlLine1", new Vector2(0f, 1f), new Vector2(34f, -24f), "// LETHAL ODYSSEY TERMINAL", (TextAlignmentOptions)257, color); HudText(val.transform, "TlLine2", new Vector2(0f, 1f), new Vector2(34f, -41f), (result > 0) ? $"// v{result} - MAIN MENU" : "// MAIN MENU", (TextAlignmentOptions)257, color); float num = 36f; float[] array = new float[5] { 34f, 6f, 6f, 6f, 13f }; foreach (float num2 in array) { EdgeRect(val.GetComponent(), "Dash", new Vector2(0f, 1f), new Vector2(0f, 1f), new Vector2(0f, 1f), new Vector2(num, -62f), new Vector2(num2, 5f), color); num += num2 + 5f; } string text = (flag ? "> CONNECTION: LAN" : "> CONNECTION: ONLINE"); HudText(val.transform, "TrLine1", new Vector2(1f, 1f), new Vector2(-34f, -24f), text, (TextAlignmentOptions)260, color); HudText(val.transform, "TrLine2", new Vector2(1f, 1f), new Vector2(-34f, -41f), "> REGION: AUTO", (TextAlignmentOptions)260, color); } private void HudText(Transform parent, string name, Vector2 anchor, Vector2 pos, string text, TextAlignmentOptions align, Color color) { //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_0026: 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_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name, new Type[1] { typeof(RectTransform) }); val.transform.SetParent(parent, false); RectTransform component = val.GetComponent(); component.anchorMin = anchor; component.anchorMax = anchor; component.pivot = anchor; component.anchoredPosition = pos; component.sizeDelta = new Vector2(360f, 16f); TextMeshProUGUI val2 = val.AddComponent(); if ((Object)(object)_menuFont != (Object)null) { ((TMP_Text)val2).font = _menuFont; } ((TMP_Text)val2).fontSize = 11f; ((Graphic)val2).color = color; ((TMP_Text)val2).alignment = align; ((TMP_Text)val2).richText = true; ((TMP_Text)val2).text = text; ((Graphic)val2).raycastTarget = false; ((TMP_Text)val2).characterSpacing = 4f; } private IEnumerator BuildAccentsWhenSettled() { yield return (object)new WaitForSecondsRealtime(1f); if (!((Object)(object)_mainButtons == (Object)null)) { _menuButtons.Clear(); _menuButtons.AddRange(CollectMenuButtons()); CacheLabelBounds(); DisableVanillaHighlights(); BuildSeparators(); BuildSelectionBox(); } } private void CacheLabelBounds() { //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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) _labels.Clear(); foreach (RectTransform menuButton in _menuButtons) { TextMeshProUGUI componentInChildren = ((Component)menuButton).GetComponentInChildren(true); if (!((Object)(object)componentInChildren == (Object)null)) { _labels[menuButton] = componentInChildren; Color color = ((Graphic)componentInChildren).color; if (((Color)(ref color)).maxColorComponent > 0.25f) { _labelColor = ((Graphic)componentInChildren).color; } } } } private void DisableVanillaHighlights() { foreach (RectTransform menuButton in _menuButtons) { Transform val = ((Transform)menuButton).Find("SelectionHighlight"); if ((Object)(object)val != (Object)null) { ((Component)val).gameObject.SetActive(false); } } } private void BuildSeparators() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) List menuButtons = _menuButtons; if (menuButtons.Count >= 2) { float num = 0f; for (int i = 1; i < menuButtons.Count; i++) { num += menuButtons[i - 1].anchoredPosition.y - menuButtons[i].anchoredPosition.y; } num /= (float)(menuButtons.Count - 1); Color color = default(Color); ((Color)(ref color))..ctor(Plugin.Accent.r, Plugin.Accent.g, Plugin.Accent.b, 0.22f); for (int j = 0; j < menuButtons.Count; j++) { float num2 = menuButtons[j].anchoredPosition.y - ((j < menuButtons.Count - 1) ? ((menuButtons[j].anchoredPosition.y - menuButtons[j + 1].anchoredPosition.y) / 2f) : (num / 2f)); GameObject val = new GameObject("OddyseySeparator", new Type[2] { typeof(RectTransform), typeof(Image) }); val.transform.SetParent(_mainButtons, false); RectTransform component = val.GetComponent(); component.anchorMin = Vector2.zero; component.anchorMax = Vector2.zero; component.pivot = new Vector2(0f, 0.5f); component.anchoredPosition = new Vector2(26f, num2); component.sizeDelta = new Vector2(360f, 1.2f); Image component2 = val.GetComponent(); ((Graphic)component2).color = color; ((Graphic)component2).raycastTarget = false; } } } private List CollectMenuButtons() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_004c: 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) List list = new List(); foreach (Transform mainButton in _mainButtons) { Transform val = mainButton; if (((Component)val).gameObject.activeInHierarchy && !((Object)(object)((Component)val).GetComponent