예제 #1
0
        private void SaveGame(string NewName)
        {
            WorldAdapter wa = new WorldAdapter();

            if (NewName != null && NewName != "")
            {
                wa.SaveGameName = NewName;
            }

            if (wa.SaveGameName == "" || wa.SaveGameName == null)
            {
                UiUtils.OpenTextInputDialog(grdMain, LangResources.CurLang.SaveGame, LangResources.CurLang.GameHasNotBeenSavedBefore, SaveGameInputCallback);
            }
            else
            {
                GameIO io = new GameIO();
                io.SaveGameName = wa.SaveGameName;
                io.SaveGame();

                List <DialogButton> buttons = new List <DialogButton>();
                buttons.Add(new DialogButton(LangResources.CurLang.OK, null, null));

                UiUtils.OpenDialogBox(grdMain, LangResources.CurLang.SaveGame, String.Format(LangResources.CurLang.GameSavedSuccessfully, wa.SaveGameName), buttons);
            }
        }