Example #1
0
        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());
             *  }
             * }*/
        }
Example #2
0
        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());
            }
        }