private void RetryButtonHandler(object sender, EventArgs e) //кнопка повторного запуска игры { //скрытие всех лишних элементов формы GameOverLabel.Hide(); RetryButton.Hide(); ExitButton.Hide(); MartianBattleLabel.Hide(); PointsLabel.Hide(); NumbersOfLives.Value = 100; m_endMusic.Stop(); m_gameMusic.PlayLooping(); m_controlGame.StartGame(); //повторный запуск игры }
private void Finder_Load(object sender, EventArgs e) { if (Properties.Settings.Default.ShouldCloseWhenSuccess) { HideOnSuccessTick.Checked = true; } RetryButton.Hide(); SetMessage("Looking for Path of Exile Process..."); SetStatus("Searching..."); if (PathofExileIsPresent()) { Count = new Timer(); // Every 3.5 seconds check if POE has closed. // I'd rather poll and be safe than to hook into POE's process and get banned there too... Count.Interval = 3500; Count.Tick += CheckPathofExile; Count.Start(); SetMessage("Found Path of Exile.\nStarting Trade Script"); try { SetStatus("Working!"); Process.Start("Run_TradeMacro.ahk"); } catch { SetMessage("It seems you havent placed this .exe\nNext to Run_TradeMacro.ahk."); Count.Dispose(); Count = null; RetryButton.Show(); SetStatus("Failed to find Run_TradeMacro.ahk!"); } } else { SetStatus("You are not playing Path of Exile."); SetMessage("Could not find Path of Exile. \n Start the game then retry."); RetryButton.Show(); } }