Esempio n. 1
0
        private void BtnSaveGame_Click(object sender, RoutedEventArgs e)
        {
            SaveWindow saveWindow = new SaveWindow(homeWindow);

            WPF_Misc.FocusWindow(saveWindow);
            WPF_Misc.OpenNewWindow(this, saveWindow, false);
        }
Esempio n. 2
0
        private void BtnLoadGame_Click(object sender, RoutedEventArgs e)
        {
            LoadWindow loadWindow = new LoadWindow(homeWindow);

            WPF_Misc.FocusWindow(loadWindow);
            WPF_Misc.OpenNewWindow(this, loadWindow, false);
        }
Esempio n. 3
0
        private void BtnEndGame_Click(object sender, RoutedEventArgs e)
        {
            WPF_Misc.OpenNewWindow(this, new MainWindow(), false, false);

            // Вместе с этим окном закроется и окно паузы, т.к. это окно-родитель
            homeWindow.MainWindow.Close();
            homeWindow.Close();
        }
Esempio n. 4
0
        private void LoadProcess(string buttonContent)
        {
            List <Save> saves = Save.GetAllSaves();

            for (int i = 0; i < saves.Count; i++)
            {
                if (saves[i].Name == buttonContent)
                {
                    homeWindow.Game.BreakCurrentTime();

                    if (mainWindow != null)
                    {
                        WPF_Misc.OpenNewWindow(mainWindow, new HomeWindow(saves[i].Game, saves[i].Person, mainWindow));
                    }
                    else
                    {
                        WPF_Misc.OpenNewWindow(homeWindow, new HomeWindow(saves[i].Game, saves[i].Person, homeWindow.MainWindow));
                    }

                    this.Close();
                    break;
                }
            }
        }