private bool SaveLevelInDesigner() { bool returnMe = false; FileSaveNameDialog sn = new FileSaveNameDialog(); sn.SetName(Designer.GetName()); while (true) { if (sn.ShowDialog() == DialogResult.OK) //if file doesn't exist or it's ok to overwrite { string toFileName = sn.GetName(); if (toFileName.Length > 0 && (!Filer.LevelExists(toFileName) || MessageBox.Show("Overwite Level?", "Level file already exists.", MessageBoxButtons.YesNo) == DialogResult.Yes)) { Filer.Save(toFileName, Designer); returnMe = true; MessageBox.Show("Level " + sn.GetName() + " saved successfully."); break; } } else { break; } } sn.Dispose(); return(returnMe); }
public void SaveGame() { try { string file = FilerView.Save(); Filer.Save(file, GameFileable); } catch (ArgumentException e) { GameView.Display(e.Message); } }
public void Save() { try { string filename = FilerView.Save(); Filer.Save(filename, GameFileable); } catch (ArgumentException e) { FilerView.Display(e); } }
public void SaveDesign() { try { if (Designer.checkValid()) { string file = FilerView.Save(); Filer.Save(file, DesignerFileable); } } catch (ArgumentException e) { DesignerView.Display(e.Message); } }
public void Save(string fileName, GameNS.Game mockObject) { Filer.Save(fileName, mockObject); }