/// <summary> /// Event handler for user click on startLabel. /// </summary> /// <param name="sender">The parameter is not used.</param> /// <param name="e">The parameter is not used.</param> private void StartLabelClick(object sender, EventArgs e) { // Logic for starting game. this.Hide(); GameBoard gameBoard = new GameBoard(); gameBoard.ShowDialog(); }
/// <summary> /// Event handler for user click on startLabel. /// </summary> /// <param name="sender">The parameter is not used.</param> /// <param name="e">The parameter is not used.</param> private void StartLabelClick(object sender, EventArgs e) { // Logic for starting game. int firstOption = -1; if (singleColorModeRadioButton.Checked) firstOption = 0; if (beginnerModeRadioButton.Checked) firstOption = 1; if (tutorialModeRadioButton.Checked) firstOption = 2; int secondOption; bool result = Int32.TryParse(numberOfSetsTextBox.Text, out secondOption); if (!result) { MessageBox.Show("You must specify how many SETs for the round."); return; } Sounds sound = new Sounds(); string directoryName = Path.GetDirectoryName(Directory.GetCurrentDirectory()); directoryName = Path.GetDirectoryName(directoryName); directoryName = Path.GetDirectoryName(directoryName); directoryName = directoryName + "\\set_sounds\\sound_options.txt"; string text = System.IO.File.ReadAllText(directoryName); if (text == "true") { sound.PlayMusicIntro(false); sound.PlayMusic(true); } int[] options = { firstOption, secondOption}; this.Hide(); GameBoard gameBoard = new GameBoard(options); gameBoard.ShowDialog(); }