コード例 #1
0
        public void Processing()
        {
            formMainMenu menu = new formMainMenu
            {
                mainGame = MainProcessManager.mainGame
            };

            mainGame.Player.currentPlaylist.clear();
            WMPLib.IWMPMedia media;
            string[]         filePaths = Directory.GetFiles("GameMusic/Start/", "*.mp3");
            Random           rd        = new Random();
            int    index = rd.Next(0, filePaths.Length);
            string path  = filePaths[index];

            foreach (String s in filePaths)
            {
                media = mainGame.Player.newMedia(s);
                mainGame.Player.currentPlaylist.appendItem(media);
            }
            media = mainGame.Player.newMedia(path);
            mainGame.Player.currentPlaylist.appendItem(media);
            mainGame.Player.currentItem = media;
            mainGame.Player.play();
            mainGame.Player.settings.setMode("loop", true);

            if (menu.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                this.globalVariables.InitialGlobalVariables();
                this.gameParameters.InitializeGameParameters();

                mainGame.jiazaitishi.Show();
                mainGame.jiazaitishi.Refresh();
                mainGame.Run();
            }
        }
コード例 #2
0
        public void SetUpTimers()
        {
            formMainMenu FMM = new formMainMenu();

            // MessageBox.Show(FMM.comboBox1.SelectedIndex + " ");
            //timers[2] = new Countdown_Timer.Timer(2, formMainMenu.times[FMM.comboBox2.SelectedIndex], 0, 0, new Point(550, 41), formMainMenu.times[FMM.comboBox4.SelectedIndex]);
            //  timers[1] = new Countdown_Timer.Timer(1, formMainMenu.times[FMM.comboBox1.SelectedIndex], 0, 0, new Point(550, 475), formMainMenu.times[FMM.comboBox3.SelectedIndex]);

            // timers[1].StartTimer();

            //System.Threading.Thread.Sleep(3000);
        }
コード例 #3
0
 private void ButtonContinuati2_Click(object sender, EventArgs e)
 {
     if (database.ParolaPotrivitaEmail(textBox1.Text, textBox2.Text))
     {
         this.Close();
         formMainMenu FMM = new formMainMenu();
         //FMM.Close();
         FMM.Show();
     }
     else
     {
         //MessageBox.Show("Parola introdusa nu corespunde contului dat.");
     }
 }
コード例 #4
0
        public void Processing()
        {
            formMainMenu menu = new formMainMenu
            {
                mainGame = mainGame
            };

            if (menu.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                this.globalVariables.InitialGlobalVariables();
                this.gameParameters.InitializeGameParameters();
                mainGame.jiazaitishi.Show();
                mainGame.Run();
            }
        }
コード例 #5
0
        private void T_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            curr_milisec -= 1;

            if (curr_min < 0 && curr_sec < 0 && curr_milisec < 0)
            {
                if (m_player_color == 1)
                {
                    formMainMenu FMM = new formMainMenu();
                    FMM.buttonAmPierdutWhite.PerformClick();
                }
                else
                {
                    formMainMenu FMM = new formMainMenu();
                    FMM.buttonAmPierdutBlack.PerformClick();
                }
                StopTimer();
                return;
            }

            if (curr_milisec == 0)
            {
                curr_milisec = 99;
                curr_sec    -= 1;
            }

            if (curr_sec == 0)
            {
                curr_sec  = 59;
                curr_min -= 1;
            }

            if (curr_min == 0 && curr_sec <= 10)
            {
                //MessageBox.Show("asdasd");
                tbox.BackColor = Color.Red;
            }
            else if (curr_min == 0 && curr_sec <= 30)
            {
                tbox.BackColor = Color.DarkOrange;
            }



            SetText(string.Format("{0}:{1}:{2}", curr_min.ToString().PadLeft(2, '0'), curr_sec.ToString().PadLeft(2, '0'), curr_milisec.ToString().PadLeft(2, '0')));
            //tbox.Text = string.Format("{0}:{1}:{2}", curr_min.ToString().PadLeft(2, '0'), curr_sec.ToString().PadLeft(2, '0'), curr_milisec.ToString().PadLeft(2, '0'));
        }
コード例 #6
0
        private void DrawTimerTextBox(Point tbox_position)
        {
            tbox.Location  = tbox_position;
            tbox.Width     = tbox_width;
            tbox.Height    = tbox_height;
            tbox.Enabled   = true;
            tbox.Font      = new Font("Microsoft Sans Serif", 25, FontStyle.Bold);
            tbox.ForeColor = Color.Black;
            tbox.BackColor = Color.WhiteSmoke;
            tbox.TextAlign = HorizontalAlignment.Center;
            tbox.Enabled   = false;
            tbox.Text      = string.Format("{0}:{1}:{2}", curr_min.ToString().PadLeft(2, '0'), curr_sec.ToString().PadLeft(2, '0'), curr_milisec.ToString().PadLeft(2, '0'));
            // TextBox.CheckForIllegalCrossThreadCalls = false;

            formMainMenu FMM = (formMainMenu)Application.OpenForms["formMainMenu"];

            FMM.panelSah.Controls.Add(tbox);
        }
コード例 #7
0
        public void Processing()
        {
            formMainMenu menu = new formMainMenu
            {
                mainGame = MainProcessManager.mainGame
            };

            mainGame.Player.URL = @"GameMusic\Start.mp3";
            mainGame.Player.play();
            if (menu.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                this.globalVariables.InitialGlobalVariables();
                this.gameParameters.InitializeGameParameters();

                mainGame.jiazaitishi.Show();
                mainGame.jiazaitishi.Refresh();
                mainGame.Run();
            }
        }