private static void LoadSubButton_Click(object sender, EventArgs e) { if (Prompt.ChooseGame()) { var loadedGamePath = Prompt.SelectedGamePath; var confirmed = MessageBox.Show("Сигурни ли сте?", "Зареждане на игра", MessageBoxButtons.YesNo) == DialogResult.Yes; if (confirmed) { Game.Game.Current = Game.Game.LoadSaveFileGame(loadedGamePath); HandController.ReturnAllToHand(); SidebarController.RenderSidebar(); Task.Run(() => GameController.ContinueFromLoadedTurn()); } } /*var saveFilePath = LoadSavedGameDialog.SelectFile(); * if (string.IsNullOrEmpty(saveFilePath) == false) * { * if(Game.Game.Load(saveFilePath, true)) * { * SidebarController.RenderSidebar(); * Task.Run(() => GameController.ContinueFromLoadedTurn()); * } * }*/ }
private static void NewGameSubButton_Click(object sender, EventArgs e) { var confirmed = MessageBox.Show("Сигурни ли сте?", "Нова игра", MessageBoxButtons.YesNo) == DialogResult.Yes; if (confirmed) { Game.GameController.NewGame(); SidebarController.RenderSidebar(); Game.Game.Save(autosave: true); Task.Run(() => GameController.ContinueFromLoadedTurn()); } }