Ejemplo n.º 1
0
        // Token: 0x060027C7 RID: 10183 RVA: 0x000F0C2C File Offset: 0x000EF02C
        public static void list(CSteamID steamID, EChatMode mode, Color color, bool isRich, string text)
        {
            text = text.Trim();
            if (OptionsSettings.filter)
            {
                text = ChatManager.filter(text);
            }
            if (OptionsSettings.streamer)
            {
                color = Color.white;
            }
            SteamPlayer steamPlayer = null;
            string      text2;

            if (steamID == CSteamID.Nil)
            {
                text2 = Provider.localization.format("Say");
            }
            else
            {
                steamPlayer = PlayerTool.getSteamPlayer(steamID);
                if (steamPlayer == null)
                {
                    return;
                }
                if (!OptionsSettings.chatText && steamPlayer.playerID.steamID != Provider.client)
                {
                    return;
                }
                if (steamPlayer.player.quests.isMemberOfSameGroupAs(Player.player))
                {
                    if (steamPlayer.playerID.nickName != string.Empty && steamPlayer.playerID.steamID != Provider.client)
                    {
                        text2 = steamPlayer.playerID.nickName;
                    }
                    else
                    {
                        text2 = steamPlayer.playerID.characterName;
                    }
                }
                else
                {
                    text2 = steamPlayer.playerID.characterName;
                }
            }
            for (int i = ChatManager.chat.Length - 1; i > 0; i--)
            {
                if (ChatManager.chat[i - 1] != null)
                {
                    if (ChatManager.chat[i] == null)
                    {
                        ChatManager.chat[i] = new Chat(ChatManager.chat[i - 1].player, ChatManager.chat[i - 1].mode, ChatManager.chat[i - 1].color, ChatManager.chat[i - 1].isRich, ChatManager.chat[i - 1].speaker, ChatManager.chat[i - 1].text);
                    }
                    else
                    {
                        ChatManager.chat[i].player  = ChatManager.chat[i - 1].player;
                        ChatManager.chat[i].mode    = ChatManager.chat[i - 1].mode;
                        ChatManager.chat[i].color   = ChatManager.chat[i - 1].color;
                        ChatManager.chat[i].isRich  = ChatManager.chat[i - 1].isRich;
                        ChatManager.chat[i].speaker = ChatManager.chat[i - 1].speaker;
                        ChatManager.chat[i].text    = ChatManager.chat[i - 1].text;
                    }
                }
            }
            if (ChatManager.chat[0] == null)
            {
                ChatManager.chat[0] = new Chat(steamPlayer, mode, color, isRich, text2, text);
            }
            else
            {
                ChatManager.chat[0].player  = steamPlayer;
                ChatManager.chat[0].mode    = mode;
                ChatManager.chat[0].color   = color;
                ChatManager.chat[0].isRich  = isRich;
                ChatManager.chat[0].speaker = text2;
                ChatManager.chat[0].text    = text;
            }
            if (ChatManager.onListed != null)
            {
                ChatManager.onListed();
            }
        }