using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using HarmonyLib; using MenuLib.MonoBehaviors; using MenuLib.Structs; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoMod.Cil; using MonoMod.RuntimeDetour; using TMPro; 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.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("MenuLib")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("2.5.4")] [assembly: AssemblyInformationalVersion("1.0.0+c2e5159d20b4abd71c8ea07bc75b515973d070a4")] [assembly: AssemblyProduct("MenuLib")] [assembly: AssemblyTitle("MenuLib")] [assembly: AssemblyVersion("2.5.4.0")] [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 MenuLib { [BepInPlugin("nickklmao.menulib", "Menu Lib", "2.5.4")] internal sealed class Entry : BaseUnityPlugin { [CompilerGenerated] private static class <>O { public static Action, MenuPageMain> <0>__MenuPageMain_StartHook; public static Action, MenuPageSettings> <1>__MenuPageSettings_StartHook; public static Action, MenuPageColor> <2>__MenuPageColor_StartHook; public static Action, MenuPageEsc> <3>__MenuPageEsc_StartHook; public static Action, MenuPageRegions> <4>__MenuPageRegions_StartHook; public static Action, MenuPageServerList> <5>__MenuPageServerList_StartHook; public static Action, MenuPageLobby> <6>__MenuPageLobby_StartHook; public static Manipulator <7>__SemiFunc_UIMouseHoverILHook; public static Manipulator <8>__MenuPage_StateClosingILHook; public static Manipulator <9>__ChatManager_StateInactiveILHook; } private const string MOD_NAME = "Menu Lib"; internal static readonly ManualLogSource logger = Logger.CreateLogSource("Menu Lib"); private static void MenuPageMain_StartHook(Action orig, MenuPageMain self) { orig(self); MenuAPI.mainMenuBuilderDelegate?.Invoke(((Component)self).transform); } private static void MenuPageSettings_StartHook(Action orig, MenuPageSettings self) { orig(self); MenuAPI.settingsMenuBuilderDelegate?.Invoke(((Component)self).transform); } private static void MenuPageColor_StartHook(Action orig, MenuPageColor self) { orig(self); MenuAPI.colorMenuBuilderDelegate?.Invoke(((Component)self).transform); } private static void MenuPageEsc_StartHook(Action orig, MenuPageEsc self) { orig(self); MenuAPI.escapeMenuBuilderDelegate?.Invoke(((Component)self).transform); } private static void MenuPageRegions_StartHook(Action orig, MenuPageRegions self) { orig(self); MenuAPI.regionSelectionMenuBuilderDelegate?.Invoke(((Component)self).transform); } private static void MenuPageServerList_StartHook(Action orig, MenuPageServerList self) { orig(self); MenuAPI.serverListMenuBuilderDelegate?.Invoke(((Component)self).transform); } private static void MenuPageLobby_StartHook(Action orig, MenuPageLobby self) { orig(self); MenuAPI.lobbyMenuBuilderDelegate?.Invoke(((Component)self).transform); } private static void SemiFunc_UIMouseHoverILHook(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_004e: 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_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); ILLabel val4 = default(ILLabel); val.GotoNext(new Func[1] { (Instruction instruction) => ILPatternMatchingExt.MatchBrfalse(instruction, ref val4) && ILPatternMatchingExt.MatchLdarg(val4.Target, 6) }); val.Index += 2; val.RemoveRange(27); val.Emit(OpCodes.Ldloc_0); val.EmitDelegate>((Func)delegate(MenuScrollBox menuScrollBox, Vector2 vector) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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_0034: Unknown result type (might be due to invalid IL or missing references) RectTransform val3 = (RectTransform)((Transform)menuScrollBox.scroller).parent; float y = ((Transform)val3).position.y; float num = y + val3.sizeDelta.y; return vector.y > y && vector.y < num; }); ILLabel val2 = val.DefineLabel(); val.Emit(OpCodes.Brtrue_S, (object)val2); val.Emit(OpCodes.Ldc_I4_0); val.Emit(OpCodes.Ret); val.MarkLabel(val2); } private static void MenuPage_StateClosingILHook(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext(new Func[1] { (Instruction instruction) => ILPatternMatchingExt.MatchLdfld(instruction, "stateStart") }); val.Index += 2; val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Action)delegate(MenuPage menuPage) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //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_0027: 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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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) if (MenuAPI.customMenuPages.TryGetValue(menuPage, out var value2)) { RectTransform val2 = (RectTransform)((Component)menuPage).transform; Vector2 val3 = Vector2.op_Implicit(((Transform)val2).position); Rect rect = val2.rect; float num = 0f - ((Rect)(ref rect)).height; rect = value2.rectTransform.rect; val3.y = num - ((Rect)(ref rect)).height; REPOReflection.menuPage_AnimateAwayPosition.SetValue(menuPage, val3); } }); val.GotoNext(new Func[1] { (Instruction instruction) => ILPatternMatchingExt.MatchCall(instruction, "Destroy") }); val.Index -= 5; val.RemoveRange(6); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Action)delegate(MenuPage menuPage) { if (MenuAPI.customMenuPages.TryGetValue(menuPage, out var value) && (value.isCachedPage || !value.pageWasActivatedOnce)) { ((Behaviour)menuPage).enabled = false; } else { MenuManager.instance.PageRemove(menuPage); Object.Destroy((Object)(object)((Component)menuPage).gameObject); } }); } private static void MenuScrollBox_UpdateILHook(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext(new Func[3] { (Instruction instruction) => ILPatternMatchingExt.MatchLdarg(instruction, 0), (Instruction instruction) => ILPatternMatchingExt.MatchLdarg(instruction, 0), (Instruction instruction) => ILPatternMatchingExt.MatchLdfld(instruction, "scrollHandleTargetPosition") }); int index = val.Index; val.GotoNext(new Func[1] { (Instruction instruction) => ILPatternMatchingExt.MatchCall(instruction, "Lerp") }); val.GotoPrev(new Func[1] { (Instruction instruction) => ILPatternMatchingExt.MatchStfld(instruction, "scrollHandleTargetPosition") }); int index2 = val.Index; val.Index = index; val.RemoveRange(index2 - index + 1); ILLabel val2 = val.MarkLabel(); val.GotoPrev(new Func[1] { (Instruction instruction) => instruction.OpCode == OpCodes.Brfalse_S }); val.Remove(); val.Emit(OpCodes.Brfalse_S, (object)val2); val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldfld, "parentPage"); val.EmitDelegate>((Action)delegate(MenuScrollBox menuScrollBox, MenuPage menuPage) { //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) float num3 = SemiFunc.InputMovementY() / 20f; float num4 = SemiFunc.InputScrollY(); float num7; if (MenuAPI.customMenuPages.TryGetValue(menuPage, out var value)) { float? scrollSpeed = value.scrollView.scrollSpeed; if (scrollSpeed.HasValue) { float valueOrDefault = scrollSpeed.GetValueOrDefault(); valueOrDefault *= 10f; float num5 = Mathf.Abs((float)REPOReflection.menuScrollBox_ScrollerEndPosition.GetValue(menuScrollBox) - (float)REPOReflection.menuScrollBox_ScrollerStartPosition.GetValue(menuScrollBox)); float num6 = (num3 + (float)Math.Sign(num4)) * valueOrDefault / num5; Rect rect2 = menuScrollBox.scrollBarBackground.rect; num7 = num6 * ((Rect)(ref rect2)).height; goto IL_00c1; } } float num8 = (float)REPOReflection.menuScrollBox_ScrollHeight.GetValue(menuScrollBox); num7 = num3 / (num8 * 0.01f) + num4 / (num8 * 0.01f); goto IL_00c1; IL_00c1: float num9 = (float)REPOReflection.menuScrollBox_ScrollHandleTargetPosition.GetValue(menuScrollBox); REPOReflection.menuScrollBox_ScrollHandleTargetPosition.SetValue(menuScrollBox, num9 + num7); }); val.GotoNext(new Func[1] { (Instruction instruction) => ILPatternMatchingExt.MatchStfld(instruction, "scrollAmount") }); val.Index -= 13; val.RemoveRange(14); val.EmitDelegate>((Action)delegate(MenuScrollBox instance) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_0060: 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_0075: 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_0032: 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_004e: Unknown result type (might be due to invalid IL or missing references) Rect rect; float num2; if (MenuAPI.customMenuPages.ContainsKey((MenuPage)REPOReflection.menuScrollBox_ParentPage.GetValue(instance))) { float num = ((Transform)instance.scrollHandle).localPosition.y + instance.scrollHandle.sizeDelta.y / 2f; rect = instance.scrollBarBackground.rect; num2 = num / ((Rect)(ref rect)).height; } else { float y = ((Transform)instance.scrollHandle).localPosition.y; rect = instance.scrollBarBackground.rect; num2 = y / ((Rect)(ref rect)).height * 1.1f; } REPOReflection.menuScrollBox_ScrollAmount.SetValue(instance, num2); }); } private static void ChatManager_StateInactiveILHook(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_003f: 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_005d: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func[1] { (Instruction instruction) => ILPatternMatchingExt.MatchStfld(instruction, "chatActive") }); ILLabel val2 = val.DefineLabel(); val.Emit(OpCodes.Ldsfld, "hasAnyFocus"); val.Emit(OpCodes.Brfalse_S, (object)val2); val.Emit(OpCodes.Ret); val.MarkLabel(val2); } private void Awake() { //IL_0040: 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_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_0112: 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) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: 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_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Expected O, but got Unknown //IL_0270: 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_026a: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Expected O, but got Unknown //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Expected O, but got Unknown logger.LogDebug((object)"Hooking `MenuPageMain.Start`"); new Hook((MethodBase)AccessTools.Method(typeof(MenuPageMain), "Start", (Type[])null, (Type[])null), (Delegate)new Action, MenuPageMain>(MenuPageMain_StartHook)); logger.LogDebug((object)"Hooking `MenuPageSettings.Start`"); new Hook((MethodBase)AccessTools.Method(typeof(MenuPageSettings), "Start", (Type[])null, (Type[])null), (Delegate)new Action, MenuPageSettings>(MenuPageSettings_StartHook)); logger.LogDebug((object)"Hooking `MenuPageColor.Start`"); new Hook((MethodBase)AccessTools.Method(typeof(MenuPageColor), "Start", (Type[])null, (Type[])null), (Delegate)new Action, MenuPageColor>(MenuPageColor_StartHook)); logger.LogDebug((object)"Hooking `MenuPageEsc.Start`"); new Hook((MethodBase)AccessTools.Method(typeof(MenuPageEsc), "Start", (Type[])null, (Type[])null), (Delegate)new Action, MenuPageEsc>(MenuPageEsc_StartHook)); logger.LogDebug((object)"Hooking `MenuPageRegions.Start`"); new Hook((MethodBase)AccessTools.Method(typeof(MenuPageRegions), "Start", (Type[])null, (Type[])null), (Delegate)new Action, MenuPageRegions>(MenuPageRegions_StartHook)); logger.LogDebug((object)"Hooking `MenuPageServerList.Start`"); new Hook((MethodBase)AccessTools.Method(typeof(MenuPageServerList), "Start", (Type[])null, (Type[])null), (Delegate)new Action, MenuPageServerList>(MenuPageServerList_StartHook)); logger.LogDebug((object)"Hooking `MenuPageLobby.Start`"); new Hook((MethodBase)AccessTools.Method(typeof(MenuPageLobby), "Start", (Type[])null, (Type[])null), (Delegate)new Action, MenuPageLobby>(MenuPageLobby_StartHook)); logger.LogDebug((object)"Hooking `SemiFunc.UIMouseHover`"); MethodInfo methodInfo = AccessTools.Method(typeof(SemiFunc), "UIMouseHover", (Type[])null, (Type[])null); object obj = <>O.<7>__SemiFunc_UIMouseHoverILHook; if (obj == null) { Manipulator val = SemiFunc_UIMouseHoverILHook; <>O.<7>__SemiFunc_UIMouseHoverILHook = val; obj = (object)val; } new ILHook((MethodBase)methodInfo, (Manipulator)obj); logger.LogDebug((object)"Hooking `MenuPage.StateClosing`"); MethodInfo methodInfo2 = AccessTools.Method(typeof(MenuPage), "StateClosing", (Type[])null, (Type[])null); object obj2 = <>O.<8>__MenuPage_StateClosingILHook; if (obj2 == null) { Manipulator val2 = MenuPage_StateClosingILHook; <>O.<8>__MenuPage_StateClosingILHook = val2; obj2 = (object)val2; } new ILHook((MethodBase)methodInfo2, (Manipulator)obj2); logger.LogDebug((object)"Hooking `ChatManager.StateInactive`"); MethodInfo methodInfo3 = AccessTools.Method(typeof(ChatManager), "StateInactive", (Type[])null, (Type[])null); object obj3 = <>O.<9>__ChatManager_StateInactiveILHook; if (obj3 == null) { Manipulator val3 = ChatManager_StateInactiveILHook; <>O.<9>__ChatManager_StateInactiveILHook = val3; obj3 = (object)val3; } new ILHook((MethodBase)methodInfo3, (Manipulator)obj3); } } public static class MenuAPI { public delegate void BuilderDelegate(Transform parent); internal static BuilderDelegate mainMenuBuilderDelegate; internal static BuilderDelegate settingsMenuBuilderDelegate; internal static BuilderDelegate colorMenuBuilderDelegate; internal static BuilderDelegate lobbyMenuBuilderDelegate; internal static BuilderDelegate escapeMenuBuilderDelegate; internal static BuilderDelegate regionSelectionMenuBuilderDelegate; internal static BuilderDelegate serverListMenuBuilderDelegate; internal static readonly Dictionary customMenuPages = new Dictionary(); private static MenuButtonPopUp menuButtonPopup; public static void AddElementToMainMenu(BuilderDelegate builderDelegate) { mainMenuBuilderDelegate = (BuilderDelegate)Delegate.Combine(mainMenuBuilderDelegate, builderDelegate); } public static void AddElementToSettingsMenu(BuilderDelegate builderDelegate) { settingsMenuBuilderDelegate = (BuilderDelegate)Delegate.Combine(settingsMenuBuilderDelegate, builderDelegate); } public static void AddElementToColorMenu(BuilderDelegate builderDelegate) { colorMenuBuilderDelegate = (BuilderDelegate)Delegate.Combine(colorMenuBuilderDelegate, builderDelegate); } public static void AddElementToLobbyMenu(BuilderDelegate builderDelegate) { lobbyMenuBuilderDelegate = (BuilderDelegate)Delegate.Combine(lobbyMenuBuilderDelegate, builderDelegate); } public static void AddElementToEscapeMenu(BuilderDelegate builderDelegate) { escapeMenuBuilderDelegate = (BuilderDelegate)Delegate.Combine(escapeMenuBuilderDelegate, builderDelegate); } public static void AddElementToRegionSelectionMenu(BuilderDelegate builderDelegate) { regionSelectionMenuBuilderDelegate = (BuilderDelegate)Delegate.Combine(regionSelectionMenuBuilderDelegate, builderDelegate); } public static void AddElementToServerListMenu(BuilderDelegate builderDelegate) { serverListMenuBuilderDelegate = (BuilderDelegate)Delegate.Combine(serverListMenuBuilderDelegate, builderDelegate); } public static void CloseAllPagesAddedOnTop() { MenuManager.instance.PageCloseAllAddedOnTop(); } public static void OpenPopup(string header, Color headerColor, string content, Action onLeftClicked, Action onRightClicked = null) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown //IL_0088: 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_007c: Expected O, but got Unknown if (!Object.op_Implicit((Object)(object)menuButtonPopup)) { menuButtonPopup = ((Component)MenuManager.instance).gameObject.AddComponent(); } menuButtonPopup.option1Event = new UnityEvent(); menuButtonPopup.option2Event = new UnityEvent(); if (onLeftClicked != null) { menuButtonPopup.option1Event.AddListener(new UnityAction(onLeftClicked.Invoke)); } if (onRightClicked != null) { menuButtonPopup.option2Event.AddListener(new UnityAction(onRightClicked.Invoke)); } MenuManager.instance.PagePopUpTwoOptions(menuButtonPopup, header, (LocalizedAsset)null, headerColor, content, (LocalizedAsset)null, "Yes", (LocalizedAsset)null, "No", (LocalizedAsset)null, true); } public static REPOButton CreateREPOButton(string text, Action onClick, Transform parent, Vector2 localPosition = default(Vector2)) { //IL_001d: 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) RectTransform obj = Object.Instantiate(REPOTemplates.buttonTemplate, parent); ((Object)obj).name = "Button - " + text; ((Transform)obj).localPosition = Vector2.op_Implicit(localPosition); REPOButton rEPOButton = ((Component)obj).gameObject.AddComponent(); ((TMP_Text)rEPOButton.labelTMP).text = text; rEPOButton.onClick = onClick; return rEPOButton; } public static REPOToggle CreateREPOToggle(string text, Action onToggle, Transform parent, Vector2 localPosition = default(Vector2), string leftButtonText = "ON", string rightButtonText = "OFF", bool defaultValue = false) { //IL_001d: 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) RectTransform obj = Object.Instantiate(REPOTemplates.toggleTemplate, parent); ((Object)obj).name = "Toggle - " + text; ((Transform)obj).localPosition = Vector2.op_Implicit(localPosition); REPOToggle rEPOToggle = ((Component)obj).gameObject.AddComponent(); ((TMP_Text)rEPOToggle.labelTMP).text = text; ((TMP_Text)rEPOToggle.leftButtonTMP).text = leftButtonText; ((TMP_Text)rEPOToggle.rightButtonTMP).text = rightButtonText; rEPOToggle.onToggle = onToggle; rEPOToggle.SetState(defaultValue, invokeCallback: false); return rEPOToggle; } public static REPOInputField CreateREPOInputField(string labelText, Action onValueChanged, Transform parent, Vector2 localPosition = default(Vector2), bool onlyNotifyOnSubmit = false, string placeholder = "", string defaultValue = "") { //IL_001d: 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) RectTransform obj = Object.Instantiate(REPOTemplates.toggleTemplate, parent); ((Object)obj).name = "Input Field - " + labelText; ((Transform)obj).localPosition = Vector2.op_Implicit(localPosition); REPOInputField rEPOInputField = ((Component)obj).gameObject.AddComponent(); ((TMP_Text)rEPOInputField.labelTMP).text = labelText; rEPOInputField.inputStringSystem.onValueChanged = onValueChanged; rEPOInputField.inputStringSystem.onlyNotifyOnSubmit = onlyNotifyOnSubmit; rEPOInputField.inputStringSystem.placeholder = placeholder; rEPOInputField.inputStringSystem.SetValue(defaultValue, notify: false); return rEPOInputField; } public static REPOSlider CreateREPOSlider(string text, string description, Action onValueChanged, Transform parent, Vector2 localPosition = default(Vector2), float min = 0f, float max = 1f, int precision = 2, float defaultValue = 0f, string prefix = "", string postfix = "", REPOSlider.BarBehavior barBehavior = REPOSlider.BarBehavior.UpdateWithValue) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) RectTransform obj = Object.Instantiate(REPOTemplates.sliderTemplate, parent); ((Object)obj).name = "Float Slider - " + text; ((Transform)obj).localPosition = Vector2.op_Implicit(localPosition); REPOSlider rEPOSlider = ((Component)obj).gameObject.AddComponent(); ((TMP_Text)rEPOSlider.labelTMP).text = text; ((TMP_Text)rEPOSlider.descriptionTMP).text = description; rEPOSlider.onValueChanged = onValueChanged; rEPOSlider.min = min; rEPOSlider.max = max; rEPOSlider.precision = precision; rEPOSlider.prefix = prefix; rEPOSlider.postfix = postfix; rEPOSlider.barBehavior = barBehavior; rEPOSlider.SetValue(defaultValue, invokeCallback: false); return rEPOSlider; } public static REPOSlider CreateREPOSlider(string text, string description, Action onValueChanged, Transform parent, Vector2 localPosition = default(Vector2), int min = 0, int max = 1, int defaultValue = 0, string prefix = "", string postfix = "", REPOSlider.BarBehavior barBehavior = REPOSlider.BarBehavior.UpdateWithValue) { //IL_002a: 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) RectTransform obj = Object.Instantiate(REPOTemplates.sliderTemplate, parent); ((Object)obj).name = "Int Slider - " + text; ((Transform)obj).localPosition = Vector2.op_Implicit(localPosition); REPOSlider rEPOSlider = ((Component)obj).gameObject.AddComponent(); ((TMP_Text)rEPOSlider.labelTMP).text = text; ((TMP_Text)rEPOSlider.descriptionTMP).text = description; rEPOSlider.onValueChanged = delegate(float f) { onValueChanged(Convert.ToInt32(f)); }; rEPOSlider.min = min; rEPOSlider.max = max; rEPOSlider.precision = 0; rEPOSlider.prefix = prefix; rEPOSlider.postfix = postfix; rEPOSlider.barBehavior = barBehavior; rEPOSlider.SetValue(defaultValue, invokeCallback: false); return rEPOSlider; } public static REPOSlider CreateREPOSlider(string text, string description, Action onOptionChanged, Transform parent, string[] stringOptions, string defaultOption, Vector2 localPosition = default(Vector2), string prefix = "", string postfix = "", REPOSlider.BarBehavior barBehavior = REPOSlider.BarBehavior.UpdateWithValue) { //IL_002b: 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) RectTransform val = Object.Instantiate(REPOTemplates.sliderTemplate, parent); ((Object)val).name = "Option Slider - " + text; ((Transform)val).localPosition = Vector2.op_Implicit(localPosition); REPOSlider repoSlider = ((Component)val).gameObject.AddComponent(); ((TMP_Text)repoSlider.labelTMP).text = text; ((TMP_Text)repoSlider.descriptionTMP).text = description; repoSlider.onValueChanged = delegate(float f) { onOptionChanged(repoSlider.stringOptions.ElementAtOrDefault(Convert.ToInt32(f)) ?? repoSlider.stringOptions.FirstOrDefault()); }; repoSlider.stringOptions = stringOptions; repoSlider.prefix = prefix; repoSlider.postfix = postfix; repoSlider.barBehavior = barBehavior; int num = Array.IndexOf(stringOptions, defaultOption); if (num == -1) { num = 0; } repoSlider.SetValue(num, invokeCallback: false); return repoSlider; } public static REPOSlider CreateREPOSlider(string text, string description, Action onOptionChanged, Transform parent, string[] stringOptions, string defaultOption, Vector2 localPosition = default(Vector2), string prefix = "", string postfix = "", REPOSlider.BarBehavior barBehavior = REPOSlider.BarBehavior.UpdateWithValue) { //IL_002a: 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) RectTransform obj = Object.Instantiate(REPOTemplates.sliderTemplate, parent); ((Object)obj).name = "Option Slider - " + text; ((Transform)obj).localPosition = Vector2.op_Implicit(localPosition); REPOSlider rEPOSlider = ((Component)obj).gameObject.AddComponent(); ((TMP_Text)rEPOSlider.labelTMP).text = text; ((TMP_Text)rEPOSlider.descriptionTMP).text = description; rEPOSlider.onValueChanged = delegate(float f) { onOptionChanged(Convert.ToInt32(f)); }; rEPOSlider.stringOptions = stringOptions; rEPOSlider.prefix = prefix; rEPOSlider.postfix = postfix; rEPOSlider.barBehavior = barBehavior; int num = Array.IndexOf(stringOptions, defaultOption); if (num == -1) { num = 0; } rEPOSlider.SetValue(num, invokeCallback: false); return rEPOSlider; } public static REPOLabel CreateREPOLabel(string text, Transform parent, Vector2 localPosition = default(Vector2)) { //IL_001d: 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) RectTransform obj = Object.Instantiate(REPOTemplates.labelTemplate, parent); ((Object)obj).name = "Label - " + text; ((Transform)obj).localPosition = Vector2.op_Implicit(localPosition); REPOLabel rEPOLabel = ((Component)obj).gameObject.AddComponent(); ((TMP_Text)rEPOLabel.labelTMP).text = text; return rEPOLabel; } public static REPOSpacer CreateREPOSpacer(Transform parent, Vector2 localPosition = default(Vector2), Vector2 size = default(Vector2)) { //IL_0018: 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_0027: 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_003a: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) RectTransform val = (RectTransform)new GameObject("Spacer", new Type[1] { typeof(RectTransform) }).transform; ((Transform)val).SetParent(parent); REPOSpacer result = ((Component)val).gameObject.AddComponent(); ((Transform)val).localPosition = Vector2.op_Implicit(localPosition); val.sizeDelta = size; return result; } [Obsolete("Switch to the overload with the 'shouldCachePage' argument!")] public static REPOPopupPage CreateREPOPopupPage(string headerText, REPOPopupPage.PresetSide presetSide, bool pageDimmerVisibility = false, float spacing = 0f) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) return CreateREPOPopupPage(headerText, pageDimmerVisibility, spacing, (presetSide == REPOPopupPage.PresetSide.Left) ? null : new Vector2?(new Vector2(40f, 0f))); } [Obsolete("Switch to the overload with the 'shouldCachePage' argument!")] public static REPOPopupPage CreateREPOPopupPage(string headerText, bool pageDimmerVisibility = false, float spacing = 0f, Vector2? localPosition = null) { return CreateREPOPopupPage(headerText, shouldCachePage: false, pageDimmerVisibility, spacing, localPosition); } public static REPOPopupPage CreateREPOPopupPage(string headerText, REPOPopupPage.PresetSide presetSide, bool shouldCachePage, bool pageDimmerVisibility = false, float spacing = 0f) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) return CreateREPOPopupPage(headerText, shouldCachePage, pageDimmerVisibility, spacing, (presetSide == REPOPopupPage.PresetSide.Left) ? null : new Vector2?(new Vector2(40f, 0f))); } public static REPOPopupPage CreateREPOPopupPage(string headerText, bool shouldCachePage, bool pageDimmerVisibility = false, float spacing = 0f, Vector2? localPosition = null) { //IL_0054: 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_0059: Unknown result type (might be due to invalid IL or missing references) RectTransform obj = Object.Instantiate(REPOTemplates.popupPageTemplate, ((Component)MenuHolder.instance).transform); ((Object)obj).name = "Menu Page " + headerText; REPOPopupPage rEPOPopupPage = ((Component)obj).gameObject.AddComponent(); ((Transform)rEPOPopupPage.rectTransform).localPosition = Vector2.op_Implicit((Vector2)(((??)localPosition) ?? new Vector2(-280f, 0f))); ((TMP_Text)rEPOPopupPage.headerTMP).text = headerText; rEPOPopupPage.isCachedPage = shouldCachePage; rEPOPopupPage.pageDimmerVisibility = pageDimmerVisibility; rEPOPopupPage.scrollView.spacing = spacing; return rEPOPopupPage; } public static REPOAvatarPreview CreateREPOAvatarPreview(Transform parent, Vector2 localPosition = default(Vector2), bool enableBackgroundImage = false, Color? backgroundImageColor = null) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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) Transform obj = Object.Instantiate(REPOTemplates.avatarPreviewTemplate, parent); ((Object)obj).name = "Player Avatar Preview"; REPOAvatarPreview rEPOAvatarPreview = ((Component)obj).gameObject.AddComponent(); ((Transform)rEPOAvatarPreview.rectTransform).localPosition = Vector2.op_Implicit(localPosition); rEPOAvatarPreview.enableBackgroundImage = enableBackgroundImage; rEPOAvatarPreview.backgroundImageColor = (Color)(((??)backgroundImageColor) ?? Color.white); rEPOAvatarPreview.previewSize = new Vector2(184f, 345f); return rEPOAvatarPreview; } public static REPOObjectPreview CreateREPOObjectPreview(Transform parent, GameObject previewObject, Vector2 localPosition = default(Vector2), bool enableBackgroundImage = false, Color? backgroundImageColor = null) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_006a: Unknown result type (might be due to invalid IL or missing references) Transform obj = Object.Instantiate(REPOTemplates.avatarPreviewTemplate, parent); ((Object)obj).name = "Object Preview"; REPOObjectPreview rEPOObjectPreview = ((Component)obj).gameObject.AddComponent(); ((Transform)rEPOObjectPreview.rectTransform).localPosition = Vector2.op_Implicit(localPosition); rEPOObjectPreview.enableBackgroundImage = enableBackgroundImage; rEPOObjectPreview.backgroundImageColor = (Color)(((??)backgroundImageColor) ?? Color.white); rEPOObjectPreview.previewObject = previewObject; rEPOObjectPreview.previewSize = new Vector2(184f, 345f); return rEPOObjectPreview; } internal static void OpenMenuPage(MenuPage menuPage, bool pageOnTop) { //IL_00cd: Unknown result type (might be due to invalid IL or missing references) object? value = REPOReflection.menuManager_CurrentMenuPage.GetValue(MenuManager.instance); MenuPage val = (MenuPage)((value is MenuPage) ? value : null); List list = REPOReflection.menuManager_AddedPagesOnTop.GetValue(MenuManager.instance) as List; if (pageOnTop && !Object.op_Implicit((Object)(object)val)) { pageOnTop = false; } if (pageOnTop) { if (list == null || list.Contains(val)) { return; } } else if (Object.op_Implicit((Object)(object)val)) { REPOReflection.menuManager_PageInactiveAdd.Invoke(MenuManager.instance, new object[1] { val }); val.PageStateSet((PageState)3); } ((Component)menuPage).transform.SetAsLastSibling(); ((Behaviour)menuPage).enabled = true; menuPage.ResetPage(); menuPage.PageStateSet((PageState)0); MenuManager.instance.PageAdd(menuPage); ((MonoBehaviour)menuPage).StartCoroutine(REPOReflection.menuPage_LateStart.Invoke(menuPage, null) as IEnumerator); REPOReflection.menuPage_AddedPageOnTop.SetValue(menuPage, pageOnTop); if (!pageOnTop) { MenuManager.instance.PageSetCurrent(menuPage.menuPageIndex, menuPage); REPOReflection.menuPage_PageIsOnTopOfOtherPage.SetValue(menuPage, true); REPOReflection.menuPage_PageUnderThisPage.SetValue(menuPage, val); } else { REPOReflection.menuPage_ParentPage.SetValue(menuPage, val); list.Add(menuPage); } } internal static void CloseMenuPage(MenuPage menuPage, bool closePagesAddedOnTop) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (closePagesAddedOnTop) { CloseAllPagesAddedOnTop(); } menuPage.PageStateSet((PageState)2); object? value = REPOReflection.menuPage_PageUnderThisPage.GetValue(menuPage); MenuPage val = (MenuPage)((value is MenuPage) ? value : null); if (val != null) { MenuManager.instance.PageSetCurrent(val.menuPageIndex, val); } } } public static class REPOReflection { public static readonly FieldInfo menuManager_CurrentMenuPage = AccessTools.Field(typeof(MenuManager), "currentMenuPage"); public static readonly FieldInfo menuManager_AddedPagesOnTop = AccessTools.Field(typeof(MenuManager), "addedPagesOnTop"); public static readonly FieldInfo menuPage_AddedPageOnTop = AccessTools.Field(typeof(MenuPage), "addedPageOnTop"); public static readonly FieldInfo menuPage_PageUnderThisPage = AccessTools.Field(typeof(MenuPage), "pageUnderThisPage"); public static readonly FieldInfo menuPage_ParentPage = AccessTools.Field(typeof(MenuPage), "parentPage"); public static readonly FieldInfo menuPage_PageIsOnTopOfOtherPage = AccessTools.Field(typeof(MenuPage), "pageIsOnTopOfOtherPage"); public static readonly FieldInfo menuPage_ScrollBoxes = AccessTools.Field(typeof(MenuPage), "scrollBoxes"); public static readonly FieldInfo menuPage_CurrentPageState = AccessTools.Field(typeof(MenuPage), "currentPageState"); public static readonly FieldInfo menuPage_AnimateAwayPosition = AccessTools.Field(typeof(MenuPage), "animateAwayPosition"); public static readonly FieldInfo menuButton_ParentPage = AccessTools.Field(typeof(MenuButton), "parentPage"); public static readonly FieldInfo menuScrollBox_ScrollerEndPosition = AccessTools.Field(typeof(MenuScrollBox), "scrollerEndPosition"); public static readonly FieldInfo menuScrollBox_ScrollerStartPosition = AccessTools.Field(typeof(MenuScrollBox), "scrollerStartPosition"); public static readonly FieldInfo menuScrollBox_ScrollHandleTargetPosition = AccessTools.Field(typeof(MenuScrollBox), "scrollHandleTargetPosition"); public static readonly FieldInfo menuScrollBox_ScrollHeight = AccessTools.Field(typeof(MenuScrollBox), "scrollHeight"); public static readonly FieldInfo menuScrollBox_ScrollAmount = AccessTools.Field(typeof(MenuScrollBox), "scrollAmount"); public static readonly FieldInfo menuScrollBox_ParentPage = AccessTools.Field(typeof(MenuScrollBox), "parentPage"); public static readonly FieldInfo menuSelectableElement_MenuID = AccessTools.Field(typeof(MenuSelectableElement), "menuID"); public static readonly MethodInfo menuManager_PageInactiveAdd = AccessTools.Method(typeof(MenuManager), "PageInactiveAdd", (Type[])null, (Type[])null); public static readonly MethodInfo menuPage_LateStart = AccessTools.Method(typeof(MenuPage), "LateStart", (Type[])null, (Type[])null); } internal static class REPOTemplates { internal static readonly RectTransform pageDimmerTemplate; internal static readonly RectTransform simplePageTemplate; internal static readonly RectTransform buttonTemplate; internal static readonly RectTransform popupPageTemplate; internal static readonly RectTransform toggleTemplate; internal static readonly RectTransform sliderTemplate; internal static readonly RectTransform labelTemplate; internal static readonly Transform avatarPreviewTemplate; static REPOTemplates() { //IL_003b: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected I4, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Expected O, but got Unknown //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Expected O, but got Unknown //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Expected O, but got Unknown MenuManager instance = MenuManager.instance; if (!Object.op_Implicit((Object)(object)instance)) { throw new NullReferenceException("Error fetching templates... Ensure you're not creating UI elements too early, use \"MenuAPI.AddElementTo...\""); } foreach (MenuPages menuPage in instance.menuPages) { Transform transform = menuPage.menuPage.transform; MenuPageIndex menuPageIndex = menuPage.menuPageIndex; switch ((int)menuPageIndex) { case 0: simplePageTemplate = (RectTransform)transform; buttonTemplate = (RectTransform)((Transform)simplePageTemplate).Find("Buttons/Menu Button - Quit game"); break; case 2: pageDimmerTemplate = (RectTransform)transform.GetChild(0); break; case 4: popupPageTemplate = (RectTransform)transform; break; case 5: { Transform obj = transform.Find("Menu Scroll Box/Mask/Scroller"); toggleTemplate = (RectTransform)obj.Find("Bool Setting - Push to Talk"); sliderTemplate = (RectTransform)obj.Find("Slider - microphone"); break; } case 6: labelTemplate = (RectTransform)transform.Find("Scroll Box/Mask/Scroller").Find("Header Movement"); break; case 1: avatarPreviewTemplate = transform.Find("Menu Element Player Avatar"); break; } } } } } namespace MenuLib.Structs { public struct Padding { public float left; public float top; public float right; public float bottom; public Padding(float left, float top, float right, float bottom) { this.left = left; this.top = top; this.right = right; this.bottom = bottom; } } } namespace MenuLib.MonoBehaviors { public sealed class REPOAvatarPreview : REPOElement { private PlayerAvatarMenu playerAvatarMenu; private Image backgroundImage; private RectTransform renderTextureRectTransform; public bool enableBackgroundImage { get { return ((Behaviour)backgroundImage).enabled; } set { ((Behaviour)backgroundImage).enabled = value; } } public Color backgroundImageColor { get { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return ((Graphic)backgroundImage).color; } set { //IL_0006: Unknown result type (might be due to invalid IL or missing references) ((Graphic)backgroundImage).color = value; } } public Vector2 previewSize { get { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return base.rectTransform.sizeDelta; } set { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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_002c: 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_000e: 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_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_0060: Unknown result type (might be due to invalid IL or missing references) Vector2 val; if (value.x > value.y) { val = value; val.y = value.x / (8f / 15f); value = val; } else { val = value; val.x = value.y * (8f / 15f); value = val; } RectTransform obj = renderTextureRectTransform; val = (base.rectTransform.sizeDelta = value); obj.sizeDelta = val; ((Transform)renderTextureRectTransform).localPosition = Vector3.zero; } } public PlayerAvatarVisuals playerAvatarVisuals { get; private set; } public Transform rigTransform => playerAvatarVisuals.meshParent.transform; private void Awake() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown //IL_007b: Unknown result type (might be due to invalid IL or missing references) LocalizationChangedEvent[] componentsInChildren = ((Component)this).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].localizedAsset = null; } base.rectTransform = ((Component)this).gameObject.AddComponent(); base.rectTransform.pivot = Vector2.right; RectTransform obj = base.rectTransform; Vector2 anchorMin = (base.rectTransform.anchorMax = Vector2.zero); obj.anchorMin = anchorMin; renderTextureRectTransform = (RectTransform)((Transform)base.rectTransform).GetChild(1); ((Transform)renderTextureRectTransform).localPosition = Vector3.zero; playerAvatarMenu = ((Component)this).GetComponentInChildren().playerAvatarMenu; playerAvatarVisuals = ((Component)playerAvatarMenu).GetComponentInChildren(); backgroundImage = ((Component)this).gameObject.AddComponent(); ((Behaviour)backgroundImage).enabled = false; } private void OnDestroy() { if (Object.op_Implicit((Object)(object)playerAvatarMenu)) { if (Object.op_Implicit((Object)(object)playerAvatarMenu.cameraAndStuff)) { Object.Destroy((Object)(object)((Component)playerAvatarMenu.cameraAndStuff).gameObject); } Object.Destroy((Object)(object)((Component)playerAvatarMenu).gameObject); } } } public sealed class REPOButton : REPOElement { public MenuButton menuButton; public TextMeshProUGUI labelTMP; [Obsolete("Update the button clicked event using the 'onClick' field rather than through the button")] public Button button; public Action onClick; public Vector2? overrideButtonSize; private string previousText; private float previousFontSize; private float previousFontSizeMin; private float previousFontSizeMax; private Vector2? previousOverrideButtonSize; public Vector2 GetLabelSize() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return ((TMP_Text)labelTMP).GetPreferredValues(); } private void Awake() { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown LocalizationChangedEvent[] componentsInChildren = ((Component)this).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].localizedAsset = null; } Transform transform = ((Component)this).transform; base.rectTransform = (RectTransform)(object)((transform is RectTransform) ? transform : null); button = ((Component)this).GetComponent