diff --git a/ServerGridEditor.exe b/ServerGridEditor.exe index d7881a1..fc010e6 100644 Binary files a/ServerGridEditor.exe and b/ServerGridEditor.exe differ diff --git a/Src/ServerGridEditor/Forms/MainForm.Designer.cs b/Src/ServerGridEditor/Forms/MainForm.Designer.cs index ca60513..c8be914 100644 --- a/Src/ServerGridEditor/Forms/MainForm.Designer.cs +++ b/Src/ServerGridEditor/Forms/MainForm.Designer.cs @@ -53,8 +53,9 @@ this.editServerTemplatesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.editLocksToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.mapImageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.localExportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.mapImageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.cellImagesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.slippyMapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.testsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -323,44 +324,50 @@ // exportToolStripMenuItem // this.exportToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.mapImageToolStripMenuItem, this.localExportToolStripMenuItem, + this.toolStripSeparator1, + this.mapImageToolStripMenuItem, this.cellImagesToolStripMenuItem, this.slippyMapToolStripMenuItem}); this.exportToolStripMenuItem.Name = "exportToolStripMenuItem"; this.exportToolStripMenuItem.Size = new System.Drawing.Size(52, 20); this.exportToolStripMenuItem.Text = "Export"; // - // mapImageToolStripMenuItem - // - this.mapImageToolStripMenuItem.Enabled = false; - this.mapImageToolStripMenuItem.Name = "mapImageToolStripMenuItem"; - this.mapImageToolStripMenuItem.Size = new System.Drawing.Size(138, 22); - this.mapImageToolStripMenuItem.Text = "Map Image"; - this.mapImageToolStripMenuItem.Click += new System.EventHandler(this.mapImageToolStripMenuItem_Click); - // // localExportToolStripMenuItem // this.localExportToolStripMenuItem.Enabled = false; this.localExportToolStripMenuItem.Name = "localExportToolStripMenuItem"; - this.localExportToolStripMenuItem.Size = new System.Drawing.Size(138, 22); - this.localExportToolStripMenuItem.Text = "Local Export"; + this.localExportToolStripMenuItem.Size = new System.Drawing.Size(271, 22); + this.localExportToolStripMenuItem.Text = "Local Export All"; this.localExportToolStripMenuItem.Click += new System.EventHandler(this.localExportToolStripMenuItem_Click); // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(268, 6); + // + // mapImageToolStripMenuItem + // + this.mapImageToolStripMenuItem.Enabled = false; + this.mapImageToolStripMenuItem.Name = "mapImageToolStripMenuItem"; + this.mapImageToolStripMenuItem.Size = new System.Drawing.Size(271, 22); + this.mapImageToolStripMenuItem.Text = "Export: Just Map Image"; + this.mapImageToolStripMenuItem.Click += new System.EventHandler(this.mapImageToolStripMenuItem_Click); + // // cellImagesToolStripMenuItem // this.cellImagesToolStripMenuItem.Enabled = false; this.cellImagesToolStripMenuItem.Name = "cellImagesToolStripMenuItem"; - this.cellImagesToolStripMenuItem.Size = new System.Drawing.Size(138, 22); - this.cellImagesToolStripMenuItem.Text = "Cell Images"; + this.cellImagesToolStripMenuItem.Size = new System.Drawing.Size(271, 22); + this.cellImagesToolStripMenuItem.Text = "Export : Just Cell Images"; this.cellImagesToolStripMenuItem.Click += new System.EventHandler(this.cellImagesToolStripMenuItem_Click); // // slippyMapToolStripMenuItem // this.slippyMapToolStripMenuItem.Enabled = false; this.slippyMapToolStripMenuItem.Name = "slippyMapToolStripMenuItem"; - this.slippyMapToolStripMenuItem.Size = new System.Drawing.Size(138, 22); - this.slippyMapToolStripMenuItem.Text = "Slippy Map"; + this.slippyMapToolStripMenuItem.Size = new System.Drawing.Size(271, 22); + this.slippyMapToolStripMenuItem.Text = "Generate Slippy Map (Optional Tools)"; this.slippyMapToolStripMenuItem.Click += new System.EventHandler(this.slippyMapToolStripMenuItem_Click); // // testsToolStripMenuItem @@ -878,6 +885,7 @@ private System.Windows.Forms.Label atlasLocation; private System.Windows.Forms.ToolStripMenuItem editServerTemplatesToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem editLocksToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; } } diff --git a/Src/ServerGridEditor/Forms/MainForm.cs b/Src/ServerGridEditor/Forms/MainForm.cs index b8b1272..19e6b9f 100644 --- a/Src/ServerGridEditor/Forms/MainForm.cs +++ b/Src/ServerGridEditor/Forms/MainForm.cs @@ -1665,6 +1665,11 @@ namespace ServerGridEditor return; saveFileDialog.Filter = "jpg files (*.jpg)|*.jpg"; + string ExportPath = Path.GetFullPath(GlobalSettings.Instance.ExportDir + actualJsonFile.Replace(".json", "")); + if (!Directory.Exists(ExportPath)) + Directory.CreateDirectory(ExportPath); + saveFileDialog.InitialDirectory = ExportPath; + saveFileDialog.FileName = "MapImg.jpg"; if (saveFileDialog.ShowDialog() == DialogResult.OK) { ExportImage(saveFileDialog.FileName, -1, -1, true, editorConfig.AtlasImagesRes); @@ -2027,7 +2032,12 @@ namespace ServerGridEditor if (currentProject == null) return; - saveFileDialog.Filter = "png files (*.png)|*.png"; + saveFileDialog.Filter = "jpg files (*.jpg)|*.jpg"; + string ExportPath = Path.GetFullPath(GlobalSettings.Instance.ExportDir + actualJsonFile.Replace(".json", "")); + if (!Directory.Exists(ExportPath)) + Directory.CreateDirectory(ExportPath); + saveFileDialog.InitialDirectory = ExportPath; + saveFileDialog.FileName = "CellImg"; if (saveFileDialog.ShowDialog() == DialogResult.OK) { ExportCellImages(saveFileDialog.FileName); @@ -2154,8 +2164,10 @@ namespace ServerGridEditor string serverConfigPathServerOnly = serverConfigPath.Replace(".json", ".ServerOnly.json"); File.WriteAllText(serverConfigPathServerOnly, JsonConvert.SerializeObject(ServerOnlyObject, Formatting.Indented)); //ServerGrid.ServerOnly.json + string gameMapExportDir = Path.GetFullPath(GlobalSettings.Instance.ExportDir + "/" + JsonNameNoExtension); + //Copy to Project/ShooterGame/ - if (Directory.Exists(gameDir)) + if (Directory.Exists(gameDir + "/Build")) //Just end client folder people are unlikely to have for now { string path = Path.GetFullPath(gameDir + "/" + Path.GetFileName(serverConfigPath)); if (path != Path.GetFullPath(serverConfigPath)) @@ -2164,17 +2176,19 @@ namespace ServerGridEditor path = Path.GetFullPath(gameDir + "/" + Path.GetFileName(serverConfigPathServerOnly)); File.Copy(serverConfigPathServerOnly, path, true); - string gameMapExportDir = Path.GetFullPath(gameDir + "/" + JsonNameNoExtension); - if (!Directory.Exists(gameMapExportDir)) - Directory.CreateDirectory(gameMapExportDir); - - if (!disableImageExportingCheckBox.Checked) - { - ExportImage(gameMapExportDir + "/MapImg.jpg", -1, -1, true, editorConfig.AtlasImagesRes); - ExportCellImages(gameMapExportDir + string.Format("/{0}.jpg", cellImgName)); - } + //Overwrite where to export images + gameMapExportDir = Path.GetFullPath(gameDir + "/" + JsonNameNoExtension); } } + + if (!disableImageExportingCheckBox.Checked) + { + if (!Directory.Exists(gameMapExportDir)) + Directory.CreateDirectory(gameMapExportDir); + + ExportImage(gameMapExportDir + "/MapImg.jpg", -1, -1, true, editorConfig.AtlasImagesRes); + ExportCellImages(gameMapExportDir + string.Format("/{0}.jpg", cellImgName)); + } MessageBox.Show("Export successful!\nFiles in " + exportDir, "Success"); } catch (System.Exception ex)