private void btnPlay_Click(object sender, EventArgs e) { if (cmbMap.Text != "") { if (cmbFaction.Text != "") { frmGame frmGame = new frmGame(); frmGame.HomelandPriority = chkHomelandPriority.Checked; frmGame.NewGame(internalNames[cmbMap.SelectedIndex], cmbFaction.SelectedIndex + 1); frmGame.FormClosed += delegate { this.Close(); }; //frmGame.Load += delegate { this.Hide(); }; frmGame.Show(); Hide(); } else { MessageBox.Show( "You have to choose a faction first", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show( "You have to choose a map first", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnLoad_Click(object sender, EventArgs e) { if (cmbSave.Text != "") { Loading = true; frmGame = new frmGame(); frmGame.LoadGame(cmbSave.Text); frmGame.FormClosed += delegate { this.Close(); }; frmGame.Show(); this.Close(); } }