private void CreateBtn_Click(object sender, EventArgs e)
 {
     var input = new InputFrm(info.channelTitle, info.channelMsg, info.channelCreate, info.channelCancel);
     if (input.ShowDialog() == DialogResult.OK)
     {
         Program.ChatServer.SendPacket(DevServerPackets.JoinChannel, input.InputBox.Text.Trim());
         DialogResult = DialogResult.OK;
     }
 }
 private void CreateBtn_Click(object sender, EventArgs e)
 {
     var input = new InputFrm("Create Channel", "Enter Channel Name", "Create", "Cancel");
     if (input.ShowDialog() == DialogResult.OK)
     {
         Program.ChatServer.SendPacket(DevServerPackets.JoinChannel, input.InputBox.Text.Trim());
         DialogResult = DialogResult.OK;
     }
 }
Beispiel #3
0
        private void CreateBtn_Click(object sender, EventArgs e)
        {
            var input = new InputFrm("Create Channel", "Enter Channel Name", "Create", "Cancel");

            if (input.ShowDialog() == DialogResult.OK)
            {
                Program.ChatServer.SendPacket(DevServerPackets.JoinChannel, input.InputBox.Text);
                DialogResult = DialogResult.OK;
            }
        }
Beispiel #4
0
        private void CreateBtn_Click(object sender, EventArgs e)
        {
            var input = new InputFrm(info.channelTitle, info.channelMsg, info.channelCreate, info.channelCancel);

            if (input.ShowDialog() == DialogResult.OK)
            {
                Program.ChatServer.SendPacket(DevServerPackets.JoinChannel, input.InputBox.Text.Trim());
                DialogResult = DialogResult.OK;
            }
        }
        public void LoadRoom(object sender, EventArgs e)
        {
            var rooms = (ListBox)sender;
            if (rooms.SelectedIndex == -1)
                return;
            if (!m_rooms.ContainsKey(rooms.SelectedItem.ToString()))
                return;

            RoomInfos item = m_rooms[rooms.SelectedItem.ToString()];

            if (item.isRanked && !item.hasStarted)
            {
                MessageBox.Show("Cannot manually join a ranked game.");
                return;
            }

            if (item.isLocked)
            {
                var form = new InputFrm(string.Empty, Program.LanguageManager.Translation.GameEnterPassword, Program.LanguageManager.Translation.QuickHostBtn, Program.LanguageManager.Translation.optionBtnCancel)
                {
                    InputBox = { MaxLength = 4 }
                };
                if (!item.hasStarted)
                {
                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        if (form.InputBox.Text != item.roomName)
                        {
                            MessageBox.Show(Program.LanguageManager.Translation.GameWrongPassword);
                            return;
                        }
                    }
                    else
                        return;
                }
            }

            if (Program.ServerList.ContainsKey(item.server))
            {
                LauncherHelper.GenerateConfig(Program.ServerList[item.server], item.ToName());
                LauncherHelper.RunGame("-j");
            }
        }
        public void RenameItem(object sender, EventArgs e)
        {
            if ((FileList.SelectedItems.Count == 0))
            {
                MessageBox.Show(Program.LanguageManager.Translation.fileMsgNoSelect);
                return;
            }
            var input = new InputFrm("Rename", Program.LanguageManager.Translation.fileNewName, Program.LanguageManager.Translation.fileInputConfirm, "Cancel");
            if ((!(FileList.SelectedItems.Count > 1)))
            {

                if ((input.ShowDialog() == DialogResult.OK))
                {
                    try
                    {
                        File.Copy(Program.Config.LauncherDir + m_fileLocation + FileList.Items[FileList.SelectedIndex] + m_fileType, Program.Config.LauncherDir + m_fileLocation + input.InputBox.Text + m_fileType);
                        File.Delete(Program.Config.LauncherDir + m_fileLocation + FileList.Items[FileList.SelectedIndex] + m_fileType);
                        RefreshFileList();
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }
            }
            else
            {
                MessageBox.Show(Program.LanguageManager.Translation.fileMsbMulti, "Rename Error");

            }
        }
Beispiel #7
0
        private void AddUserBtn_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(Program.UserInfo.team))
            {
                MessageBox.Show("You are not in a team.", "No u", MessageBoxButtons.OK);
                return;
            }

            if(Program.UserInfo.teamRank <= 0)
            {
                MessageBox.Show("Your rank is too low.", "No u", MessageBoxButtons.OK);
                return;
            }

            var form = new InputFrm("Add Team Member","Enter Users name","Send","Cancel") {InputBox = {MaxLength = 14}};

            if(form.ShowDialog() == DialogResult.OK)
            {
                Program.ChatServer.SendPacket(DevServerPackets.ChatCommand,
                    JsonSerializer.SerializeToString(new PacketCommand { Command = "TEAMADD", Data = form.InputBox.Text }));
            }
        }
