private void AddToMapList_Click(object sender, EventArgs e)
{
// Get Values
string map = MapListSelect.SelectedItem.ToString();
string mode = ((KeyValuePair) GameModeSelect.SelectedItem).Key;
string size = MapSizeSelect.SelectedItem.ToString();
// Warn user if client doesnt support map
if (ClientMaps.Count > 0 && !ClientMaps.Contains(map, StringComparer.OrdinalIgnoreCase))
{
if (MessageBox.Show(
"The Battlfield 2 Client does not contain this map! Are you sure you want to add it to the maplist?",
"Confirm", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK)
return;
}
// Add to maplist
if (!String.IsNullOrEmpty(MapListBox.Text))
MapListBox.Text += Environment.NewLine;
MapListBox.Text += String.Format("mapList.append {0} {1} {2}", map, mode, size);
}