public void Export() { RegionId.GenerateRegion(); ConstantsReader.SetupRegion(RegionId.myRegion, "../../"); Stopwatch sw = new Stopwatch(); sw.Start(); ; all_rooms = new RoomSave[296]; all_maps = new MapSave[160]; CheckGameTitle(); progressBar.Value++; LoadDungeonsRooms(); progressBar.Value++; LoadOverworldTiles(); progressBar.Value++; LoadOverworldMaps(); progressBar.Value++; TextData.readAllText(); LoadedProjectStatistics.texts = TextData.messages.Count; progressBar.Value++; WriteLog("All data loaded successfuly.", Color.Green, FontStyle.Bold); sw.Stop(); WriteLog("Elapsed Milliseconds : " + sw.ElapsedMilliseconds.ToString(), Color.DarkRed, FontStyle.Bold); SaveJson s = new SaveJson(all_rooms, all_maps, null, TextData.messages.ToArray(), overworld); progressBar.Value = progressBar.Maximum; WriteLog("All data exported successfuly.", Color.Green, FontStyle.Bold); }
public void Import() { RegionId.GenerateRegion(); ConstantsReader.SetupRegion(RegionId.myRegion, "../../"); all_maps = new MapSave[160]; CheckGameTitle(); LoadOverworldTiles(); LoadOverworldEntrances(); progressBar.Value = progressBar.Maximum; WriteLog("All 'Overworld' data saved in ROM successfuly.", Color.Green, FontStyle.Bold); try { //GFX.gfxdata = Compression.DecompressTiles(); SaveFileDialog sf = new SaveFileDialog(); if (sf.ShowDialog() == DialogResult.OK) { FileStream fs = new FileStream(sf.FileName, FileMode.OpenOrCreate, FileAccess.Write); fs.Write(ROM.DATA, 0, ROM.DATA.Length); fs.Close(); } } catch (Exception e) { WriteLog("Error : " + e.Message.ToString(), Color.Red); return; } }