Beispiel #8
0
        private void Getitem(object handler, EventArgs e)
        {
            bool input = (((Button)handler).Name[0].ToString(CultureInfo.InvariantCulture) == "1");
            string servercommand = ((Button)handler).Name.Substring(1);

            if (input)
            {
                if (servercommand != "DEVCOLOR")
                {
                    var form = new InputFrm("Input", m_descriptions[servercommand], "Confirm", "Cancel");
                    if (servercommand != "DEVCREATETEAM" && servercommand != "DEVMSG")
                        form.InputBox.KeyDown += Suppress_Space;

                    if (servercommand == "DEVCREATETEAM")
                        form.InputBox.MaxLength = 20;
                    else if (servercommand == "DEVMSG")
                        form.InputBox.MaxLength = 250;
                    else
                        form.InputBox.MaxLength = 14;

                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        if (form.InputBox.Text == "")
                        {
                            MessageBox.Show("Input cannot be empty");
                            return;
                        }
                        Program.ChatServer.SendPacket(DevServerPackets.DevPointCommand,
                            JsonSerializer.SerializeToString(
                            new PacketCommand
                                { Command = servercommand,
                                                  Data = form.InputBox.Text.Trim()
                        }));
                    }
                }
                else
                {
                    var selectcolor = new ColorDialog();
                    if (selectcolor.ShowDialog() == DialogResult.OK)
                    {
                        Program.ChatServer.SendPacket(DevServerPackets.DevPointCommand,
                            JsonSerializer.SerializeToString(
                            new PacketCommand
                                {
                                Command = servercommand,
                                Data = selectcolor.Color.R + "," + selectcolor.Color.G + "," + selectcolor.Color.B
                            }));
                    }

                }
            }
            else
            {
                if (servercommand == "NULL")
                {
                    Process.Start("http://en.ygodevpro.com/web-devpro/");
                    return;
                }

                if(MessageBox.Show("Confirm","Are you sure?",MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    Program.ChatServer.SendPacket(DevServerPackets.DevPointCommand,
                            JsonSerializer.SerializeToString(
                            new PacketCommand
                                {
                                Command = servercommand
                            }));
                } 
            }
        }
        private void AddThemeBtn_Click(object sender, EventArgs e)
        {
            var form = new InputFrm("Add Theme", "Enter theme name", "Add", "Cancel");

            if (form.ShowDialog() == DialogResult.OK)
            {
                if (m_themes.ContainsKey(form.InputBox.Text))
                {
                    MessageBox.Show("Theme already exsists!", "Error", MessageBoxButtons.OK);
                    return;
                }
                AddTheme(form.InputBox.Text);
                ThemeSelect.Items.Add(form.InputBox.Text);
                ThemeSelect.SelectedItem = form.InputBox.Text;
            }
        }
        public void LoadRoom(object sender, EventArgs e)
        {
            var rooms = (ListBox)sender;
            if (rooms.SelectedIndex == -1)
                return;
            if (!m_rooms.ContainsKey(rooms.SelectedItem.ToString()))
                return;

            RoomInfos item = m_rooms[rooms.SelectedItem.ToString()];
            if (item.isLocked)
            {
                var form = new InputFrm(string.Empty, Program.LanguageManager.Translation.GameEnterPassword, Program.LanguageManager.Translation.QuickHostBtn, Program.LanguageManager.Translation.optionBtnCancel)
                    {
                        InputBox = {MaxLength = 4}
                    };
                if (form.ShowDialog() == DialogResult.OK)
                {
                    if (form.InputBox.Text != item.roomName)
                    {
                        MessageBox.Show(Program.LanguageManager.Translation.GameWrongPassword);
                        return;
                    }
                }
                else
                { return; }
            }

            if (item.hasStarted)
            {
                MessageBox.Show("Spectating games in progress is unavailable.. Please join them before they start.");
                return;
            }

            LauncherHelper.GenerateConfig(Program.Server, item.GenerateURI());
            LauncherHelper.RunGame("-j");
        }