KLF.KLFChatDisplay.enqueueChatLine C# (CSharp) Method

enqueueChatLine() public static method

public static enqueueChatLine ( String line ) : void
line String
return void
        public static void enqueueChatLine(String line)
        {
            ChatLine chat_line = new ChatLine(line);

            //Check if the message has a name
            if (line.Length > 3 && line.First() == '[')
            {
                int name_length = line.IndexOf(']');
                if (name_length > 0)
                {
                    name_length = name_length - 1;
                    String name = line.Substring(1, name_length);
                    if (name == "Server")
                        chat_line.color = new Color(0.65f, 1.0f, 1.0f);
                    else
                        chat_line.color = KLFVessel.generateActiveColor(name) * NAME_COLOR_SATURATION_FACTOR
                            + Color.white * (1.0f-NAME_COLOR_SATURATION_FACTOR);
                }
            }

            chatLineQueue.Enqueue(chat_line);
            while (chatLineQueue.Count > MAX_CHAT_LINES)
                chatLineQueue.Dequeue();
            scrollPos.y += 100;
        }
KLFChatDisplay