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 BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using ComputerysModdingUtilities; using DG.Tweening; using DG.Tweening.Core; using DG.Tweening.Plugins.Options; using HarmonyLib; using Microsoft.CodeAnalysis; using ModMenu.Api; using ModMenu.Behaviours.ModList; using ModMenu.Behaviours.OptionList; using ModMenu.Behaviours.OptionList.Dummies; using ModMenu.Behaviours.OptionList.ValueControllers; using ModMenu.Mods; using ModMenu.Options; using ModMenu.Patches; using ModMenu.Utils; using Newtonsoft.Json; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: StraftatMod(true)] [assembly: AssemblyVersion("0.0.0.0")] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace ModMenu { internal static class ModMenuManager { public static Mod[] mods; public static void Init() { Dictionary.ValueCollection values = Chainloader.PluginInfos.Values; List list = new List(); foreach (PluginInfo item in values) { ModInfo modInfo = default(ModInfo); modInfo.guid = item.Metadata.GUID; modInfo.name = item.Metadata.Name; modInfo.version = item.Metadata.Version.ToString(); ModInfo info = modInfo; list.Add(new Mod(info)); } mods = list.ToArray(); } } public static class PluginInfo { public const string guid = "kestrel.straftat.modmenu"; public const string name = "ModMenu"; public const string version = "1.1.5"; } [BepInPlugin("kestrel.straftat.modmenu", "ModMenu", "1.1.5")] public class Plugin : BaseUnityPlugin { private enum TestEnum { OptionA, OptionB, OptionC, OptionD, AndSoOn } private enum TestEnum2 { AnotherTestEnum, IsntThisCool, HeyHiiiiHeyLookAtMe, ColonThree } internal static ManualLogSource Logger; private static ConfigEntry m_superSecretConfigEntry; public static readonly string loadBearingColonThree = ":3"; public static Plugin Instance { get; private set; } private void Awake() { //IL_0073: Unknown result type (might be due to invalid IL or missing references) if (loadBearingColonThree != ":3") { Application.Quit(); } ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; Instance = this; Logger = ((BaseUnityPlugin)this).Logger; CreateExampleConfigs(); Assets.Init(); ModMenuCustomisation.RegisterContentBuilder(CustomContentBuilder); ModMenuCustomisation.HideEntry((ConfigEntryBase)(object)m_superSecretConfigEntry); ModMenuCustomisation.SetPluginDescription("Configure your mods ingame!"); ModMenuCustomisation.SetPluginIcon(Assets.ModMenuModIcon); new Harmony("kestrel.straftat.modmenu").PatchAll(); Logger.LogInfo((object)"Hiiiiiiiiiiii :3"); } private void CreateExampleConfigs() { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Expected O, but got Unknown //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Expected O, but got Unknown //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Expected O, but got Unknown //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0216: 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_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0227: 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_0233: 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_024c: Expected O, but got Unknown //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) ((BaseUnityPlugin)this).Config.Bind("Examples.Basic", "Bool", false, "A bool"); ((BaseUnityPlugin)this).Config.Bind("Examples.Basic", "String", "Hiiiii", "A string"); ((BaseUnityPlugin)this).Config.Bind("Examples.Numeric", "Unrestricted Float", 0f, "A float"); ((BaseUnityPlugin)this).Config.Bind("Examples.Numeric", "Acceptable Range Float", 0f, new ConfigDescription("A float with a range restriction", (AcceptableValueBase)(object)new AcceptableValueRange(-100f, 100f), Array.Empty())); ((BaseUnityPlugin)this).Config.Bind("Examples.Numeric", "Acceptable List Float", 0f, new ConfigDescription("A float with a list of acceptable values", (AcceptableValueBase)(object)new AcceptableValueList(new float[6] { 0f, 0.5f, 1f, 1.5f, 2f, 10f }), Array.Empty())); ((BaseUnityPlugin)this).Config.Bind("Examples.Numeric", "Unrestricted Int", 0, "An int"); ((BaseUnityPlugin)this).Config.Bind("Examples.Numeric", "Acceptable Range Int", 0, new ConfigDescription("An int with a range restriction", (AcceptableValueBase)(object)new AcceptableValueRange(-10, 10), Array.Empty())); ((BaseUnityPlugin)this).Config.Bind("Examples.Numeric", "Acceptable List Int", 0, new ConfigDescription("An int with a list of acceptable values", (AcceptableValueBase)(object)new AcceptableValueList(new int[7] { 0, 1, 2, 3, 4, 5, 10 }), Array.Empty())); ((BaseUnityPlugin)this).Config.Bind("Examples.Numeric", "UInt", 0u, "An unsigned int"); ((BaseUnityPlugin)this).Config.Bind("Examples.Numeric", "SByte", (sbyte)0, "A signed byte"); ((BaseUnityPlugin)this).Config.Bind("Examples.Numeric", "Byte", (byte)0, "A byte"); ((BaseUnityPlugin)this).Config.Bind("Examples.UnityTypes", "Unrestricted Vector2", Vector2.zero, "A Vector2"); ((BaseUnityPlugin)this).Config.Bind("Examples.UnityTypes", "Acceptable List Vector2", Vector2.zero, new ConfigDescription("A Vector2 with a list of acceptable values", (AcceptableValueBase)(object)new AcceptableValueList((Vector2[])(object)new Vector2[6] { Vector2.zero, Vector2.one, Vector2.up, Vector2.down, Vector2.left, Vector2.right }), Array.Empty())); ((BaseUnityPlugin)this).Config.Bind("Examples.UnityTypes", "Vector3", Vector3.zero, "A Vector3"); ((BaseUnityPlugin)this).Config.Bind("Examples.UnityTypes", "Vector4", Vector4.zero, "A Vector4"); ((BaseUnityPlugin)this).Config.Bind("Examples.UnityTypes", "Quaternion", Quaternion.identity, "A Quaternion"); ((BaseUnityPlugin)this).Config.Bind("Examples.UnityTypes", "Color", Color.white, "A Color"); ((BaseUnityPlugin)this).Config.Bind("Examples.Other", "Enum", TestEnum.OptionA, "An enum"); ((BaseUnityPlugin)this).Config.Bind("Examples.Other", "Keyboard Shortcut", new KeyboardShortcut((KeyCode)285, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), "A keyboard shortcut"); ((BaseUnityPlugin)this).Config.Bind("Examples.Other", "KeyCode", (KeyCode)97, "A keycode"); m_superSecretConfigEntry = ((BaseUnityPlugin)this).Config.Bind("Examples.Secret", "Super Secret Entry", ":3", "shhh"); m_superSecretConfigEntry.SettingChanged += delegate { PauseManager.Instance.WriteOfflineLog(">:3"); }; } private static void CustomContentBuilder(OptionListContext c) { //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: 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_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) c.InsertHeader(13, "Custom Section 1"); ((Component)c.InsertTextBox(14, "This section was generated with the Mod Menu API! With it, you can add custom ui elements anywhere in your mod's config page. Go to Assets/Scripts/Plugin.cs in the mod's source code to see example usage of the API.")).GetComponent().preferredHeight = 128f; c.InsertButton(15, "", "A very interesting button", delegate { PauseManager.Instance.WriteOfflineLog("Button pressed!"); }); c.InsertButton(16, "Plugins Directory", "Show Path", delegate { string pluginPath = Paths.PluginPath; PauseManager.Instance.WriteOfflineLog("Plugins directory: " + pluginPath); }); c.AppendHeader("Custom Section 2"); c.AppendTextBox("Another custom section!"); c.AppendTextBox("With some colored text! :3").Color = new Color(0.77f, 0.53f, 1f); TestEnum2 dropdownValue = TestEnum2.AnotherTestEnum; c.AppendDropdown("Custom Dropdown", () => dropdownValue, delegate(TestEnum2 value) { dropdownValue = value; PauseManager.Instance.WriteOfflineLog($"dropdownValue is {dropdownValue}"); }); bool boolValue = false; c.AppendCheckbox("Custom Checkbox", () => boolValue, delegate(bool value) { boolValue = value; PauseManager.Instance.WriteOfflineLog($"checkboxValue is {value}"); }); Color colorValue = new Color(0.77f, 0.53f, 1f); c.AppendColorInput("Custom Color Input", () => colorValue, delegate(Color value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: 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) colorValue = value; PauseManager.Instance.WriteOfflineLog($"colorValue is {value}"); }); string stringValue = "hiii"; c.AppendStringInput("Custom String Input", () => stringValue, delegate(string value) { stringValue = value; PauseManager.Instance.WriteOfflineLog("stringValue is " + value); }); KeyboardShortcut keyboardShortcutValue = KeyboardShortcut.Empty; c.AppendKeyboardShortcutInput("Custom Keyboard Shortcut Input", () => keyboardShortcutValue, delegate(KeyboardShortcut value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: 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) keyboardShortcutValue = value; PauseManager.Instance.WriteOfflineLog($"keyboardShortcutValue is {value}"); }); KeyCode keyCodeValue = (KeyCode)0; c.AppendKeyCodeInput("Custom KeyCode Input", () => keyCodeValue, delegate(KeyCode value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: 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) keyCodeValue = value; PauseManager.Instance.WriteOfflineLog($"keyCodeValue is {value}"); }); Quaternion quaternionValue = Quaternion.identity; c.AppendQuaternionInput("Custom Quaternion Input", () => quaternionValue, delegate(Quaternion value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: 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) quaternionValue = value; PauseManager.Instance.WriteOfflineLog($"quaternionValue is {value}"); }); Vector2 vector2Value = Vector2.zero; c.AppendVector2Input("Custom Vector2 Input", () => vector2Value, delegate(Vector2 value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: 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) vector2Value = value; PauseManager.Instance.WriteOfflineLog($"vector2Value is {value}"); }); Vector3 vector3Value = Vector3.zero; c.AppendVector3Input("Custom Vector3 Input", () => vector3Value, delegate(Vector3 value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: 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) vector3Value = value; PauseManager.Instance.WriteOfflineLog($"vector3Value is {value}"); }); Vector4 vector4Value = Vector4.zero; c.AppendVector4Input("Custom Vector4 Input", () => vector4Value, delegate(Vector4 value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: 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) vector4Value = value; PauseManager.Instance.WriteOfflineLog($"vector4Value is {value}"); }); c.AppendTextBox("Some weirder stuff").Color = new Color(0.77254903f, 0.5254902f, 1f); float floatValue = 0f; Action setter = delegate(float value) { floatValue = value; PauseManager.Instance.WriteOfflineLog($"floatValue is {floatValue}"); }; NumericInputFieldValueController inputField = c.AppendNumericInputField("Custom Float Input", () => floatValue, setter); NumericSliderValueController slider = c.AppendNumericSlider("Custom Float Slider", () => floatValue, setter, 0f, 100f); NumericInputFieldValueController numericInputFieldValueController = inputField; numericInputFieldValueController.setter = (Action)Delegate.Combine(numericInputFieldValueController.setter, (Action)delegate { slider.UpdateAppearance(); }); NumericSliderValueController numericSliderValueController = slider; numericSliderValueController.setter = (Action)Delegate.Combine(numericSliderValueController.setter, (Action)delegate { inputField.UpdateAppearance(); }); int sliderMin = -200; int sliderMax = 200; float floatValue2 = 0f; NumericSliderValueController floatSlider2 = c.AppendNumericSlider("Custom Float Slider 2", () => floatValue2, delegate(float value) { floatValue2 = value; PauseManager.Instance.WriteOfflineLog($"floatValue2 is {floatValue2}"); }, sliderMin, sliderMax); NumericSliderValueController minSlider = c.AppendNumericSlider("Slider 2 Min (int slider example)", () => sliderMin, delegate(int value) { sliderMin = value; floatSlider2.slider.minValue = sliderMin; }, -1000f, sliderMax - 5); NumericSliderValueController maxSlider = c.AppendNumericSlider("Slider 2 Max (int slider example)", () => sliderMax, delegate(int value) { sliderMax = value; floatSlider2.slider.maxValue = sliderMax; }, sliderMin + 5, 1000f); NumericSliderValueController numericSliderValueController2 = minSlider; numericSliderValueController2.setter = (Action)Delegate.Combine(numericSliderValueController2.setter, (Action)delegate { maxSlider.slider.minValue = sliderMin + 5; }); NumericSliderValueController numericSliderValueController3 = maxSlider; numericSliderValueController3.setter = (Action)Delegate.Combine(numericSliderValueController3.setter, (Action)delegate { minSlider.slider.maxValue = sliderMax - 5; }); } } } namespace ModMenu.Utils { internal static class AcceptableValueBaseExtensions { public static string HumanizedString(this AcceptableValueBase avb) { Type type = ((object)avb).GetType(); if (avb.IsAcceptableValueRange()) { object value = type.GetProperty("MinValue").GetValue(avb); object value2 = type.GetProperty("MaxValue").GetValue(avb); return "Accepts " + value?.ToString() + " to " + value2; } if (avb.IsAcceptableValueList()) { object[] array = ((IEnumerable)type.GetProperty("AcceptableValues").GetValue(avb)).Cast().ToArray(); return "Accepts " + string.Join(", ", from v in array.SkipLast(1) select v.ToString()) + " and " + array[^1]; } throw new NotSupportedException($"Type \"{type}\" is not supported."); } public static bool IsAcceptableValueList(this AcceptableValueBase avb) { return ((object)avb).GetType().GetGenericTypeDefinition() == typeof(AcceptableValueList<>); } public static bool IsAcceptableValueRange(this AcceptableValueBase avb) { return ((object)avb).GetType().GetGenericTypeDefinition() == typeof(AcceptableValueRange<>); } } internal static class Assets { private static AssetBundle m_bundle; public static Sprite DefaultModIcon { get; private set; } public static Sprite ModMenuModIcon { get; private set; } public static GameObject CategoryHeader { get; private set; } public static GameObject IntegralSliderOption { get; private set; } public static GameObject FloatingSliderOption { get; private set; } public static GameObject IntegralInputFieldOption { get; private set; } public static GameObject FloatingInputFieldOption { get; private set; } public static GameObject BoolCheckboxOption { get; private set; } public static GameObject StringInputFieldOption { get; private set; } public static GameObject EnumDropdownOption { get; private set; } public static GameObject KeyCodeOption { get; private set; } public static GameObject KeyboardShortcutOption { get; private set; } public static GameObject AcceptableListDropdownOption { get; private set; } public static GameObject Vector2Option { get; private set; } public static GameObject Vector3Option { get; private set; } public static GameObject Vector4Option { get; private set; } public static GameObject QuaternionOption { get; private set; } public static GameObject ColorOption { get; private set; } public static GameObject TextDummy { get; private set; } public static GameObject ButtonDummy { get; private set; } internal static T Load(string name) where T : Object { return m_bundle.LoadAsset(name); } public static void Init() { Plugin.Logger.LogInfo((object)"Loading assets..."); m_bundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "modmenu")); DefaultModIcon = Assets.Load("NoIcon"); ModMenuModIcon = Assets.Load("ModIcon"); CategoryHeader = Assets.Load("CategoryHeader"); IntegralSliderOption = Assets.Load("IntegralSliderOption"); FloatingSliderOption = Assets.Load("FloatingSliderOption"); IntegralInputFieldOption = Assets.Load("IntegralInputFieldOption"); FloatingInputFieldOption = Assets.Load("FloatingInputFieldOption"); BoolCheckboxOption = Assets.Load("BoolCheckboxOption"); StringInputFieldOption = Assets.Load("StringInputFieldOption"); EnumDropdownOption = Assets.Load("EnumDropdownOption"); KeyCodeOption = Assets.Load("KeyCodeOption"); KeyboardShortcutOption = Assets.Load("KeyboardShortcutOption"); AcceptableListDropdownOption = Assets.Load("AcceptableListDropdownOption"); Vector2Option = Assets.Load("Vector2Option"); Vector3Option = Assets.Load("Vector3Option"); Vector4Option = Assets.Load("Vector4Option"); QuaternionOption = Assets.Load("QuaternionOption"); ColorOption = Assets.Load("ColorOption"); TextDummy = Assets.Load("TextDummy"); ButtonDummy = Assets.Load("ButtonDummy"); Plugin.Logger.LogInfo((object)"Assets loaded!"); } } internal static class BepInExUtils { internal static Dictionary PluginInfoCache { get; } = new Dictionary(); internal static Dictionary PluginTypeNameCache { get; } = new Dictionary(); internal static string GetPluginInfoTypeName(PluginInfo pluginInfo) { if (PluginTypeNameCache.TryGetValue(pluginInfo, out var value)) { return value; } value = AccessTools.Property(typeof(PluginInfo), "TypeName").GetValue(pluginInfo) as string; PluginTypeNameCache.Add(pluginInfo, value); return value; } internal static PluginInfo GetPluginInfoFromAssembly(Assembly assembly) { if (PluginInfoCache.TryGetValue(assembly, out var value)) { return value; } using (IEnumerator enumerator = Chainloader.PluginInfos.Values.Where((PluginInfo info) => assembly.GetType(GetPluginInfoTypeName(info)) != null).GetEnumerator()) { if (enumerator.MoveNext()) { PluginInfo current = enumerator.Current; PluginInfoCache.Add(assembly, current); return current; } } PluginInfoCache.Add(assembly, null); return null; } } internal static class TypeExtensions { public static bool IsIntegral(this Type type) { if (!(type == typeof(sbyte)) && !(type == typeof(byte)) && !(type == typeof(short)) && !(type == typeof(ushort)) && !(type == typeof(int)) && !(type == typeof(uint)) && !(type == typeof(long))) { return type == typeof(ulong); } return true; } public static bool IsFloating(this Type type) { if (!(type == typeof(float)) && !(type == typeof(double))) { return type == typeof(decimal); } return true; } } } namespace ModMenu.Patches { [HarmonyPatch(typeof(PauseManager))] internal static class PauseManagerPatch { public static readonly HashSet currentlyRebindingKeybindContollers = new HashSet(); [HarmonyPatch("Awake")] [HarmonyPostfix] public static void InitModsTab(GameObject ___optionsMenu) { //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Expected O, but got Unknown //IL_010c: 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_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Expected O, but got Unknown //IL_015d: Expected O, but got Unknown if (!Object.op_Implicit((Object)(object)___optionsMenu)) { return; } ((Component)___optionsMenu.transform.Find("OPTIONS HUD").GetChild(0).GetChild(3)).gameObject.SetActive(false); GameObject pcTab = ((Component)___optionsMenu.transform.Find("PcTab")).gameObject; GameObject audioTab = ((Component)___optionsMenu.transform.Find("AudioTab")).gameObject; GameObject graphTab = ((Component)___optionsMenu.transform.Find("GraphTab")).gameObject; GameObject modsTab = Object.Instantiate(Assets.Load("ModMenu"), ___optionsMenu.transform); ((Object)modsTab).name = "ModsTab"; modsTab.SetActive(false); Transform val = ___optionsMenu.transform.Find("Tabsbutton"); Button component = Object.Instantiate(Assets.Load("ModsTabButton"), ((Component)val).transform).GetComponent