示例#1
0
        private void btnSave_Click_1(object sender, EventArgs e)
        {
            string saveMessage = SaveGame.FileNameIsValid(textBoxSaveName.Text, saveLoadLocation);

            if (saveLoadLocationSelected)
            {
                if (saveMessage == "")
                {
                    SaveGame.SaveGameToFile(textBoxSaveName.Text, saveLoadLocation);
                    SaveLoadMessage("Game successfully saved");
                    textBoxSaveName.Text = "";
                }
                else
                {
                    SaveLoadMessage(saveMessage);
                }
            }
            else
            {
                SaveLoadMessage("No save location selected");
            }
            updateSaveNames();
        }