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 ChatBox v1.2.2
ChatBox.dll
Decompiled 4 months 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 System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using ChatBox.NonPatch; using ChatBox.Patch; using ChatBox.Single; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using TMPro; using Unity.VisualScripting; using UnityEngine; using UnityEngine.UI; [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: AssemblyCompany("ChatBox")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+26b5479a106fc4f560eecec2d7a10d2157aaaf4e")] [assembly: AssemblyProduct("ChatBox")] [assembly: AssemblyTitle("ChatBox")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.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.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; } } [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 ChatBox { internal class ConfigManager { public ExtendedConfigEntry<bool> EnableConfiguration; public ExtendedConfigEntry<bool> proximityChat; public ExtendedConfigEntry<float> proximityRange; public ExtendedConfigEntry<bool> outOfRangeMessage; public ExtendedConfigEntry<float> lateTargetAlpha; public ExtendedConfigEntry<bool> startMessageEnabled; public ExtendedConfigEntry<float> fadeDelay; public ExtendedConfigEntry<float> startAlpha; public ExtendedConfigEntry<int> messageLimit; public ExtendedConfigEntry<float> chatBox_X; public ExtendedConfigEntry<float> chatBox_Y; public ConfigManager() { BindConfigs(); ClearUnusedEntries(); } private void BindConfigs() { EnableConfiguration = new ExtendedConfigEntry<bool>("General Settings", "EnableConfiguration", defaultValue: false, "Enable if you want to use custom set config setting values. If disabled, the default config setting values will be used."); proximityChat = new ExtendedConfigEntry<bool>("General Settings", "ProximityChat", defaultValue: false, "If enabled, your messages will only send to players that are within the set range of your position.", useEnableConfiguration: true); proximityRange = new ExtendedConfigEntry<float>("General Settings", "ProximityRange", 20f, "Transmit range of the proximity chat.", useEnableConfiguration: true); outOfRangeMessage = new ExtendedConfigEntry<bool>("General Settings", "OutOfRangeMessage", defaultValue: false, "If message sender is further than the set range, you will receive an error message in the chat instead of the message being ignored completely.", useEnableConfiguration: true); lateTargetAlpha = new ExtendedConfigEntry<float>("General Settings", "AfterFadeVisibility", 0.2f, "How visible the chat box is going to be after fading.", useEnableConfiguration: true); startMessageEnabled = new ExtendedConfigEntry<bool>("General Settings", "StartMessageEnabled", defaultValue: true, "If enabled, TAXMAN will post 'ChatBox active!' in the chat each time a level starts.", useEnableConfiguration: true); fadeDelay = new ExtendedConfigEntry<float>("General Settings", "FadeDelay", 4f, "How long the chat box will stay visible before fading.", useEnableConfiguration: true); startAlpha = new ExtendedConfigEntry<float>("General Settings", "BeforeFadeVisibility", 1f, "How visible the chat box is going to be before fading.", useEnableConfiguration: true); messageLimit = new ExtendedConfigEntry<int>("General Settings", "MessageLimit", 4, "How many messages will be shown on the screen.", useEnableConfiguration: true); chatBox_X = new ExtendedConfigEntry<float>("General Settings", "ChatBox_X", 107f, "ChatBox X position.", useEnableConfiguration: true); chatBox_Y = new ExtendedConfigEntry<float>("General Settings", "ChatBox_Y", 100f, "ChatBox Y position.", useEnableConfiguration: true); } private void ClearUnusedEntries() { ConfigFile config = ((BaseUnityPlugin)ChatBox.Instance).Config; PropertyInfo property = ((object)config).GetType().GetProperty("OrphanedEntries", BindingFlags.Instance | BindingFlags.NonPublic); Dictionary<ConfigDefinition, string> dictionary = (Dictionary<ConfigDefinition, string>)property.GetValue(config, null); dictionary.Clear(); config.Save(); } } public class ExtendedConfigEntry<T> { public ConfigEntry<T> ConfigEntry; public Func<T> GetValue; public Action<T> SetValue; public bool UseEnableConfiguration = false; public T DefaultValue => (T)((ConfigEntryBase)ConfigEntry).DefaultValue; public T Value { get { return GetValue(); } set { SetValue(value); } } public ExtendedConfigEntry(string section, string key, T defaultValue, string description, bool useEnableConfiguration = false) { ConfigEntry = ((BaseUnityPlugin)ChatBox.Instance).Config.Bind<T>(section, key, defaultValue, description); UseEnableConfiguration = useEnableConfiguration; Initialize(); } public ExtendedConfigEntry(string section, string key, T defaultValue, ConfigDescription configDescription = null, bool useEnableConfiguration = false) { ConfigEntry = ((BaseUnityPlugin)ChatBox.Instance).Config.Bind<T>(section, key, defaultValue, configDescription); UseEnableConfiguration = useEnableConfiguration; Initialize(); } private void Initialize() { if (GetValue == null) { GetValue = () => (UseEnableConfiguration && !ChatBox.ConfigManager.EnableConfiguration.Value) ? DefaultValue : ConfigEntry.Value; } if (SetValue == null) { SetValue = delegate(T value) { ConfigEntry.Value = value; }; } } public void ResetToDefault() { ConfigEntry.Value = (T)((ConfigEntryBase)ConfigEntry).DefaultValue; } } [BepInPlugin("ChatBox-UnloadedHangar", "ChatBox", "1.2.2")] public class ChatBox : BaseUnityPlugin { public static class PluginInfo { public const string Guid = "ChatBox-UnloadedHangar"; public const string Name = "ChatBox"; public const string Ver = "1.2.2"; } internal static ManualLogSource logger; internal static ChatBox Instance; internal static ConfigManager ConfigManager; private Harmony _harmony; private void Awake() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown if ((Object)(object)Instance == (Object)null) { Instance = this; } logger = Logger.CreateLogSource("ChatBox-UnloadedHangar"); logger.LogInfo((object)"ChatBox-UnloadedHangar loaded"); ConfigManager = new ConfigManager(); _harmony = new Harmony("ChatBox-UnloadedHangar"); _harmony.PatchAll(); } } public class Singleton<T> : MonoBehaviour where T : Component { private static T _instance; public static T Instance { get { //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Expected O, but got Unknown if ((Object)(object)_instance == (Object)null) { T[] array = Object.FindObjectsOfType(typeof(T)) as T[]; if (array.Length != 0) { _instance = array[0]; } if (array.Length > 1) { ChatBox.logger.LogError((object)("There is more than one " + typeof(T).Name + " in the scene.")); } if ((Object)(object)_instance == (Object)null) { GameObject val = new GameObject(); ((Object)val).name = "_" + typeof(T).Name; _instance = val.AddComponent<T>(); } } return _instance; } } } } namespace ChatBox.Patch { [HarmonyPatch] internal class Patches : MonoBehaviour { internal static int i; internal static GameObject ChatObject; internal static GameObject ChatObjectMenu; [HarmonyPrefix] [HarmonyPatch(typeof(GameDirector), "Start")] private static void FlashlightPatch() { if (SemiFunc.IsMultiplayer() & (SemiFunc.RunIsLevel() | SemiFunc.RunIsShop() | SemiFunc.RunIsLobby())) { try { ChatObject = ((Component)Singleton<global::ChatBox.Single.ChatObject>.Instance).gameObject; ((Object)ChatObject).name = "ChatObject"; ChatObject.transform.parent = ((Component)((Component)GoalUI.instance).transform.parent).transform; ChatObject.layer = 5; ChatObject.AddComponent<RectTransform>(); return; } catch (Exception arg) { ChatBox.logger.LogError((object)$"Construction error {arg}"); return; } } if (SemiFunc.RunIsLobbyMenu()) { try { ChatObjectMenu = ((Component)Singleton<global::ChatBox.Single.ChatObject>.Instance).gameObject; ((Object)ChatObjectMenu).name = "ChatObjectMenu"; ChatObjectMenu.transform.parent = ((Component)((Component)GoalUI.instance).transform.parent).transform; ChatObjectMenu.layer = 5; ChatObjectMenu.AddComponent<RectTransform>(); } catch (Exception arg2) { ChatBox.logger.LogError((object)$"Lobby construction error {arg2}"); } } } [HarmonyPrefix] [HarmonyPatch(typeof(ChatManager), "StateActive")] private static void ChatManagerPatch() { try { if (SemiFunc.InputDown((InputKey)9) && ChatManager.instance.chatMessage != "") { PhotonView val = PhotonView.Get((Component)(object)NonPatches.Instance); val.RPC("BridgedMessage", (RpcTarget)0, new object[3] { ChatManager.instance.chatMessage, NonPatches.Instance.GetLocalPlayerColorSafe(), PlayerAvatar.instance.playerName }); } } catch (Exception arg) { ChatBox.logger.LogError((object)$"Unsupported chat action! {arg}"); } } [HarmonyPrefix] [HarmonyPatch(typeof(GameDirector), "Start")] private static void ObjectSpawnPatch() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown GameObject val = new GameObject("NonPatchesObj"); val.AddComponent<NonPatches>(); val.AddComponent<PhotonView>().ViewID = 789546446; } } } namespace ChatBox.NonPatch { public class NonPatches : MonoBehaviour { [CompilerGenerated] private sealed class <IFadeChat>d__18 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public TextMeshProUGUI target; public float fadeDelay; public float targetAlpha; public NonPatches <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <IFadeChat>d__18(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(fadeDelay); <>1__state = 1; return true; case 1: <>1__state = -1; ((Graphic)target).color = new Color(1f, 1f, 1f, targetAlpha); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public string lastChatMessage = ""; public List<string> ChatMessageHistory = new List<string>(); internal string MessageText = ""; internal string MessageTextInserted = ""; public static NonPatches Instance { get; private set; } private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } } [Obsolete("Inefficient", true)] internal int CheckMessageLimit() { if (ChatBox.ConfigManager.messageLimit.Value.ToString().Contains("-")) { ChatBox.ConfigManager.messageLimit.Value = ChatBox.ConfigManager.messageLimit.DefaultValue; ChatBox.logger.LogWarning((object)"Negative number detected in MessageLimit variable, reseting to default value to avoid conflicts..."); return 1; } return 0; } internal void AddChatMessage(string chatMessage, string hexColorOfPlayerWhoTyped, string nameOfUserWhoTyped = "") { if (!(lastChatMessage == chatMessage)) { lastChatMessage = chatMessage; FadeChatTarget(ChatObject.ChatObjectInterface.GetComponent<TextMeshProUGUI>(), ChatBox.ConfigManager.fadeDelay.Value, ChatBox.ConfigManager.startAlpha.Value, ChatBox.ConfigManager.lateTargetAlpha.Value); if ((float)ChatMessageHistory.Count >= Mathf.Clamp((float)ChatBox.ConfigManager.messageLimit.Value, 4f, float.PositiveInfinity)) { ((TMP_Text)ChatObject.ChatObjectInterface.GetComponent<TextMeshProUGUI>()).text.Remove(0, ChatMessageHistory[0].Length); ChatMessageHistory.Remove(ChatMessageHistory[0]); } StringBuilder stringBuilder = new StringBuilder(chatMessage); stringBuilder.Replace("@player1", GetLobbyPlayerNameSafe(0)); stringBuilder.Replace("@player2", GetLobbyPlayerNameSafe(1)); stringBuilder.Replace("@player3", GetLobbyPlayerNameSafe(2)); stringBuilder.Replace("@player4", GetLobbyPlayerNameSafe(3)); stringBuilder.Replace("@player5", GetLobbyPlayerNameSafe(4)); stringBuilder.Replace("@player6", GetLobbyPlayerNameSafe(5)); chatMessage = stringBuilder.ToString(); string item = ((!string.IsNullOrEmpty(nameOfUserWhoTyped)) ? ("<color=#" + hexColorOfPlayerWhoTyped + "> " + nameOfUserWhoTyped + " </color>: <color=white> " + chatMessage + " </color>") : ("<color=#7069ff> " + chatMessage + " </color>")); ChatMessageHistory.Add(item); ((TMP_Text)ChatObject.ChatObjectInterface.GetComponent<TextMeshProUGUI>()).text = ""; for (int i = 0; ChatMessageHistory.Count > i; i++) { TextMeshProUGUI component = ChatObject.ChatObjectInterface.GetComponent<TextMeshProUGUI>(); ((TMP_Text)component).text = ((TMP_Text)component).text + "\n" + ChatMessageHistory[i]; } if (chatMessage == "/clearchat" && PhotonNetwork.MasterClient.NickName == nameOfUserWhoTyped) { ChatMessageHistory.Clear(); ((TMP_Text)ChatObject.ChatObjectInterface.GetComponent<TextMeshProUGUI>()).text = ""; } } } private void AddChatMessageSystem(string chatMessage, string hexColorOfPlayerWhoTyped, string nameOfUserWhoTyped = "") { lastChatMessage = chatMessage; FadeChatTarget(ChatObject.ChatObjectInterface.GetComponent<TextMeshProUGUI>(), ChatBox.ConfigManager.fadeDelay.Value, ChatBox.ConfigManager.startAlpha.Value, ChatBox.ConfigManager.lateTargetAlpha.Value); if ((float)ChatMessageHistory.Count >= Mathf.Clamp((float)ChatBox.ConfigManager.messageLimit.Value, 4f, float.PositiveInfinity)) { ((TMP_Text)ChatObject.ChatObjectInterface.GetComponent<TextMeshProUGUI>()).text.Remove(0, ChatMessageHistory[0].Length); ChatMessageHistory.Remove(ChatMessageHistory[0]); } StringBuilder stringBuilder = new StringBuilder(chatMessage); stringBuilder.Replace("@player1", GetLobbyPlayerNameSafe(0)); stringBuilder.Replace("@player2", GetLobbyPlayerNameSafe(1)); stringBuilder.Replace("@player3", GetLobbyPlayerNameSafe(2)); stringBuilder.Replace("@player4", GetLobbyPlayerNameSafe(3)); stringBuilder.Replace("@player5", GetLobbyPlayerNameSafe(4)); stringBuilder.Replace("@player6", GetLobbyPlayerNameSafe(5)); chatMessage = stringBuilder.ToString(); string item = ((!string.IsNullOrEmpty(nameOfUserWhoTyped)) ? ("<color=#" + hexColorOfPlayerWhoTyped + "> " + nameOfUserWhoTyped + " </color>: <color=white> " + chatMessage + " </color>") : ("<color=#7069ff> " + chatMessage + " </color>")); ChatMessageHistory.Add(item); ((TMP_Text)ChatObject.ChatObjectInterface.GetComponent<TextMeshProUGUI>()).text = ""; for (int i = 0; ChatMessageHistory.Count > i; i++) { TextMeshProUGUI component = ChatObject.ChatObjectInterface.GetComponent<TextMeshProUGUI>(); ((TMP_Text)component).text = ((TMP_Text)component).text + "\n" + ChatMessageHistory[i]; } if (chatMessage == "/clearchat" && PhotonNetwork.MasterClient.NickName == nameOfUserWhoTyped) { ChatMessageHistory.Clear(); ((TMP_Text)ChatObject.ChatObjectInterface.GetComponent<TextMeshProUGUI>()).text = ""; } } [PunRPC] internal void BridgedMessage(string message, string playerHexColor, string playerName) { if (SemiFunc.RunIsLobby()) { Instance.AddChatMessage(message, playerHexColor, playerName); } else if (!ChatBox.ConfigManager.proximityChat.Value || playerName == PlayerAvatar.instance.playerName) { Instance.AddChatMessage(message, playerHexColor, playerName); } else if (CheckDistanceOnNetworkCall(playerName)) { Instance.AddChatMessage(message, playerHexColor, playerName); } else if (!CheckDistanceOnNetworkCall(playerName) && ChatBox.ConfigManager.outOfRangeMessage.Value) { Instance.AddChatMessageSystem("<decoding failed>", "ff0000", "Unknown"); } } internal Dictionary<string, PlayerAvatar> GenerateNameDictionary() { Dictionary<string, PlayerAvatar> dictionary = new Dictionary<string, PlayerAvatar>(); for (int i = 0; GameDirector.instance.PlayerList.Count > i; i++) { dictionary.Add(GameDirector.instance.PlayerList[i].playerName, GameDirector.instance.PlayerList[i]); } return dictionary; } internal bool CheckDistanceOnNetworkCall(string playerName) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) GenerateNameDictionary().TryGetValue(playerName, out PlayerAvatar value); if (SemiFunc.PlayerLocalDistance(value.clientPosition) <= ChatBox.ConfigManager.proximityRange.Value) { return true; } return false; } internal string GetLobbyPlayerNameSafe(int index) { if (GameDirector.instance.PlayerList.Count > index) { return GameDirector.instance.PlayerList[index].playerName; } return "Empty slot"; } internal Color GetLobbyPlayerColorSafe(int index) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) if (GameDirector.instance.PlayerList.Count > index) { return GameDirector.instance.PlayerList[index].playerAvatarVisuals.color; } return Color.gray; } public void FadeChatTarget(TextMeshProUGUI target, float fadeDelay = 2f, float startAlpha = 1f, float lateTargetAlpha = 0.2f) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) Coroutine val = ((MonoBehaviour)this).StartCoroutine(IFadeChat(target, fadeDelay, lateTargetAlpha)); if (fadeDelay == 0f && startAlpha == lateTargetAlpha) { ((Graphic)target).color = new Color(1f, 1f, 1f, lateTargetAlpha); return; } ((Graphic)target).color = new Color(1f, 1f, 1f, startAlpha); if (val != null) { ((MonoBehaviour)this).StopCoroutine(val); } val = ((MonoBehaviour)this).StartCoroutine(IFadeChat(target, fadeDelay, lateTargetAlpha)); } [IteratorStateMachine(typeof(<IFadeChat>d__18))] private IEnumerator IFadeChat(TextMeshProUGUI target, float fadeDelay, float targetAlpha) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <IFadeChat>d__18(0) { <>4__this = this, target = target, fadeDelay = fadeDelay, targetAlpha = targetAlpha }; } internal static void SetChatObjectCoords() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) Patches.ChatObject.transform.position = new Vector3(ChatBox.ConfigManager.chatBox_X.Value, ChatBox.ConfigManager.chatBox_Y.Value, 0f); } internal static void SetChatObjectMenuCoords() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) Patches.ChatObjectMenu.transform.position = new Vector3(615f, 100f, 0f); } internal string GetLocalPlayerColorSafe() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; GameDirector.instance.PlayerList.Count > i; i++) { if (GameDirector.instance.PlayerList[i].playerName == PlayerAvatar.instance.playerName) { return XColor.ToHexString(GameDirector.instance.PlayerList[i].playerAvatarVisuals.color); } } return ""; } } } namespace ChatBox.LogClass { [Obsolete] internal class Log { [Obsolete] internal static ManualLogSource logSource; [Obsolete] internal static void Initalize(ManualLogSource LogSource) { logSource = LogSource; } [Obsolete] internal static void LogDebug(object data) { logSource.LogDebug(data); } [Obsolete] internal static void LogError(object data) { logSource.LogError(data); } [Obsolete] internal static void LogFatal(object data) { logSource.LogFatal(data); } [Obsolete] internal static void LogInfo(object data) { logSource.LogInfo(data); } [Obsolete] internal static void LogMessage(object data) { logSource.LogMessage(data); } [Obsolete] internal static void LogWarning(object data) { logSource.LogWarning(data); } } } namespace ChatBox.Single { internal class ChatObject : MonoBehaviour { internal static GameObject ChatObjectInterface; internal static ChatObject instance { get; private set; } private void Awake() { if ((Object)(object)instance == (Object)null) { instance = this; } } private void Start() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Expected O, but got Unknown if (SemiFunc.IsMultiplayer() & (SemiFunc.RunIsLevel() | SemiFunc.RunIsShop() | SemiFunc.RunIsLobby())) { ChatObjectInterface = new GameObject("ChatObjectInterface"); ChatObjectInterface.transform.parent = Patches.ChatObject.transform; ChatObjectInterface.layer = 5; ChatObjectInterface.AddComponent<RectTransform>(); ChatObjectInterface.AddComponent<TextMeshProUGUI>(); ((TMP_Text)ChatObjectInterface.GetComponent<TextMeshProUGUI>()).fontSize = 12f; ((TMP_Text)ChatObjectInterface.GetComponent<TextMeshProUGUI>()).characterSpacing = -3.77f; ((TMP_Text)ChatObjectInterface.GetComponent<TextMeshProUGUI>()).lineSpacing = -10f; ((TMP_Text)ChatObjectInterface.GetComponent<TextMeshProUGUI>()).alignment = (TextAlignmentOptions)1025; if (ChatBox.ConfigManager.startMessageEnabled.Value) { ((TMP_Text)ChatObjectInterface.GetComponent<TextMeshProUGUI>()).text = "<color=red>TAXMAN</color>: <color=white>ChatBox active!</color> \n"; NonPatches.Instance.ChatMessageHistory.Add("<color=red>TAXMAN</color>: <color=white>ChatBox active!</color> \n"); } NonPatches.SetChatObjectCoords(); } else if (SemiFunc.RunIsLobbyMenu()) { ChatObjectInterface = new GameObject("ChatObjectInterface"); ChatObjectInterface.transform.parent = Patches.ChatObjectMenu.transform; ChatObjectInterface.layer = 5; ChatObjectInterface.AddComponent<RectTransform>(); ChatObjectInterface.AddComponent<TextMeshProUGUI>(); ((TMP_Text)ChatObjectInterface.GetComponent<TextMeshProUGUI>()).fontSize = 12f; ((TMP_Text)ChatObjectInterface.GetComponent<TextMeshProUGUI>()).characterSpacing = -3.77f; ((TMP_Text)ChatObjectInterface.GetComponent<TextMeshProUGUI>()).lineSpacing = -10f; ((TMP_Text)ChatObjectInterface.GetComponent<TextMeshProUGUI>()).alignment = (TextAlignmentOptions)1025; if (ChatBox.ConfigManager.startMessageEnabled.Value) { ((TMP_Text)ChatObjectInterface.GetComponent<TextMeshProUGUI>()).text = "<color=red>TAXMAN</color>: <color=white>ChatBox active!</color> \n"; NonPatches.Instance.ChatMessageHistory.Add("<color=red>TAXMAN</color>: <color=white>ChatBox active!</color> \n"); } NonPatches.SetChatObjectMenuCoords(); } } } }