using System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using RunawayJoinButton.Controllers; using UnityEngine; using UnityEngine.Events; using UnityEngine.InputSystem; 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("RunawayJoinButton")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+82336874e513993b46c860e1304e19d26b6a9ce1")] [assembly: AssemblyProduct("RunawayJoinButton")] [assembly: AssemblyTitle("RunawayJoinButton")] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [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 RunawayJoinButton { [BepInPlugin("ZaboomafooW.RunawayJoinButton", "RunawayJoinButton", "1.0.0")] public sealed class Plugin : BaseUnityPlugin { public const string PluginGuid = "ZaboomafooW.RunawayJoinButton"; public const string PluginName = "RunawayJoinButton"; public const string PluginVersion = "1.0.0"; private Harmony _harmony; internal static ManualLogSource ModLogger { get; private set; } private void Awake() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown ModLogger = ((BaseUnityPlugin)this).Logger; _harmony = new Harmony("ZaboomafooW.RunawayJoinButton"); _harmony.PatchAll(); ModLogger.LogInfo((object)"[RunawayJoinButton] Loaded v1.0.0"); } private void OnApplicationQuit() { if (_harmony != null) { _harmony.UnpatchSelf(); _harmony = null; } } } } namespace RunawayJoinButton.Patches { [HarmonyPatch(typeof(LobbySlot), "Awake")] internal static class LobbySlotAwakePatch { private static bool _hookSuccessLogged; private static bool _hookFailureLogged; [HarmonyPostfix] private static void Postfix(LobbySlot __instance) { Button val = FindJoinButton(__instance); if ((Object)(object)val == (Object)null) { if (!_hookFailureLogged) { _hookFailureLogged = true; Plugin.ModLogger.LogError((object)"[RunawayJoinButton] Hook failed: no serialized Button listener targeting LobbySlot.JoinButton was found under a LobbySlot."); } return; } Transform transform = ((Component)val).transform; RectTransform val2 = (RectTransform)(object)((transform is RectTransform) ? transform : null); if ((Object)(object)val2 == (Object)null) { if (!_hookFailureLogged) { _hookFailureLogged = true; Plugin.ModLogger.LogError((object)"[RunawayJoinButton] Hook failed: the verified lobby Join button did not expose a RectTransform."); } } else if (!((Object)(object)((Component)val).GetComponent() != (Object)null)) { ((Component)val).gameObject.AddComponent().Initialize(val2); if (!_hookSuccessLogged) { _hookSuccessLogged = true; Plugin.ModLogger.LogInfo((object)"[RunawayJoinButton] Hook succeeded: bound the serialized LobbySlot.JoinButton control for server rows."); } } } private static Button FindJoinButton(LobbySlot lobbySlot) { Button[] componentsInChildren = ((Component)lobbySlot).GetComponentsInChildren