private void saveMapedit()
{
System.Windows.Forms.Cursor oldCur = System.Windows.Forms.Cursor.Current;
System.Windows.Forms.Cursor.Current=Cursors.WaitCursor;
string path=txtMap.Text.Substring(0,txtMap.Text.LastIndexOf("\\")+1);
string file=txtMap.Text.Substring(txtMap.Text.LastIndexOf("\\")+1);
string ext = file.Substring(file.LastIndexOf("."));
file = file.Substring(0,file.LastIndexOf("."));
try
{
GameInfo.TilesetInfo.Save(path + file + ".new");
if(File.Exists(txtMap.Text))
{
if(File.Exists(path+file+".old"))
File.Delete(path+file+".old");
File.Move(txtMap.Text,path+file+".old");
}
File.Move(path+file+".new",txtMap.Text);
System.Windows.Forms.Cursor.Current=oldCur;
Text="PathsEditor : Saved Mapedit.dat";
}
catch(Exception e)
{
if(File.Exists(path+file+".new"))
File.Delete(path+file+".new");
throw e;
}
}