예제 #1
0
 private void toggleSound_Click(object sender, EventArgs e)
 {
     InvisButton.Select();
     Properties.Settings.Default.playSounds = !Properties.Settings.Default.playSounds;
     Properties.Settings.Default.Save();
     toggleSoundText();
 }
예제 #2
0
        private void Options_Click(object sender, EventArgs e)
        {
            InvisButton.Select();
            Options Options = new Options();

            Options.SetBounds(this.Location.X, this.Location.Y, this.Width, this.Height);
            Options.Show();
            this.Hide();
        }
예제 #3
0
        private void Button_MouseDown(object sender, MouseEventArgs e)
        {
            InvisButton.Select();

            string buttonCoords = (sender as Button).Name;

            string[] coordsArray = buttonCoords.Split(' ');
            Global.BUTTONROW = Int32.Parse(coordsArray[0]);
            Global.BUTTONCOL = Int32.Parse(coordsArray[1]);

            CheckGrid();

            if (e.Button == MouseButtons.Right)
            {
                Play.OnRightClick();
                MineCounter.Text = String.Format("{0:00}", Global.NUMMINES - Global.FLAGCOUNTER);
            }
        }
예제 #4
0
        private void clearRecords_Click(object sender, EventArgs e)
        {
            InvisButton.Select();
            DialogResult confirm = MessageBox.Show("Are you sure?\nAll records will be deleted.", "Confirm Action", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (confirm == DialogResult.Yes)
            {
                Properties.Settings.Default.easyBestTime   = 0;
                Properties.Settings.Default.easyGames      = 0;
                Properties.Settings.Default.easyWins       = 0;
                Properties.Settings.Default.mediumBestTime = 0;
                Properties.Settings.Default.mediumGames    = 0;
                Properties.Settings.Default.mediumWins     = 0;
                Properties.Settings.Default.hardBestTime   = 0;
                Properties.Settings.Default.hardGames      = 0;
                Properties.Settings.Default.hardWins       = 0;
                Properties.Settings.Default.totalGames     = 0;
                Properties.Settings.Default.totalWins      = 0;
                Properties.Settings.Default.Save();
            }
        }
예제 #5
0
        private void NewGame_Click(object sender, EventArgs e)
        {
            InvisButton.Select();

            if (Minesweeper.Properties.Settings.Default.saveGame && File.Exists(Global.DATALOCATION + @"\Data.xml"))
            {
                DialogResult continueGame = MessageBox.Show("Saved game detected, continue?", "Continue Game", MessageBoxButtons.YesNo, MessageBoxIcon.None);

                if (continueGame == DialogResult.Yes)
                {
                    Serialize.DeserializeFromXML();
                    new GameBoard().Show();
                    this.Hide();
                }
                else
                {
                    StartNewGame();
                }
            }
            else
            {
                StartNewGame();
            }
        }
예제 #6
0
 public Options()
 {
     InitializeComponent();
     InvisButton.Select();
     toggleSoundText();
 }
예제 #7
0
 private void Records_Click(object sender, EventArgs e)
 {
     InvisButton.Select();
     new Records().Show();
     this.Hide();
 }