public void SaveToTemp(bool savePersistentTemplate) { MapManager.Items.Save(); HorizonSave.Main.SetTerrainTiles(MapManager.Terrain.Tiles); HorizonSave.Main.SetAcreBytes(MapManager.Terrain.BaseAcres); // save.OutsideFieldTemplateUniqueId = (ushort)NUD_MapAcreTemplateOutside.Value; // save.MainFieldParamUniqueID = (ushort)NUD_MapAcreTemplateField.Value; HorizonSave.Main.Buildings = MapManager.Buildings; HorizonSave.Main.EventPlazaLeftUpX = MapManager.PlazaX; HorizonSave.Main.EventPlazaLeftUpZ = MapManager.PlazaY; HorizonSave.Save((uint)DateTime.Now.Ticks); if (savePersistentTemplate) { string persistentTemplateJson = JsonConvert.SerializeObject(PersistentTemplate); File.WriteAllText(PersistentTemplatePath, persistentTemplateJson); } else { File.Delete(PersistentTemplatePath); } }
private void Save() { try { UpdateCrossRefsPlayer(false); _loaded.Save((uint)DateTime.Now.Ticks); MessageBox.Show("Successfully saved the modified game data!", "Done", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception e) { MessageBox.Show("Could not save game data.", "Done", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void Menu_Save_Click(object sender, EventArgs e) { SaveAll(); try { SAV.Save((uint)DateTime.Now.Ticks); } #pragma warning disable CA1031 // Do not catch general exception types catch (Exception ex) #pragma warning restore CA1031 // Do not catch general exception types { WinFormsUtil.Error(MessageStrings.MsgSaveDataExportFail, ex.Message); return; } WinFormsUtil.Alert(MessageStrings.MsgSaveDataExportSuccess); }
private void Menu_Save_Click(object sender, EventArgs e) { SaveAll(); try { SAV.Save((uint)DateTime.Now.Ticks); } #pragma warning disable CA1031 // Do not catch general exception types catch (Exception ex) #pragma warning restore CA1031 // Do not catch general exception types { WinFormsUtil.Error("Unable to save files to their original location.", ex.Message); return; } WinFormsUtil.Alert("Saved all save data!"); }
private void Menu_Save_Click(object sender, EventArgs e) { SaveAll(); SAV.Save((uint)DateTime.Now.Ticks); WinFormsUtil.Alert("Saved all save data!"); }