using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text.Json; using Assets.Scripts.Actors.Player; using Assets.Scripts.Inventory__Items__Pickups; using Assets.Scripts.Managers; using Assets.Scripts.Saves___Serialization.Progression.Achievements; using BepInEx; using BepInEx.Core.Logging.Interpolation; using BepInEx.Logging; using BepInEx.Unity.IL2CPP; using HarmonyLib; using Il2CppInterop.Runtime.InteropTypes; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppSystem; using Il2CppSystem.Collections.Generic; using Il2CppSystem.Reflection; using Microsoft.CodeAnalysis; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("LoadoutPresets")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Adds a Loadout Presets Manager to Megabonk")] [assembly: AssemblyFileVersion("0.1.4.0")] [assembly: AssemblyInformationalVersion("0.1.4+42248037cd50f9385d8d576cea08e860e64059b0")] [assembly: AssemblyProduct("LoadoutPresets")] [assembly: AssemblyTitle("LoadoutPresets")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.1.4.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace LoadoutPresets { internal static class ButtonFactory { public static Button CreateNativeButton(GameObject templateButton, string buttonName, string buttonText, string iconName, Transform customParent = null) { //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Expected O, but got Unknown GameObject val = Object.Instantiate(templateButton); ((Object)val).name = buttonName; Transform val2 = customParent ?? templateButton.transform.parent; val.transform.SetParent(val2, false); bool flag = default(bool); if ((Object)(object)customParent == (Object)null) { val.transform.SetSiblingIndex(templateButton.transform.GetSiblingIndex()); ManualLogSource logger = LoadoutPresets.Logger; BepInExDebugLogInterpolatedStringHandler val3 = new BepInExDebugLogInterpolatedStringHandler(62, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("ButtonFactory: Set hierarchy for '"); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(buttonName); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("' at SiblingIndex "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(val.transform.GetSiblingIndex()); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" under '"); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(((Object)val2).name); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("'."); } logger.LogDebug(val3); } else { ManualLogSource logger2 = LoadoutPresets.Logger; BepInExDebugLogInterpolatedStringHandler val3 = new BepInExDebugLogInterpolatedStringHandler(49, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("ButtonFactory: Set custom parent for '"); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(buttonName); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("' under '"); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(((Object)val2).name); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("'."); } logger2.LogDebug(val3); } StripNonVisualComponents(val); Transform val4 = val.transform.Find("Icon"); if (Object.op_Implicit((Object)(object)val4)) { if (!string.IsNullOrEmpty(iconName)) { SetButtonIcon(val4, iconName); } else { ((Component)val4).gameObject.SetActive(false); ManualLogSource logger3 = LoadoutPresets.Logger; BepInExDebugLogInterpolatedStringHandler val3 = new BepInExDebugLogInterpolatedStringHandler(46, 0, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("ButtonFactory: No icon requested, hiding icon."); } logger3.LogDebug(val3); } } Button orAddComponent = val.GetOrAddComponent