Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Loadout v2.0.3
BepInEx/plugins/shaboingboings-loadout/loadout.dll
Decompiled 3 weeks agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using MenuLib; using MenuLib.MonoBehaviors; using Microsoft.CodeAnalysis; using TMPro; using Unity.VisualScripting; using UnityEngine; using WebSocketSharp; [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: IgnoresAccessChecksTo("")] [assembly: AssemblyCompany("shaboingboings")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+0f5bc087cdecc69e05fd75f1585eb257f1b4345e")] [assembly: AssemblyProduct("loadout")] [assembly: AssemblyTitle("loadout")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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] [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; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace loadout { [BepInPlugin("shaboingboings.loadout", "Loadout", "1.0")] public class Loadout : BaseUnityPlugin { public static ConfigEntry<bool> mod_enabled; public static ConfigEntry<string> item_list; public static ConfigEntry<string> presets; public const int MAX_LOADOUTS = 4; public static List<string> loadouts = new List<string>(); public static Dictionary<string, int> loadout = new Dictionary<string, int>(); internal static Loadout Instance { get; private set; } = null; internal static ManualLogSource Logger => Instance._logger; private ManualLogSource _logger => ((BaseUnityPlugin)this).Logger; internal Harmony? Harmony { get; set; } public static bool IsHost() { return SemiFunc.IsMasterClientOrSingleplayer(); } public static bool IsEnabledAndMaster() { return mod_enabled.Value && SemiFunc.IsMasterClientOrSingleplayer(); } private static void ParsePresets() { List<string> list = presets.Value.Split("|").ToList(); for (int i = 0; i < 4; i++) { if (i >= list.Count) { loadouts.Add(string.Empty); } else { loadouts.Add(list[i]); } } } public static void SavePresets() { string text = ""; foreach (string loadout in loadouts) { text = text + loadout + "|"; } presets.Value = text; } public static string GetLoadoutString() { string text = ""; foreach (KeyValuePair<string, int> item in loadout) { if (item.Value != 0) { string text2 = ((item.Value > 0) ? $"#{item.Value}" : ""); text = text + item.Key + text2 + ";"; } } return text; } public static void SetLoadoutFromString(string l, bool use_stats = false) { if (!IsEnabledAndMaster()) { return; } if (use_stats) { if (!UnityObjectUtility.IsUnityNull((object)StatsManager.instance)) { foreach (string key2 in StatsManager.instance.itemDictionary.Keys) { loadout[key2] = 0; } } else { Logger.LogWarning((object)"You just tried to set loadout using the StatsManager, but it isn't available yet. Wait until you're either in a lobby or game."); } } string[] array = l.Split(';'); string[] array2 = array; foreach (string text in array2) { List<string> list = text.Split('#').ToList(); string key = list[0].TrimStart().TrimEnd(); int result = ((list.Count > 1 && int.TryParse(list[1], out result)) ? result : (-1)); loadout[key] = result; } } private void Awake() { Instance = this; ((Component)this).gameObject.transform.parent = null; ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; mod_enabled = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enabled", true, "Enable or disable the mod."); item_list = ((BaseUnityPlugin)this).Config.Bind<string>("Items", "ItemList", "Item Gun Handgun", "A list of items you want to start with separated by a semicolon. Use a hash to denote quantity. Items without quantity will be spawned for each player.\nDefault game item list:\nItem Cart Medium\nItem Cart Small\nItem Drone Battery\nItem Drone Feather\nItem Drone Indestructible\nItem Drone Torque\nItem Drone Zero Gravity\nItem Extraction Tracker\nItem Grenade Duct Taped\nItem Grenade Explosive\nItem Grenade Human\nItem Grenade Shockwave\nItem Grenade Stun\nItem Gun Handgun\nItem Gun Shotgun\nItem Gun Tranq\nItem Health Pack Large\nItem Health Pack Medium\nItem Health Pack Small\nItem Melee Baseball Bat\nItem Melee Frying Pan\nItem Melee Inflatable Hammer\nItem Melee Sledge Hammer\nItem Melee Sword\nItem Mine Explosive\nItem Mine Shockwave\nItem Mine Stun\nItem Orb Zero Gravity\nItem Power Crystal\nItem Rubber Duck\nItem Upgrade Map Player Count\nItem Upgrade Player Energy\nItem Upgrade Player Extra Jump\nItem Upgrade Player Grab Range\nItem Upgrade Player Grab Strength\nItem Upgrade Player Health\nItem Upgrade Player Sprint Speed\nItem Upgrade Player Tumble Launch\nItem Valuable Tracker\n"); presets = ((BaseUnityPlugin)this).Config.Bind<string>("Presets", "Presets", "Item Gun Handgun||||", (ConfigDescription)null); Patch(); Logger.LogInfo((object)$"{((BaseUnityPlugin)this).Info.Metadata.GUID} v{((BaseUnityPlugin)this).Info.Metadata.Version} has loaded!"); ParsePresets(); LoadoutUI.CreateMenus(); } internal void Patch() { //IL_001a: 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_0021: Expected O, but got Unknown //IL_0026: Expected O, but got Unknown if (Harmony == null) { Harmony val = new Harmony(((BaseUnityPlugin)this).Info.Metadata.GUID); Harmony val2 = val; Harmony = val; } Harmony.PatchAll(); } internal void Unpatch() { Harmony? harmony = Harmony; if (harmony != null) { harmony.UnpatchSelf(); } } } [HarmonyPatch(typeof(RunManager))] internal static class LoadoutGiver { private const int ITEM_COUNT = 30; private static void SetItemMax(string item_name, int count) { Item[] array = Resources.FindObjectsOfTypeAll<Item>(); Item[] array2 = array; foreach (Item val in array2) { if (((Object)val).name == item_name) { val.maxAmount = Math.Max(val.maxAmount, count); } } } private static void PurchaseItems(string item_name, int count) { if (!Ext.IsNullOrEmpty(item_name)) { Dictionary<string, int> itemsPurchased = StatsManager.instance.itemsPurchased; int valueOrDefault = itemsPurchased.GetValueOrDefault(item_name, 0); itemsPurchased[item_name] = Math.Max(count, valueOrDefault); Loadout.Logger.LogMessage((object)$"Spawning {count} {item_name}."); } } [HarmonyPostfix] [HarmonyPatch("ChangeLevel")] private static void Patch() { if (!Loadout.mod_enabled.Value || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } foreach (KeyValuePair<string, Item> item in StatsManager.instance.itemDictionary) { SetItemMax(item.Key, 30); } if (!SemiFunc.RunIsLevel() || RunManager.instance.loadLevel != 0) { return; } List<PlayerAvatar> list = SemiFunc.PlayerGetList(); int num = Math.Max(1, list.Count); foreach (KeyValuePair<string, int> item2 in Loadout.loadout) { if (item2.Value != 0) { int count = ((item2.Value > 0) ? item2.Value : num); PurchaseItems(item2.Key, count); } } } } internal static class LoadoutUI { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static ScrollViewBuilderDelegate <>9__3_0; public static Action<int> <>9__3_9; public static ScrollViewBuilderDelegate <>9__3_1; public static ScrollViewBuilderDelegate <>9__3_2; public static ScrollViewBuilderDelegate <>9__3_3; public static ScrollViewBuilderDelegate <>9__3_11; public static ScrollViewBuilderDelegate <>9__3_4; public static ScrollViewBuilderDelegate <>9__3_5; public static ScrollViewBuilderDelegate <>9__3_6; public static ScrollViewBuilderDelegate <>9__3_7; public static ScrollViewBuilderDelegate <>9__3_8; public static ShouldCloseMenuDelegate <>9__4_2; public static Action <>9__4_3; public static BuilderDelegate <>9__4_0; public static Action <>9__4_4; public static BuilderDelegate <>9__4_1; public static BuilderDelegate <>9__5_0; public static BuilderDelegate <>9__5_1; internal RectTransform <CreateItemEntries>b__3_0(Transform view) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(0f, 20f); return ((REPOElement)MenuAPI.CreateREPOSpacer(view, default(Vector2), val)).rectTransform; } internal RectTransform <CreateItemEntries>b__3_1(Transform view) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) REPOSlider val = MenuAPI.CreateREPOSlider("Preset", string.Empty, (Action<int>)delegate(int nv) { selected_loadout = nv; }, view, default(Vector2), 1, 4, selected_loadout, "", "", (BarBehavior)0); return ((REPOElement)val).rectTransform; } internal void <CreateItemEntries>b__3_9(int nv) { selected_loadout = nv; } internal RectTransform <CreateItemEntries>b__3_2(Transform view) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) REPOLabel val = MenuAPI.CreateREPOLabel("Set an item quantity to -1 to spawn one for each player.", view, Vector2.zero); ((TMP_Text)val.labelTMP).fontSize = 12f; return ((REPOElement)val).rectTransform; } internal RectTransform <CreateItemEntries>b__3_3(Transform view) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(0f, 20f); return ((REPOElement)MenuAPI.CreateREPOSpacer(view, default(Vector2), val)).rectTransform; } internal RectTransform <CreateItemEntries>b__3_11(Transform scrollView) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(0f, 10f); return ((REPOElement)MenuAPI.CreateREPOSpacer(scrollView, default(Vector2), val)).rectTransform; } internal RectTransform <CreateItemEntries>b__3_4(Transform scrollView) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(0f, 20f); return ((REPOElement)MenuAPI.CreateREPOSpacer(scrollView, default(Vector2), val)).rectTransform; } internal RectTransform <CreateItemEntries>b__3_5(Transform view) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(0f, 20f); return ((REPOElement)MenuAPI.CreateREPOSpacer(view, default(Vector2), val)).rectTransform; } internal RectTransform <CreateItemEntries>b__3_6(Transform view) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) REPOLabel val = MenuAPI.CreateREPOLabel("Mod disabled, change in settings.", view, Vector2.zero); ((TMP_Text)val.labelTMP).fontSize = 12f; return ((REPOElement)val).rectTransform; } internal RectTransform <CreateItemEntries>b__3_7(Transform view) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) REPOLabel val = MenuAPI.CreateREPOLabel("Only the host can apply loadout.", view, Vector2.zero); ((TMP_Text)val.labelTMP).fontSize = 12f; return ((REPOElement)val).rectTransform; } internal RectTransform <CreateItemEntries>b__3_8(Transform view) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(0f, 20f); return ((REPOElement)MenuAPI.CreateREPOSpacer(view, default(Vector2), val)).rectTransform; } internal bool <Loadout_OpenUI>b__4_2() { Loadout.item_list.Value = Loadout.GetLoadoutString(); return true; } internal void <Loadout_OpenUI>b__4_0(Transform parent) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("SAVE PRESET", (Action)delegate { Loadout.loadouts[selected_loadout - 1] = Loadout.GetLoadoutString(); Loadout.SavePresets(); }, parent, new Vector2(370f, 18f)); } internal void <Loadout_OpenUI>b__4_3() { Loadout.loadouts[selected_loadout - 1] = Loadout.GetLoadoutString(); Loadout.SavePresets(); } internal void <Loadout_OpenUI>b__4_1(Transform parent) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("LOAD PRESET", (Action)delegate { Loadout.SetLoadoutFromString(Loadout.loadouts[selected_loadout - 1], use_stats: true); foreach (string key in StatsManager.instance.itemDictionary.Keys) { sliders[key].value = Loadout.loadout[key]; } }, parent, new Vector2(585f, 18f)); } internal void <Loadout_OpenUI>b__4_4() { Loadout.SetLoadoutFromString(Loadout.loadouts[selected_loadout - 1], use_stats: true); foreach (string key in StatsManager.instance.itemDictionary.Keys) { sliders[key].value = Loadout.loadout[key]; } } internal void <CreateMenus>b__5_0(Transform parent) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("Loadout", (Action)Loadout_OpenUI, parent, new Vector2(350f, 50f)); } internal void <CreateMenus>b__5_1(Transform parent) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("Loadout", (Action)Loadout_OpenUI, parent, new Vector2(350f, 50f)); } } private static int selected_loadout = 1; private static Dictionary<string, REPOSlider> sliders = new Dictionary<string, REPOSlider>(); private static void FetchItems() { if (Loadout.mod_enabled.Value && SemiFunc.IsMasterClientOrSingleplayer()) { Loadout.SetLoadoutFromString(Loadout.item_list.Value, use_stats: true); } } private static void CreateItemEntries(REPOPopupPage menu) { //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Expected O, but got Unknown //IL_0023: 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_002e: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Expected O, but got Unknown //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Expected O, but got Unknown //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Expected O, but got Unknown //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Expected O, but got Unknown //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Expected O, but got Unknown //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Expected O, but got Unknown if (Loadout.IsEnabledAndMaster()) { object obj = <>c.<>9__3_0; if (obj == null) { ScrollViewBuilderDelegate val = delegate(Transform view) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector2 val11 = default(Vector2); ((Vector2)(ref val11))..ctor(0f, 20f); return ((REPOElement)MenuAPI.CreateREPOSpacer(view, default(Vector2), val11)).rectTransform; }; <>c.<>9__3_0 = val; obj = (object)val; } menu.AddElementToScrollView((ScrollViewBuilderDelegate)obj, 0f, 0f); object obj2 = <>c.<>9__3_1; if (obj2 == null) { ScrollViewBuilderDelegate val2 = delegate(Transform view) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) REPOSlider val11 = MenuAPI.CreateREPOSlider("Preset", string.Empty, (Action<int>)delegate(int nv) { selected_loadout = nv; }, view, default(Vector2), 1, 4, selected_loadout, "", "", (BarBehavior)0); return ((REPOElement)val11).rectTransform; }; <>c.<>9__3_1 = val2; obj2 = (object)val2; } menu.AddElementToScrollView((ScrollViewBuilderDelegate)obj2, 0f, 0f); object obj3 = <>c.<>9__3_2; if (obj3 == null) { ScrollViewBuilderDelegate val3 = delegate(Transform view) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) REPOLabel val11 = MenuAPI.CreateREPOLabel("Set an item quantity to -1 to spawn one for each player.", view, Vector2.zero); ((TMP_Text)val11.labelTMP).fontSize = 12f; return ((REPOElement)val11).rectTransform; }; <>c.<>9__3_2 = val3; obj3 = (object)val3; } menu.AddElementToScrollView((ScrollViewBuilderDelegate)obj3, 0f, 0f); object obj4 = <>c.<>9__3_3; if (obj4 == null) { ScrollViewBuilderDelegate val4 = delegate(Transform view) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector2 val11 = default(Vector2); ((Vector2)(ref val11))..ctor(0f, 20f); return ((REPOElement)MenuAPI.CreateREPOSpacer(view, default(Vector2), val11)).rectTransform; }; <>c.<>9__3_3 = val4; obj4 = (object)val4; } menu.AddElementToScrollView((ScrollViewBuilderDelegate)obj4, 0f, 0f); sliders.Clear(); foreach (string s in StatsManager.instance.itemDictionary.Keys) { menu.AddElementToScrollView((ScrollViewBuilderDelegate)delegate(Transform view) { //IL_002e: 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) REPOSlider val11 = MenuAPI.CreateREPOSlider(s, string.Empty, (Action<int>)delegate(int nv) { int result = Loadout.loadout[s]; if (int.TryParse(nv.ToString(), out result)) { Loadout.loadout[s] = result; } }, view, default(Vector2), -1, 20, Loadout.loadout[s], "", "", (BarBehavior)0); sliders[s] = val11; return ((REPOElement)val11).rectTransform; }, 0f, 0f); object obj5 = <>c.<>9__3_11; if (obj5 == null) { ScrollViewBuilderDelegate val5 = delegate(Transform scrollView) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector2 val11 = default(Vector2); ((Vector2)(ref val11))..ctor(0f, 10f); return ((REPOElement)MenuAPI.CreateREPOSpacer(scrollView, default(Vector2), val11)).rectTransform; }; <>c.<>9__3_11 = val5; obj5 = (object)val5; } menu.AddElementToScrollView((ScrollViewBuilderDelegate)obj5, 0f, 0f); } object obj6 = <>c.<>9__3_4; if (obj6 == null) { ScrollViewBuilderDelegate val6 = delegate(Transform scrollView) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector2 val11 = default(Vector2); ((Vector2)(ref val11))..ctor(0f, 20f); return ((REPOElement)MenuAPI.CreateREPOSpacer(scrollView, default(Vector2), val11)).rectTransform; }; <>c.<>9__3_4 = val6; obj6 = (object)val6; } menu.AddElementToScrollView((ScrollViewBuilderDelegate)obj6, 0f, 0f); return; } object obj7 = <>c.<>9__3_5; if (obj7 == null) { ScrollViewBuilderDelegate val7 = delegate(Transform view) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector2 val11 = default(Vector2); ((Vector2)(ref val11))..ctor(0f, 20f); return ((REPOElement)MenuAPI.CreateREPOSpacer(view, default(Vector2), val11)).rectTransform; }; <>c.<>9__3_5 = val7; obj7 = (object)val7; } menu.AddElementToScrollView((ScrollViewBuilderDelegate)obj7, 0f, 0f); if (Loadout.IsHost()) { object obj8 = <>c.<>9__3_6; if (obj8 == null) { ScrollViewBuilderDelegate val8 = delegate(Transform view) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) REPOLabel val11 = MenuAPI.CreateREPOLabel("Mod disabled, change in settings.", view, Vector2.zero); ((TMP_Text)val11.labelTMP).fontSize = 12f; return ((REPOElement)val11).rectTransform; }; <>c.<>9__3_6 = val8; obj8 = (object)val8; } menu.AddElementToScrollView((ScrollViewBuilderDelegate)obj8, 0f, 0f); } else { object obj9 = <>c.<>9__3_7; if (obj9 == null) { ScrollViewBuilderDelegate val9 = delegate(Transform view) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) REPOLabel val11 = MenuAPI.CreateREPOLabel("Only the host can apply loadout.", view, Vector2.zero); ((TMP_Text)val11.labelTMP).fontSize = 12f; return ((REPOElement)val11).rectTransform; }; <>c.<>9__3_7 = val9; obj9 = (object)val9; } menu.AddElementToScrollView((ScrollViewBuilderDelegate)obj9, 0f, 0f); } object obj10 = <>c.<>9__3_8; if (obj10 == null) { ScrollViewBuilderDelegate val10 = delegate(Transform view) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector2 val11 = default(Vector2); ((Vector2)(ref val11))..ctor(0f, 20f); return ((REPOElement)MenuAPI.CreateREPOSpacer(view, default(Vector2), val11)).rectTransform; }; <>c.<>9__3_8 = val10; obj10 = (object)val10; } menu.AddElementToScrollView((ScrollViewBuilderDelegate)obj10, 0f, 0f); } private static void Loadout_OpenUI() { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Expected O, but got Unknown FetchItems(); REPOPopupPage val = MenuAPI.CreateREPOPopupPage("Loadout", (PresetSide)1, false, false, 0f); val.OpenPage(false); ShouldCloseMenuDelegate onEscapePressed = val.onEscapePressed; object obj = <>c.<>9__4_2; if (obj == null) { ShouldCloseMenuDelegate val2 = delegate { Loadout.item_list.Value = Loadout.GetLoadoutString(); return true; }; <>c.<>9__4_2 = val2; obj = (object)val2; } val.onEscapePressed = (ShouldCloseMenuDelegate)Delegate.Combine((Delegate?)(object)onEscapePressed, (Delegate?)obj); CreateItemEntries(val); if (!Loadout.IsEnabledAndMaster()) { return; } object obj2 = <>c.<>9__4_0; if (obj2 == null) { BuilderDelegate val3 = delegate(Transform parent) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("SAVE PRESET", (Action)delegate { Loadout.loadouts[selected_loadout - 1] = Loadout.GetLoadoutString(); Loadout.SavePresets(); }, parent, new Vector2(370f, 18f)); }; <>c.<>9__4_0 = val3; obj2 = (object)val3; } val.AddElement((BuilderDelegate)obj2); object obj3 = <>c.<>9__4_1; if (obj3 == null) { BuilderDelegate val4 = delegate(Transform parent) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("LOAD PRESET", (Action)delegate { Loadout.SetLoadoutFromString(Loadout.loadouts[selected_loadout - 1], use_stats: true); foreach (string key in StatsManager.instance.itemDictionary.Keys) { sliders[key].value = Loadout.loadout[key]; } }, parent, new Vector2(585f, 18f)); }; <>c.<>9__4_1 = val4; obj3 = (object)val4; } val.AddElement((BuilderDelegate)obj3); } public static void CreateMenus() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_003a: 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_0045: Expected O, but got Unknown object obj = <>c.<>9__5_0; if (obj == null) { BuilderDelegate val = delegate(Transform parent) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("Loadout", (Action)Loadout_OpenUI, parent, new Vector2(350f, 50f)); }; <>c.<>9__5_0 = val; obj = (object)val; } MenuAPI.AddElementToEscapeMenu((BuilderDelegate)obj); object obj2 = <>c.<>9__5_1; if (obj2 == null) { BuilderDelegate val2 = delegate(Transform parent) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("Loadout", (Action)Loadout_OpenUI, parent, new Vector2(350f, 50f)); }; <>c.<>9__5_1 = val2; obj2 = (object)val2; } MenuAPI.AddElementToLobbyMenu((BuilderDelegate)obj2); } } }