using System; using System.Collections; 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.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LethalCompanyInputUtils.Api; using Microsoft.CodeAnalysis; using MoreShipUpgrades.API; using MoreShipUpgrades.Managers; using MoreShipUpgrades.UI.TerminalNodes; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; 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("LGUGui")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("Example Dice Addon")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+8c5521e37f37e3d76518a16d04e5d1051842f105")] [assembly: AssemblyProduct("LGUGui")] [assembly: AssemblyTitle("LGUGui")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.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 LGUGui { public class IngameKeybinds : LcInputActions { [InputAction("/p", Name = "PurchaseMenu")] public InputAction PurchaseMenu { get; set; } = null; } public class MenuController : MonoBehaviour { [CompilerGenerated] private sealed class d__12 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public MenuController <>4__this; private float 5__1; private Vector3 5__2; private float 5__3; private float 5__4; private float 5__5; private float 5__6; private PlayerControllerB 5__7; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__12(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__7 = null; <>1__state = -2; } private bool MoveNext() { //IL_0079: 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_007e: 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) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = (((Object)(object)<>4__this._canvasGroup != (Object)null) ? <>4__this._canvasGroup.alpha : 1f); 5__2 = (((Object)(object)<>4__this._panelRt != (Object)null) ? ((Transform)<>4__this._panelRt).localScale : Vector3.one); 5__3 = 0f; break; case 1: <>1__state = -1; break; } if (5__3 < 0.12f) { 5__3 += Time.unscaledDeltaTime; 5__4 = Mathf.Clamp01(5__3 / 0.12f); 5__5 = 5__4 * 5__4 * 5__4; if ((Object)(object)<>4__this._canvasGroup != (Object)null) { <>4__this._canvasGroup.alpha = Mathf.Lerp(5__1, 0f, 5__5); } if ((Object)(object)<>4__this._panelRt != (Object)null) { 5__6 = Mathf.Lerp(5__2.x, 0.92f, 5__5); ((Transform)<>4__this._panelRt).localScale = new Vector3(5__6, 5__6, 1f); } <>2__current = null; <>1__state = 1; return true; } try { 5__7 = StartOfRound.Instance?.localPlayerController; if ((Object)(object)5__7 != (Object)null) { 5__7.quickMenuManager.isMenuOpen = false; } Cursor.visible = false; Cursor.lockState = (CursorLockMode)1; 5__7 = null; } catch { } IsOpen = false; try { typeof(PurchaseMenu).GetMethod("StopEmotePreview", BindingFlags.Static | BindingFlags.NonPublic)?.Invoke(null, null); } catch { } ClearPurchaseMenuStatics(); if ((Object)(object)<>4__this._root != (Object)null) { Object.Destroy((Object)(object)<>4__this._root); } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__10 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public MenuController <>4__this; private float 5__1; private float 5__2; private float 5__3; private float 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__10(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0068: 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_01a3: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this._canvasGroup.alpha = 0f; if ((Object)(object)<>4__this._panelRt != (Object)null) { ((Transform)<>4__this._panelRt).localScale = new Vector3(0.92f, 0.92f, 1f); } 5__1 = 0f; break; case 1: <>1__state = -1; break; } if (5__1 < 0.18f) { 5__1 += Time.unscaledDeltaTime; 5__2 = Mathf.Clamp01(5__1 / 0.18f); 5__3 = 1f - Mathf.Pow(1f - 5__2, 3f); <>4__this._canvasGroup.alpha = 5__3; if ((Object)(object)<>4__this._panelRt != (Object)null) { 5__4 = Mathf.Lerp(0.92f, 1f, 5__3); ((Transform)<>4__this._panelRt).localScale = new Vector3(5__4, 5__4, 1f); } <>2__current = null; <>1__state = 1; return true; } <>4__this._canvasGroup.alpha = 1f; if ((Object)(object)<>4__this._panelRt != (Object)null) { ((Transform)<>4__this._panelRt).localScale = Vector3.one; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private GameObject _root; private CanvasGroup _canvasGroup; private RectTransform _panelRt; private bool _closing; private int _frameOpenedOn = -1; public static bool IsOpen; private const float OpenDuration = 0.18f; private const float CloseDuration = 0.12f; private static readonly string[] _objectFieldsToClear = new string[2] { "_selectedEmoteForPurchase", "_previewingEmote" }; public void Init(GameObject root) { _root = root; _canvasGroup = _root.GetComponent(); if ((Object)(object)_canvasGroup == (Object)null) { _canvasGroup = _root.AddComponent(); } Transform val = _root.transform.Find("Panel"); if ((Object)(object)val != (Object)null) { _panelRt = ((Component)val).GetComponent(); } IsOpen = true; _frameOpenedOn = Time.frameCount; ((MonoBehaviour)this).StartCoroutine(AnimateOpen()); } private void Update() { if (!_closing && Time.frameCount != _frameOpenedOn) { Keyboard current = Keyboard.current; if (current != null && (((ButtonControl)current.escapeKey).wasPressedThisFrame || ((ButtonControl)current.pKey).wasPressedThisFrame)) { CloseMenu(); } } } [IteratorStateMachine(typeof(d__10))] private IEnumerator AnimateOpen() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__10(0) { <>4__this = this }; } public void CloseMenu() { if (!_closing) { _closing = true; ((MonoBehaviour)this).StartCoroutine(AnimateClose()); } } [IteratorStateMachine(typeof(d__12))] private IEnumerator AnimateClose() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__12(0) { <>4__this = this }; } private static void ClearPurchaseMenuStatics() { FieldInfo[] fields = typeof(PurchaseMenu).GetFields(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); FieldInfo[] array = fields; foreach (FieldInfo fieldInfo in array) { if (fieldInfo.IsLiteral || fieldInfo.IsInitOnly) { continue; } if (typeof(Object).IsAssignableFrom(fieldInfo.FieldType)) { fieldInfo.SetValue(null, null); continue; } for (int j = 0; j < _objectFieldsToClear.Length; j++) { if (fieldInfo.Name == _objectFieldsToClear[j]) { fieldInfo.SetValue(null, null); break; } } } } } public class MoreShipUpgradesPatch { [HarmonyPatch(typeof(LguStore), "HandleUpgradeClientRpc")] private class Patch_LGU_HandleUpgrade { private static void Postfix(string name, bool increment) { new PurchaseMenu().refresh(); } } [HarmonyPatch(typeof(CurrencyManager), "TradePlayerCreditsClientRpc")] private class Patch_LGU_HandleTrade { private static void Postfix(ulong traderClientId, int playerCreditAmount, ClientRpcParams clientRpcParams) { new PurchaseMenu().refresh(fromTrade: true); } } } [Serializable] internal class PlayerLevelData { public List suits = new List(); public List cosmetics = new List(); } internal static class PlayerLevelStore { private static PlayerLevelData _data; private static string _key; private static string SaveDir => Path.Combine(Paths.ConfigPath, "LGUPlayerLevel"); private static string CurrentKey() { string text = (((Object)(object)GameNetworkManager.Instance != (Object)null) ? GameNetworkManager.Instance.currentSaveFileName : null); return string.IsNullOrEmpty(text) ? "NoSave" : text; } private static string GetPath(string key) { return Path.Combine(SaveDir, SanitizeFileName(key) + ".json"); } private static string SanitizeFileName(string raw) { char[] invalidFileNameChars = Path.GetInvalidFileNameChars(); char[] array = raw.ToCharArray(); for (int i = 0; i < array.Length; i++) { if (Array.IndexOf(invalidFileNameChars, array[i]) >= 0) { array[i] = '_'; } } return new string(array); } public static PlayerLevelData Get() { string text = CurrentKey(); if (_data != null && _key == text) { return _data; } _key = text; string path = GetPath(text); if (File.Exists(path)) { try { _data = JsonUtility.FromJson(File.ReadAllText(path)) ?? new PlayerLevelData(); } catch { _data = new PlayerLevelData(); } } else { _data = new PlayerLevelData(); } PlayerLevelData data = _data; if (data.suits == null) { data.suits = new List(); } data = _data; if (data.cosmetics == null) { data.cosmetics = new List(); } return _data; } public static void Save() { if (_data == null) { return; } try { if (!Directory.Exists(SaveDir)) { Directory.CreateDirectory(SaveDir); } File.WriteAllText(GetPath(_key), JsonUtility.ToJson((object)_data, true)); } catch (Exception ex) { ManualLogSource customLogger = Plugin.CustomLogger; if (customLogger != null) { customLogger.LogWarning((object)("[PlayerLevelStore] save failed: " + ex.Message)); } } } public static void Reload() { _data = null; _key = null; } } public class PlayerMenuHint : MonoBehaviour { private GameObject _canvasGo; private TMP_Text _label; private void Update() { if (EnsureCanvas()) { _canvasGo.SetActive(ShouldShow()); } } private bool ShouldShow() { if (MenuController.IsOpen) { return false; } if ((Object)(object)StartOfRound.Instance == (Object)null) { return false; } PlayerControllerB localPlayerController = StartOfRound.Instance.localPlayerController; if ((Object)(object)localPlayerController == (Object)null) { return false; } if (localPlayerController.inTerminalMenu) { return false; } if (localPlayerController.isTypingChat) { return false; } if ((Object)(object)localPlayerController.quickMenuManager != (Object)null && localPlayerController.quickMenuManager.isMenuOpen) { return false; } if (Plugin.onlyInOrbit != null && Plugin.onlyInOrbit.Value && !StartOfRound.Instance.inShipPhase) { return false; } if (Plugin.onlyOnShip != null && Plugin.onlyOnShip.Value && !localPlayerController.isInHangarShipRoom) { return false; } return true; } private bool EnsureCanvas() { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Expected O, but got Unknown //IL_00ab: 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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_canvasGo != (Object)null) { return true; } if ((Object)(object)HUDManager.Instance == (Object)null || (Object)(object)HUDManager.Instance.playerScreenTexture == (Object)null) { return false; } Canvas canvas = ((Graphic)HUDManager.Instance.playerScreenTexture).canvas; if ((Object)(object)canvas == (Object)null) { return false; } _canvasGo = new GameObject("LGU_PlayerMenuHint"); _canvasGo.transform.SetParent(((Component)canvas).transform, false); RectTransform val = _canvasGo.AddComponent(); val.anchorMin = new Vector2(0.5f, 0f); val.anchorMax = new Vector2(0.5f, 0f); val.pivot = new Vector2(0.5f, 0f); val.anchoredPosition = new Vector2(0f, 120f); val.sizeDelta = new Vector2(420f, 30f); _label = (TMP_Text)(object)_canvasGo.AddComponent(); _label.text = "Press [P] for player menu"; _label.fontSize = 14f; _label.alignment = (TextAlignmentOptions)514; ((Graphic)_label).color = new Color(1f, 1f, 1f, 0.55f); ((Graphic)_label).raycastTarget = false; _label.enableWordWrapping = false; TMP_FontAsset terminalFont = UI.GetTerminalFont(); if ((Object)(object)terminalFont != (Object)null) { _label.font = terminalFont; } return true; } private void OnDestroy() { if ((Object)(object)_canvasGo != (Object)null) { Object.Destroy((Object)(object)_canvasGo); } _canvasGo = null; _label = null; } } [BepInPlugin("Slayer6409.LGU_GUI", "LGU_GUI", "0.0.4")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { private const string modGUID = "Slayer6409.LGU_GUI"; private const string modName = "LGU_GUI"; private const string modVersion = "0.0.4"; public static ManualLogSource CustomLogger; public static ConfigFile BepInExConfig; internal static IngameKeybinds Keybinds; private readonly Harmony harmony = new Harmony("Slayer6409.LGU_GUI"); public static ConfigEntry onlyInOrbit; public static ConfigEntry onlyOnShip; public static ConfigEntry extendedLog; public static ConfigEntry SuitPrice; public static ConfigEntry CosmeticPrice; public static ConfigEntry EmotePrice; private void Awake() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown CustomLogger = Logger.CreateLogSource("LateGameUpgrades GUI"); BepInExConfig = new ConfigFile(Path.Combine(Paths.ConfigPath, "LGU_GUI.cfg"), true); configSetup(); harmony.PatchAll(); Keybinds = new IngameKeybinds(); Keybinds.PurchaseMenu.performed += delegate { tryShowMenu(); }; GameObject val = new GameObject("LGU_PlayerMenuHintHost"); Object.DontDestroyOnLoad((Object)(object)val); val.AddComponent(); CustomLogger.LogInfo((object)"Plugin LGUGui is loaded! (no-bundle build)"); } public static void ExtendedLogging(string msg, LogLevel level = 16) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (extendedLog.Value) { CustomLogger.Log(level, (object)msg); } } public void configSetup() { onlyInOrbit = BepInExConfig.Bind("Main", "Only In Orbit", false, "Makes it so you are only able to upgrade in orbit."); onlyOnShip = BepInExConfig.Bind("Main", "Only On Ship", true, "Makes it so you are only able to upgrade on the ship."); extendedLog = BepInExConfig.Bind("Main", "Extended Logging", false, "Log extra debug information."); SuitPrice = BepInExConfig.Bind("Player Level - Prices", "SuitPrice", 50, "BXP cost to unlock any suit."); CosmeticPrice = BepInExConfig.Bind("Player Level - Prices", "CosmeticPrice", 25, "BXP cost to unlock any cosmetic."); EmotePrice = BepInExConfig.Bind("Player Level - Prices", "EmotePrice", 30, "BXP cost to unlock any emote."); } public void tryShowMenu() { if (!((Object)(object)StartOfRound.Instance == (Object)null) && !StartOfRound.Instance.localPlayerController.quickMenuManager.isMenuOpen && (!onlyInOrbit.Value || StartOfRound.Instance.inShipPhase) && (!onlyOnShip.Value || StartOfRound.Instance.localPlayerController.isInHangarShipRoom) && !StartOfRound.Instance.localPlayerController.inTerminalMenu && !StartOfRound.Instance.localPlayerController.isTypingChat) { PurchaseMenu.initMenu(); } } } internal static class Palette { public static readonly Color BgOverlay = new Color(0f, 0f, 0f, 0.5f); public static readonly Color BgPanel = new Color(0.08f, 0.04f, 0.04f, 0.97f); public static readonly Color BgHeader = new Color(0.18f, 0.04f, 0.04f, 1f); public static readonly Color BgRow = new Color(0.1f, 0.05f, 0.05f, 1f); public static readonly Color BgRowHover = new Color(0.2f, 0.08f, 0.06f, 1f); public static readonly Color BgInput = new Color(0.06f, 0.03f, 0.03f, 1f); public static readonly Color Separator = new Color(0.8f, 0.3f, 0.05f, 0.35f); public static readonly Color Green = new Color(0.9f, 0.35f, 0.05f, 1f); public static readonly Color Red = new Color(0.55f, 0.15f, 0.1f, 1f); public static readonly Color Cyan = new Color(1f, 0.65f, 0.1f, 1f); public static readonly Color Gold = new Color(1f, 0.8f, 0.2f, 1f); public static readonly Color CurrencyGold = new Color(1f, 0.55f, 0.1f, 1f); public static readonly Color LowCurrency = new Color(0.85f, 0.2f, 0.1f, 1f); public static readonly Color Dim = new Color(0.5f, 0.3f, 0.25f, 1f); public static readonly Color White = new Color(1f, 0.92f, 0.85f, 1f); public static readonly Color TypeSpeed = new Color(1f, 0.85f, 0.15f, 1f); public static readonly Color TypeDefense = new Color(0.3f, 0.6f, 1f, 1f); public static readonly Color TypeOffense = new Color(1f, 0.25f, 0.2f, 1f); public static readonly Color TypeStealth = new Color(0.2f, 0.9f, 0.35f, 1f); public static readonly Color TypeLoot = new Color(1f, 0.6f, 0.1f, 1f); public static readonly Color TypeTeam = new Color(0.7f, 0.4f, 1f, 1f); public static readonly Color BtnNormal = new Color(0.2f, 0.06f, 0.04f, 1f); public static readonly Color BtnHighlight = new Color(0.35f, 0.1f, 0.06f, 1f); public static readonly Color BtnActive = new Color(0.8f, 0.3f, 0.05f, 1f); public static readonly Color BtnDisabled = new Color(0.12f, 0.08f, 0.08f, 1f); public static readonly Color BtnRed = new Color(0.3f, 0.06f, 0.06f, 1f); public static readonly Color BtnRedHl = new Color(0.5f, 0.1f, 0.08f, 1f); public static readonly Color BtnBlue = new Color(0.22f, 0.08f, 0.04f, 1f); public static readonly Color BtnBlueHl = new Color(0.4f, 0.15f, 0.06f, 1f); public static Color UpgradeRow(bool hasEnough, bool maxed, bool onSale) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: 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_0018: 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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) if (maxed) { return Gold; } if (onSale) { return Cyan; } return hasEnough ? Green : Red; } } internal static class UI { [CompilerGenerated] private sealed class d__10 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public ScrollRect sr; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__10(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = null; <>1__state = 2; return true; case 2: <>1__state = -1; if ((Object)(object)sr != (Object)null) { sr.verticalNormalizedPosition = 1f; } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static GameObject _cachedLevelUpBox; private static TMP_FontAsset _terminalFont; private static AudioClip _hoverClip; private static AudioClip _confirmClip; private static AudioClip _cancelClip; private static bool _soundResolved; public static AudioSource PurchaseSource; private static AudioClip _purchaseClip; public static GameObject MakeCanvas(string name) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); Canvas val2 = val.AddComponent(); val2.renderMode = (RenderMode)0; val2.sortingOrder = 200; val2.pixelPerfect = true; CanvasScaler val3 = val.AddComponent(); val3.uiScaleMode = (ScaleMode)1; val3.referenceResolution = new Vector2(1536f, 864f); val3.matchWidthOrHeight = 0.5f; val3.referencePixelsPerUnit = 100f; val3.dynamicPixelsPerUnit = 100f; val.AddComponent(); return val; } public static GameObject MakePanel(string name, Transform parent, Color color, Vector2 anchorMin, Vector2 anchorMax, Vector2 offsetMin = default(Vector2), Vector2 offsetMax = default(Vector2)) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_001e: 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_0035: 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_0047: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent(parent, false); Image val2 = val.AddComponent(); ((Graphic)val2).color = color; RectTransform component = val.GetComponent(); component.anchorMin = anchorMin; component.anchorMax = anchorMax; component.offsetMin = offsetMin; component.offsetMax = offsetMax; return val; } public static GameObject CloneBorderedPanel(string name, Transform parent, Vector2 anchorMin, Vector2 anchorMax, Vector2 offsetMin = default(Vector2), Vector2 offsetMax = default(Vector2)) { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Expected O, but got Unknown //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0183: 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_0194: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_cachedLevelUpBox == (Object)null) { _cachedLevelUpBox = GameObject.Find("/Systems/UI/Canvas/EndgameStats/LevelUp/LevelUpBox"); if ((Object)(object)_cachedLevelUpBox == (Object)null) { _cachedLevelUpBox = GameObject.Find("/Systems/UI/Canvas/EndgameStats/Grade") ?? GameObject.Find("/Systems/UI/Canvas/EndgameStats/DaysInCompany") ?? GameObject.Find("/Systems/UI/Canvas/EndgameStats/Collected"); } } if ((Object)(object)_cachedLevelUpBox == (Object)null) { return null; } GameObject val = Object.Instantiate(_cachedLevelUpBox, parent); ((Object)val).name = name; val.SetActive(true); foreach (Transform item in val.transform) { Transform val2 = item; Object.Destroy((Object)(object)((Component)val2).gameObject); } Animator[] components = val.GetComponents(); foreach (Animator val3 in components) { Object.Destroy((Object)(object)val3); } LayoutGroup[] components2 = val.GetComponents(); foreach (LayoutGroup val4 in components2) { Object.Destroy((Object)(object)val4); } ContentSizeFitter[] components3 = val.GetComponents(); foreach (ContentSizeFitter val5 in components3) { Object.Destroy((Object)(object)val5); } RectTransform val6 = val.GetComponent(); if ((Object)(object)val6 == (Object)null) { val6 = val.AddComponent(); } val6.anchorMin = anchorMin; val6.anchorMax = anchorMax; val6.offsetMin = offsetMin; val6.offsetMax = offsetMax; ((Transform)val6).localScale = Vector3.one; ((Transform)val6).localRotation = Quaternion.identity; return val; } public static bool VanillaPanelsAvailable() { if ((Object)(object)_cachedLevelUpBox != (Object)null) { return true; } _cachedLevelUpBox = GameObject.Find("/Systems/UI/Canvas/EndgameStats/LevelUp/LevelUpBox"); if ((Object)(object)_cachedLevelUpBox == (Object)null) { _cachedLevelUpBox = GameObject.Find("/Systems/UI/Canvas/EndgameStats/Grade"); } return (Object)(object)_cachedLevelUpBox != (Object)null; } public static TMP_Text MakeText(string name, Transform parent, string text, float fontSize, Color color, TextAlignmentOptions align = 513) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0047: 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_005e: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent(parent, false); TextMeshProUGUI val2 = val.AddComponent(); TMP_FontAsset terminalFont = GetTerminalFont(); if ((Object)(object)terminalFont != (Object)null) { ((TMP_Text)val2).font = terminalFont; } ((TMP_Text)val2).text = text; ((TMP_Text)val2).fontSize = fontSize; ((Graphic)val2).color = color; ((TMP_Text)val2).alignment = align; ((Component)val2).GetComponent().anchorMin = Vector2.zero; ((Component)val2).GetComponent().anchorMax = Vector2.one; ((Component)val2).GetComponent().offsetMin = new Vector2(6f, 2f); ((Component)val2).GetComponent().offsetMax = new Vector2(-6f, -2f); return (TMP_Text)(object)val2; } public static (Button btn, TMP_Text label) MakeButton(string name, Transform parent, string text, float fontSize, Color bgColor, Color hlColor, Color textColor, Vector2 anchorMin, Vector2 anchorMax, Vector2 offsetMin = default(Vector2), Vector2 offsetMax = default(Vector2)) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: 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_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent(parent, false); Image val2 = val.AddComponent(); ((Graphic)val2).color = bgColor; RectTransform component = val.GetComponent(); component.anchorMin = anchorMin; component.anchorMax = anchorMax; component.offsetMin = offsetMin; component.offsetMax = offsetMax; Button val3 = val.AddComponent