예제 #1
0
        private void StartGame(string SaveGame)
        {
            bool FromSave;

            if (SaveGame == null)
            {
                Initialiser init = new Initialiser();
                init.CreateWorld();
                FromSave = false;
            }
            else
            {
                GameIO io = new GameIO();
                io.SaveGameName = SaveGame;

                try
                {
                    io.LoadGame();
                }
                catch (Exception ex)
                {
                    UiUtils.OpenDialogBox(grdMain, LangResources.CurLang.LoadSavedGame, LangResources.CurLang.Error + ": " + ex.Message,
                                          new List <DialogButton>()
                    {
                        new DialogButton(LangResources.CurLang.OK, null, null)
                    });
                    return;
                }


                FromSave = true;
            }


            GameWindow g = new GameWindow();

            UiUtils.MainWindowGrid  = g.grdMain;
            g.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            g.WindowState           = WindowState.Maximized;
            g.Show();
            g.StartGame(FromSave);

            this.Close();
        }