Пример #1
0
    private void OnGUI()
    {
        if (!Chat.show)
        {
            return;
        }
        GUI.color = this.c;
        if (Chat.flag == 1)
        {
            GUI.DrawTexture(this.rBack, this.tTeam[BasePlayer.team]);
        }
        else
        {
            GUI.DrawTexture(this.rBack, this.tBlack);
        }
        GUI.color = Color.white;
        GUI2.DrawEditRes(this.rEdit, ref this.message, TextAnchor.MiddleLeft, _Color.White, 0, 12, true);
        char character = Event.current.character;

        if ((character < 'а' || character > 'я') && (character < 'А' || character > 'Я') && (character < 'a' || character > 'z') && (character < 'A' || character > 'Z') && (character < '0' || character > '9') && character != ' ' && character != '_' && character != '.' && character != '?' && character != '!' && character != '(' && character != ')' && character != ':' && character != '.' && character != ',')
        {
            Event.current.character = '\0';
        }
        if (Event.current.isKey)
        {
            KeyCode keyCode = Event.current.keyCode;
            if (keyCode == KeyCode.Return || keyCode == KeyCode.KeypadEnter)
            {
                if (this.message != string.Empty)
                {
                    Client.cs.send_chat(Chat.flag, this.message);
                }
                Screen.lockCursor = true;
                this.message      = string.Empty;
                Event.current.Use();
                Chat.Toggle();
            }
        }
    }