using 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+9bdb6bd1e340897dee37a25944f64aaf05ae402b")] [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 EnableConfiguration; public ExtendedConfigEntry proximityChat; public ExtendedConfigEntry proximityRange; public ExtendedConfigEntry outOfRangeMessage; public ExtendedConfigEntry lateTargetAlpha; public ExtendedConfigEntry startMessageEnabled; public ExtendedConfigEntry fadeDelay; public ExtendedConfigEntry startAlpha; public ExtendedConfigEntry messageLimit; public ExtendedConfigEntry chatBox_X; public ExtendedConfigEntry chatBox_Y; public ExtendedConfigEntry deadPlayerTransmitBlock; public ConfigManager() { BindConfigs(); ClearUnusedEntries(); } private void BindConfigs() { EnableConfiguration = new ExtendedConfigEntry("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("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("General Settings", "ProximityRange", 20f, "Transmit range of the proximity chat.", useEnableConfiguration: true); outOfRangeMessage = new ExtendedConfigEntry("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("General Settings", "AfterFadeVisibility", 0.2f, "How visible the chat box is going to be after fading.", useEnableConfiguration: true); startMessageEnabled = new ExtendedConfigEntry("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("General Settings", "FadeDelay", 4f, "How long the chat box will stay visible before fading.", useEnableConfiguration: true); startAlpha = new ExtendedConfigEntry("General Settings", "BeforeFadeVisibility", 1f, "How visible the chat box is going to be before fading.", useEnableConfiguration: true); messageLimit = new ExtendedConfigEntry("General Settings", "MessageLimit", 4, "How many messages will be shown on the screen.", useEnableConfiguration: true); chatBox_X = new ExtendedConfigEntry("General Settings", "ChatBox_X", 107f, "ChatBox X position.", useEnableConfiguration: true); chatBox_Y = new ExtendedConfigEntry("General Settings", "ChatBox_Y", 100f, "ChatBox Y position.", useEnableConfiguration: true); deadPlayerTransmitBlock = new ExtendedConfigEntry("General Settings", "DeadPlayerTransmitBlock", defaultValue: false, "If enabled, you won't be able to send messages when dead.", useEnableConfiguration: true); } private void ClearUnusedEntries() { ConfigFile config = ((BaseUnityPlugin)ChatBox.Instance).Config; PropertyInfo property = ((object)config).GetType().GetProperty("OrphanedEntries", BindingFlags.Instance | BindingFlags.NonPublic); Dictionary dictionary = (Dictionary)property.GetValue(config, null); dictionary.Clear(); config.Save(); } } public class ExtendedConfigEntry { public ConfigEntry ConfigEntry; public Func GetValue; public Action 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(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(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.3.0")] public class ChatBox : BaseUnityPlugin { public static class PluginInfo { public const string Guid = "ChatBox-UnloadedHangar"; public const string Name = "ChatBox"; public const string Ver = "1.3.0"; } 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 : 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(); } } 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.Instance).gameObject; ((Object)ChatObject).name = "ChatObject"; ChatObject.transform.parent = ((Component)((Component)GoalUI.instance).transform.parent).transform; ChatObject.layer = 5; ChatObject.AddComponent(); return; } catch (Exception arg) { ChatBox.logger.LogError((object)$"Construction error {arg}"); return; } } if (SemiFunc.RunIsLobbyMenu()) { try { ChatObjectMenu = ((Component)Singleton.Instance).gameObject; ((Object)ChatObjectMenu).name = "ChatObjectMenu"; ChatObjectMenu.transform.parent = ((Component)((Component)GoalUI.instance).transform.parent).transform; ChatObjectMenu.layer = 5; ChatObjectMenu.AddComponent(); } 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); if (ChatBox.ConfigManager.deadPlayerTransmitBlock.Value && SemiFunc.PlayerAvatarLocal().deadSet) { NonPatches.Instance.AddChatMessageSystem(" \n Comms array offline!", "FF0000", "System"); } else if (!ChatBox.ConfigManager.deadPlayerTransmitBlock.Value && SemiFunc.PlayerAvatarLocal().deadSet) { val.RPC("BridgedMessage", (RpcTarget)0, new object[4] { ChatManager.instance.chatMessage, NonPatches.Instance.GetLocalPlayerColorSafe(), PlayerAvatar.instance.playerName, SemiFunc.PlayerAvatarLocal().deadSet }); } else { val.RPC("BridgedMessage", (RpcTarget)0, new object[4] { ChatManager.instance.chatMessage, NonPatches.Instance.GetLocalPlayerColorSafe(), PlayerAvatar.instance.playerName, false }); } } } 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(); val.AddComponent().ViewID = 789546446; } } } namespace ChatBox.NonPatch { public class NonPatches : MonoBehaviour { [CompilerGenerated] private sealed class d__20 : IEnumerator, 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.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__20(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 ChatMessageHistory = new List(); 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(), 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()).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)) ? (" " + nameOfUserWhoTyped + " : " + chatMessage + " ") : (" " + chatMessage + " ")); ChatMessageHistory.Add(item); ((TMP_Text)ChatObject.ChatObjectInterface.GetComponent()).text = ""; for (int i = 0; ChatMessageHistory.Count > i; i++) { TextMeshProUGUI component = ChatObject.ChatObjectInterface.GetComponent(); ((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()).text = ""; } } } internal void AddChatMessageSystem(string chatMessage, string hexColorOfPlayerWhoTyped, string nameOfUserWhoTyped = "") { lastChatMessage = chatMessage; FadeChatTarget(ChatObject.ChatObjectInterface.GetComponent(), 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()).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)) ? (" " + nameOfUserWhoTyped + " : " + chatMessage + " ") : (" " + chatMessage + " ")); ChatMessageHistory.Add(item); ((TMP_Text)ChatObject.ChatObjectInterface.GetComponent()).text = ""; for (int i = 0; ChatMessageHistory.Count > i; i++) { TextMeshProUGUI component = ChatObject.ChatObjectInterface.GetComponent(); ((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()).text = ""; } } internal void AddChatMessageDead(string chatMessage, string hexColorOfPlayerWhoTyped, string nameOfUserWhoTyped = "") { if (!(lastChatMessage == chatMessage)) { lastChatMessage = chatMessage; FadeChatTarget(ChatObject.ChatObjectInterface.GetComponent(), 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()).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)) ? (" " + nameOfUserWhoTyped + " : " + chatMessage + " ") : (" " + chatMessage + " ")); ChatMessageHistory.Add(item); ((TMP_Text)ChatObject.ChatObjectInterface.GetComponent()).text = ""; for (int i = 0; ChatMessageHistory.Count > i; i++) { TextMeshProUGUI component = ChatObject.ChatObjectInterface.GetComponent(); ((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()).text = ""; } } } private void AddChatMessageGradient(string chatMessage, string hexColorOfPlayerWhoTyped, string nameOfUserWhoTyped = "") { lastChatMessage = chatMessage; FadeChatTarget(ChatObject.ChatObjectInterface.GetComponent(), 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()).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)) ? (" " + nameOfUserWhoTyped + " : " + chatMessage + " ") : (" " + chatMessage + " ")); ChatMessageHistory.Add(item); ((TMP_Text)ChatObject.ChatObjectInterface.GetComponent()).text = ""; for (int i = 0; ChatMessageHistory.Count > i; i++) { TextMeshProUGUI component = ChatObject.ChatObjectInterface.GetComponent(); ((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()).text = ""; } } [PunRPC] internal void BridgedMessage(string message, string playerHexColor, string playerName, bool dead = false) { if (SemiFunc.RunIsLobby()) { Instance.AddChatMessage(message, playerHexColor, playerName); } else if (!ChatBox.ConfigManager.deadPlayerTransmitBlock.Value && dead && ChatBox.ConfigManager.proximityChat.Value && CheckDistanceOnNetworkCall(playerName)) { Instance.AddChatMessageDead(message, playerHexColor, playerName); } else if (!ChatBox.ConfigManager.deadPlayerTransmitBlock.Value && dead) { Instance.AddChatMessageDead(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("", "ff0000", "Unknown"); } } internal Dictionary GenerateNameDictionary() { Dictionary dictionary = new Dictionary(); 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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) if (GameDirector.instance.PlayerList.Count > index) { return MetaManager.instance.colorsUIOrder[GameDirector.instance.PlayerList[index].playerCosmetics.colorsEquipped[5]].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(d__20))] private IEnumerator IFadeChat(TextMeshProUGUI target, float fadeDelay, float targetAlpha) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__20(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_005a: 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(MetaManager.instance.colorsUIOrder[GameDirector.instance.PlayerList[i].playerCosmetics.colorsEquipped[5]].color); } } return ""; } internal TMP_ColorGradient ProccessLocalPlayerColorIntoGradientSafe() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: 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) { TMP_ColorGradient val = new TMP_ColorGradient(); val.colorMode = (ColorMode)2; val.topLeft = MetaManager.instance.colorsUIOrder[GameDirector.instance.PlayerList[i].playerCosmetics.colorsEquipped[5]].color; val.topRight = MetaManager.instance.colorsUIOrder[GameDirector.instance.PlayerList[i].playerCosmetics.colorsEquipped[6]].color; val.bottomLeft = MetaManager.instance.colorsUIOrder[GameDirector.instance.PlayerList[i].playerCosmetics.colorsEquipped[7]].color; val.bottomRight = MetaManager.instance.colorsUIOrder[GameDirector.instance.PlayerList[i].playerCosmetics.colorsEquipped[8]].color; return val; } } return null; } } } 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_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0137: 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(); ChatObjectInterface.AddComponent(); ((TMP_Text)ChatObjectInterface.GetComponent()).fontSize = 12f; ((TMP_Text)ChatObjectInterface.GetComponent()).characterSpacing = -3.77f; ((TMP_Text)ChatObjectInterface.GetComponent()).lineSpacing = -10f; ((TMP_Text)ChatObjectInterface.GetComponent()).alignment = (TextAlignmentOptions)1025; ((TMP_Text)ChatObjectInterface.GetComponent()).enableVertexGradient = true; if (ChatBox.ConfigManager.startMessageEnabled.Value) { ((TMP_Text)ChatObjectInterface.GetComponent()).text = "TAXMAN: ChatBox active! \n"; NonPatches.Instance.ChatMessageHistory.Add("TAXMAN: ChatBox active! \n"); } NonPatches.SetChatObjectCoords(); } else if (SemiFunc.RunIsLobbyMenu()) { ChatObjectInterface = new GameObject("ChatObjectInterface"); ChatObjectInterface.transform.parent = Patches.ChatObjectMenu.transform; ChatObjectInterface.layer = 5; ChatObjectInterface.AddComponent(); ChatObjectInterface.AddComponent(); ((TMP_Text)ChatObjectInterface.GetComponent()).fontSize = 12f; ((TMP_Text)ChatObjectInterface.GetComponent()).characterSpacing = -3.77f; ((TMP_Text)ChatObjectInterface.GetComponent()).lineSpacing = -10f; ((TMP_Text)ChatObjectInterface.GetComponent()).alignment = (TextAlignmentOptions)1025; ((TMP_Text)ChatObjectInterface.GetComponent()).enableVertexGradient = true; if (ChatBox.ConfigManager.startMessageEnabled.Value) { ((TMP_Text)ChatObjectInterface.GetComponent()).text = "TAXMAN: ChatBox active! \n"; NonPatches.Instance.ChatMessageHistory.Add("TAXMAN: ChatBox active! \n"); } NonPatches.SetChatObjectMenuCoords(); } } } }