private void SaveBtn_Click(object sender, EventArgs e)
{
StringBuilder Params = new StringBuilder();
// Windowed Mode
if (WindowedMode.Checked)
Params.Append("+fullscreen 0 ");
// Custom Resolution
if (CustomRes.Checked)
Params.AppendFormat("+szx {0} +szy {1} ", WidthText.Text, HeightText.Text);
// Join Server
if (!String.IsNullOrWhiteSpace(JoinServerIp.Text))
{
Params.AppendFormat("+joinServer {0} +port {1} ", JoinServerIp.Text, JoinServerPort.Value);
if (!String.IsNullOrWhiteSpace(JoinServerPass.Text))
Params.AppendFormat("+password {0} ", JoinServerPass.Text);
}
// Auto Login
if (AutoLogin.Checked)
{
// Account name
if (ProfileSelect.SelectedIndex > -1)
Params.AppendFormat("+playerName {0} ", ProfileSelect.SelectedItem.ToString());
// Account Pass
if (!String.IsNullOrWhiteSpace(AccountPass.Text))
Params.AppendFormat("+playerPassword {0} ", AccountPass.Text);
}
// Misc Params
if (PlayNow.Checked)
Params.Append("+playNow 1 ");
if (Restart.Checked)
Params.Append("+restart 1 ");
if (DisableSwiff.Checked)
Params.Append("+disableSwiff 1 ");
if (NoSound.Checked)
Params.Append("+noSound 1 ");
if (LowPriority.Checked)
Params.Append("+lowPriority 1 ");
// Set the param string
ParamString = String.Concat(Params.ToString(), UnknownVals).Trim();
this.DialogResult = DialogResult.OK;
}