Пример #1
0
        private static void ChangeNick(List <string> args, ICRCSendable output)
        {
            string nick   = args[0].Replace(' ', '_');
            string result = CRCStrings.ValidateNick(nick);

            if (result != null)
            {
                output.AddError(result);
            }
            else
            {
                CRCClient.ChangeNick(nick);
            }
        }
Пример #2
0
        private void buttonOK_Click(object sender, EventArgs e)
        {
            string name   = textBoxName.Text.Replace(' ', '_');
            string result = CRCStrings.ValidateNick(name);

            if (result != null)
            {
                MessageBox.Show(result, CRCStrings.Localize("crc_error"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            string lang = indexToLanguage[comboBoxLanguage.SelectedIndex];

            if (lang != CRCOptions.Language)
            {
                CRCOptions.Language = lang;
                MessageBox.Show(CRCStrings.Localize("options_language_restart"), CRCStrings.Localize("crc_name"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }

            CRCOptions.Channel        = indexToChannel[comboBoxChannel.SelectedIndex];
            CRCOptions.AutoFaction    = radioButtonFactionAuto.Checked;
            CRCOptions.ManualFaction  = indexToFaction[comboBoxFaction.SelectedIndex];
            CRCOptions.Name           = name;
            CRCOptions.ShowTimestamps = checkBoxTimestamps.Checked;
            CRCOptions.SendDeath      = checkBoxDeathSend.Checked;
            CRCOptions.ReceiveDeath   = checkBoxDeathReceive.Checked;
            CRCOptions.DeathInterval  = (int)numericUpDownDeath.Value;

            CRCOptions.NewsDuration = (int)numericUpDownNewsDuration.Value;
            CRCOptions.ChatKey      = textBoxChatKey.Text;
            CRCOptions.NewsSound    = checkBoxNewsSound.Checked;
            CRCOptions.CloseChat    = checkBoxCloseChat.Checked;

            CRCOptions.Save();
            CRCClient.UpdateSettings();
            CRCGame.UpdateSettings();
            this.Close();
        }