Exemple #1
0
    private static void TextBox(TextBoxes.Structure Tool)
    {
        Point  Position = Tool.Position;
        string Text     = Tool.Text;

        // Desenha a ferramenta
        Render_Box(Tex_TextBox, 3, Tool.Position, new Size(Tool.Width, TSize(Tex_TextBox).Height));

        // Altera todos os caracteres do texto para um em especifico, se for necessário
        if (Tool.Password && !string.IsNullOrEmpty(Text))
        {
            Text = new String('•', Text.Length);
        }

        // Quebra o texto para que caiba no digitalizador, se for necessário
        Text = Tools.TextBreak(Text, Tool.Width - 10);

        // Desenha o texto do digitalizador
        if (TextBoxes.Focused != null && (TextBoxes.Structure)TextBoxes.Focused.Data == Tool && TextBoxes.Signal)
        {
            DrawText(Text + "|", Position.X + 4, Position.Y + 2, SFML.Graphics.Color.White);
        }
        else
        {
            DrawText(Text, Position.X + 4, Position.Y + 2, SFML.Graphics.Color.White);
        }
    }
Exemple #2
0
 private static TextBoxes.Structure TextBox(BinaryReader Data)
 {
     // Lê os dados
     TextBoxes.Structure Tool = new TextBoxes.Structure();
     Tool.Name       = Data.ReadString();
     Tool.Position.X = Data.ReadInt32();
     Tool.Position.Y = Data.ReadInt32();
     Tool.Visible    = Data.ReadBoolean();
     Tool.Window     = (Tools.Windows)Data.ReadByte();
     Tool.Lenght     = Data.ReadInt16();
     Tool.Width      = Data.ReadInt16();
     Tool.Password   = Data.ReadBoolean();
     return(Tool);
 }
Exemple #3
0
    public static void Type()
    {
        TextBoxes.Structure Tool  = TextBoxes.Get("Chat");
        Panels.Structure    Panel = Panels.Get("Chat");

        // Somente se necessário
        if (!Player.IsPlaying(Player.MyIndex))
        {
            return;
        }

        // Altera a visiblidade da caixa
        Panel.Visible = !Panel.Visible;

        // Altera o foco do digitalizador
        if (Panel.Visible)
        {
            Text_Visible      = true;
            TextBoxes.Focused = Tools.Get(Tool);
            return;
        }
        else
        {
            TextBoxes.Focused = null;
        }

        // Dados
        string Message = Tool.Text;

        // Somente se necessário
        if (Message.Length < 3)
        {
            Tool.Text = string.Empty;
            return;
        }

        // Limpa a caixa de texto
        Tool.Text = string.Empty;

        // Separa as mensagens em partes
        string[] Parts = Message.Split(' ');

        // Comandos
        switch (Parts[0].ToLower())
        {
        case "/party":
            if (Parts.Length > 1)
            {
                Send.Party_Invite(Parts[1]);
            }
            break;

        case "/partyleave":
            Send.Party_Leave();
            break;

        default:
            // Mensagem lobal
            if (Message.Substring(0, 1) == "'")
            {
                Send.Message(Message.Substring(1), Game.Messages.Global);
            }
            // Mensagem particular
            else if (Message.Substring(0, 1) == "!")
            {
                // Previne erros
                if (Parts.GetUpperBound(0) < 1)
                {
                    AddText("Use: '!' + Addressee + 'Message'", Color.White);
                }
                else
                {
                    // Dados
                    string Destiny = Message.Substring(1, Parts[0].Length - 1);
                    Message = Message.Substring(Parts[0].Length + 1);

                    // Envia a mensagem
                    Send.Message(Message, Game.Messages.Private, Destiny);
                }
            }
            // Mensagem mapa
            else
            {
                Send.Message(Message, Game.Messages.Map);
            }
            break;
        }
    }