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 ReturnToLobby v1.0.6
ReturnToLobby.dll
Decompiled a day agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; 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 UnityEngine; [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("OrigamiCoder")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+c37ea867c883a164e4edb47a16c3fb525fa6c895")] [assembly: AssemblyProduct("ReturnToLobby")] [assembly: AssemblyTitle("ReturnToLobby")] [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 ReturnToLobby { [BepInPlugin("OrigamiCoder.ReturnToLobby", "ReturnToLobby", "1.0.6")] [BepInDependency("nickklmao.menulib", "2.6.0")] public class ReturnToLobby : BaseUnityPlugin { private bool IsPopupActive = false; private MethodInfo? resetLevelProgressMethod = AccessTools.Method(typeof(DebugCommandHandler), "ResetLevelProgress", (Type[])null, (Type[])null); internal static ReturnToLobby Instance { get; private set; } internal static ReturnToLobbyConfig? _config { get; set; } internal static ManualLogSource Logger => Instance._logger; private ManualLogSource _logger => ((BaseUnityPlugin)this).Logger; internal Harmony? Harmony { get; set; } internal static bool IsReturningToLobby { get; set; } private void Awake() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown Instance = this; ((Component)this).gameObject.transform.parent = null; ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; MenuAPI.AddElementToEscapeMenu((BuilderDelegate)delegate(Transform parent) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMasterClient()) { Transform val = parent.Find("Menu Button - Main Menu"); float num = (((Object)(object)val != (Object)null) ? val.localPosition.y : 155f); REPOButton val2 = MenuAPI.CreateREPOButton("Lobby", (Action)ReturnLobbyPopup, parent, new Vector2(245f, num)); } }); _config = new ReturnToLobbyConfig(this); Logger.LogInfo((object)$"{((BaseUnityPlugin)this).Info.Metadata.GUID} v{((BaseUnityPlugin)this).Info.Metadata.Version} has loaded!"); } private void ReturnLobbyPopup() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) IsPopupActive = true; MenuAPI.OpenPopup("Lobby", new Color(1f, 0.553f, 0f), "Return to lobby?", (Action)ReturnLobbyClick, (Action)ReturnLobbyCancel); } private void ReturnLobbyClick() { RunManager instance = RunManager.instance; int num = (SemiFunc.IsLevelShop(instance.levelCurrent) ? 1 : (SemiFunc.RunIsLobby() ? 2 : 0)); ResetLevelProgress(); instance.ChangeLevel(true, SemiFunc.RunIsArena(), (ChangeLevelType)3); SemiFunc.StatSetSaveLevel(num); instance.loadLevel = num; StatsManager.instance.SaveFileSave(); IsPopupActive = false; } private void ReturnLobbyCancel() { IsPopupActive = false; } private void ResetLevelProgress() { if (resetLevelProgressMethod == null) { Logger.LogWarning((object)"DebugCommandHandler.ResetLevelProgress was not found! Level progress not reset."); } else { resetLevelProgressMethod.Invoke(DebugCommandHandler.instance, null); } } private void Update() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMasterClient() && ReturnToLobbyConfig.IsInitialized && !IsPopupActive) { KeyboardShortcut value = ReturnToLobbyConfig.KeyboardShortcut.Value; if (((KeyboardShortcut)(ref value)).IsDown() && !SemiFunc.MenuLevel()) { ((MonoBehaviour)this).StartCoroutine(ReturnLobbyPopupDelayed()); } } } private IEnumerator ReturnLobbyPopupDelayed() { if (!Object.op_Implicit((Object)(object)MenuManager.instance.currentMenuPage)) { MenuManager.instance.PageOpen((MenuPageIndex)1, false); } yield return null; while (!MenuManager.instance.currentMenuPage.pageActive) { yield return null; } ReturnLobbyPopup(); } } internal class ReturnToLobbyConfig { internal static bool IsInitialized; internal static ConfigEntry<KeyboardShortcut> KeyboardShortcut; internal static ConfigEntry<KeyCode> MainKey; internal static ConfigEntry<KeyCode> Modifier; public ReturnToLobbyConfig(ReturnToLobby plugin) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) KeyboardShortcut = ((BaseUnityPlugin)plugin).Config.Bind<KeyboardShortcut>("Settings", "Keyboard Shortcut", new KeyboardShortcut((KeyCode)108, (KeyCode[])(object)new KeyCode[1] { (KeyCode)305 }), (ConfigDescription)null); MainKey = ((BaseUnityPlugin)plugin).Config.Bind<KeyCode>("Settings", "MainKey", (KeyCode)108, "Keybind"); Modifier = ((BaseUnityPlugin)plugin).Config.Bind<KeyCode>("Settings", "ModifierKey", (KeyCode)305, "Optional Modifier"); MainKey.SettingChanged += OnSettingChanged; Modifier.SettingChanged += OnSettingChanged; IsInitialized = true; static void OnSettingChanged(object sender, EventArgs e) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Invalid comparison between Unknown and I4 //IL_0035: 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_001f: Unknown result type (might be due to invalid IL or missing references) List<KeyCode> list = new List<KeyCode>(); if ((int)Modifier.Value > 0) { list.Add(Modifier.Value); } KeyboardShortcut.Value = new KeyboardShortcut(MainKey.Value, list.ToArray()); } } } }