コード例 #1
0
ファイル: GameForm.cs プロジェクト: weazyexe/untangle
        /// <summary>
        /// Если победил
        /// </summary>
        private void IsWin(object sender, MouseEventArgs e)
        {
            if (isPlay)
            {
                DialogResult dr = MessageBox.Show("You win!\nSave the graph picture?", "Congratz", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (dr == DialogResult.Yes)
                {
                    SaveButton_Click(sender, e);
                }

                if (MessageBox.Show("Continue?", "Congratz", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    level++;
                    StartLevel();
                    isPlay = true;
                }
                else
                {
                    results   += String.Format("{0}\t Level: {1}\t Solved himself: {2}\t Auto solve: {3}\n", name, level - 5, level - 5 - autoSolves, autoSolves);
                    level      = 4;
                    autoSolves = 0;
                    Vertices.Clear();
                    Edges.Clear();
                    DrawAll();
                    Text = "Untangle";
                    StartButton.Show();
                    ExitStartMenuButton.Show();
                    RulesStartMenuButton.Show();
                    TitleLabel.Show();
                    TitleUnderLabel.Show();
                    isPlay = false;
                    MainMenuButton.Enabled = false;
                }
            }
        }
コード例 #2
0
ファイル: GameForm.cs プロジェクト: weazyexe/untangle
        private void MainMenuButton_Click(object sender, EventArgs e)
        {
            DialogResult dr = MessageBox.Show("Save your result?", "Attention", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);

            if (dr == DialogResult.Yes)
            {
                results += String.Format("{0}\t Level: {1}\t Solved himself: {2}\t Auto solve: {3}\n", name, level - 5, level - 5 - autoSolves, autoSolves);
            }
            else if (dr == DialogResult.Cancel)
            {
                return;
            }
            dr = MessageBox.Show("Are you want to exit to main menu?", "Attention", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (dr == DialogResult.Yes)
            {
                level      = 6;
                autoSolves = 0;
                Vertices.Clear();
                Edges.Clear();
                DrawAll();
                Text = "Untangle";
                StartButton.Show();
                ExitStartMenuButton.Show();
                RulesStartMenuButton.Show();
                TitleLabel.Show();
                TitleUnderLabel.Show();
                isPlay    = false;
                isNewGame = true;
                MainMenuButton.Enabled = false;
            }
        }