예제 #1
0
        private void BrowserBtns_OnBrowse(bool previous, bool next, bool play)
        {
            if (previous)
            {
                currentStepIndex--;
                if (currentStepIndex < 0)
                {
                    currentStepIndex = 0;
                    return;
                }
                GoToStep(currentStepIndex);
            }
            else if (next)
            {
                currentStepIndex = Math.Min(++currentStepIndex, stepsList.Count - 1);
                GoToStep(currentStepIndex);
            }
            else if (play)
            {
                //this.overlay.EnableOverlay(this);

                handler = new GameHandler();
                handler.Initialize(handlerDataManager, userGame, GameProfile.CleanClone(currentProfile));
                handler.Ended += handler_Ended;

                GameManager.Instance.Play(handler);
                if (handlerData.HandlerInterval > 0)
                {
                    handlerThread = new Thread(UpdateGameManager);
                    handlerThread.Start();
                }
                //WindowState = FormWindowState.Minimized;
            }
        }
예제 #2
0
        private void btn_Play_Click(object sender, EventArgs e)
        {
            if (handler != null)
            {
                handler.End();
                SetBtnToPlay();
                return;
            }

            btn_Play.Visible = false;
            btn_Play.Text    = "S T O P";

            handler = gameManager.MakeHandler(currentGame);
            handler.Initialize(currentGameInfo, GameProfile.CleanClone(currentProfile));
            handler.Ended += handler_Ended;

            gameManager.Play(handler);
            if (handler.TimerInterval > 0)
            {
                handlerThread = new Thread(UpdateGameManager);
                handlerThread.Start();
            }

            WindowState = FormWindowState.Minimized;
        }
예제 #3
0
        private void btn_Play_Click(object sender, EventArgs e)
        {
            if (btn_Play.Text == "S T O P")
            {
                if (handler.FakeFocus != null)
                {
                    handler.FakeFocus.Abort();
                }
                if (handler != null)
                {
                    Log("Stop button clicked, calling Handler End function");
                    handler.End();
                }
                SetBtnToPlay();
                btn_Play.Enabled = false;
                this.Controls.Clear();
                this.InitializeComponent();
                RefreshGames();

                return;
            }

            btn_Play.Text   = "S T O P";
            btnBack.Enabled = false;

            handler = gameManager.MakeHandler(currentGame);
            handler.Initialize(currentGameInfo, GameProfile.CleanClone(currentProfile));
            handler.Ended += handler_Ended;

            gameManager.Play(handler);
            if (handler.TimerInterval > 0)
            {
                handlerThread = new Thread(UpdateGameManager);
                handlerThread.Start();
            }

            if (currentGame.HideTaskbar)
            {
                User32Util.HideTaskbar();
            }

            if (currentGame.HideDesktop)
            {
                foreach (Screen screen in Screen.AllScreens)
                {
                    System.Windows.Forms.Form hform = new System.Windows.Forms.Form();
                    hform.BackColor       = Color.Black;
                    hform.Location        = new Point(0, 0);
                    hform.Size            = screen.WorkingArea.Size;
                    this.Size             = screen.WorkingArea.Size;
                    hform.FormBorderStyle = FormBorderStyle.None;
                    hform.StartPosition   = FormStartPosition.Manual;
                    //hform.TopMost = true;
                    hform.Show();
                }
            }

            WindowState = FormWindowState.Minimized;
        }
예제 #4
0
        private void btn_Play_Click(object sender, EventArgs e)
        {
            this.overlay.EnableOverlay(this);

            handler = new GameHandler();
            handler.Initialize(handlerDataManager, selectedControl.UserGameInfo, GameProfile.CleanClone(currentProfile));
            handler.Ended += handler_Ended;

            gameManager.Play(handler);
            if (handlerData.HandlerInterval > 0)
            {
                handlerThread = new Thread(UpdateGameManager);
                handlerThread.Start();
            }

            WindowState = FormWindowState.Minimized;
        }