mirror of
https://github.com/tribufu/ServerGridEditor
synced 2026-05-06 07:07:32 +00:00
Minor changes to Export options to make it slightly more clear.
This commit is contained in:
parent
95e6096844
commit
06a78b5e34
3 changed files with 49 additions and 27 deletions
Binary file not shown.
40
Src/ServerGridEditor/Forms/MainForm.Designer.cs
generated
40
Src/ServerGridEditor/Forms/MainForm.Designer.cs
generated
|
|
@ -53,8 +53,9 @@
|
||||||
this.editServerTemplatesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.editServerTemplatesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.editLocksToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.editLocksToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.exportToolStripMenuItem = 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.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.cellImagesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.slippyMapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.slippyMapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.testsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.testsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
|
@ -323,44 +324,50 @@
|
||||||
// exportToolStripMenuItem
|
// exportToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.exportToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.exportToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
this.mapImageToolStripMenuItem,
|
|
||||||
this.localExportToolStripMenuItem,
|
this.localExportToolStripMenuItem,
|
||||||
|
this.toolStripSeparator1,
|
||||||
|
this.mapImageToolStripMenuItem,
|
||||||
this.cellImagesToolStripMenuItem,
|
this.cellImagesToolStripMenuItem,
|
||||||
this.slippyMapToolStripMenuItem});
|
this.slippyMapToolStripMenuItem});
|
||||||
this.exportToolStripMenuItem.Name = "exportToolStripMenuItem";
|
this.exportToolStripMenuItem.Name = "exportToolStripMenuItem";
|
||||||
this.exportToolStripMenuItem.Size = new System.Drawing.Size(52, 20);
|
this.exportToolStripMenuItem.Size = new System.Drawing.Size(52, 20);
|
||||||
this.exportToolStripMenuItem.Text = "Export";
|
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
|
// localExportToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.localExportToolStripMenuItem.Enabled = false;
|
this.localExportToolStripMenuItem.Enabled = false;
|
||||||
this.localExportToolStripMenuItem.Name = "localExportToolStripMenuItem";
|
this.localExportToolStripMenuItem.Name = "localExportToolStripMenuItem";
|
||||||
this.localExportToolStripMenuItem.Size = new System.Drawing.Size(138, 22);
|
this.localExportToolStripMenuItem.Size = new System.Drawing.Size(271, 22);
|
||||||
this.localExportToolStripMenuItem.Text = "Local Export";
|
this.localExportToolStripMenuItem.Text = "Local Export All";
|
||||||
this.localExportToolStripMenuItem.Click += new System.EventHandler(this.localExportToolStripMenuItem_Click);
|
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
|
// cellImagesToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.cellImagesToolStripMenuItem.Enabled = false;
|
this.cellImagesToolStripMenuItem.Enabled = false;
|
||||||
this.cellImagesToolStripMenuItem.Name = "cellImagesToolStripMenuItem";
|
this.cellImagesToolStripMenuItem.Name = "cellImagesToolStripMenuItem";
|
||||||
this.cellImagesToolStripMenuItem.Size = new System.Drawing.Size(138, 22);
|
this.cellImagesToolStripMenuItem.Size = new System.Drawing.Size(271, 22);
|
||||||
this.cellImagesToolStripMenuItem.Text = "Cell Images";
|
this.cellImagesToolStripMenuItem.Text = "Export : Just Cell Images";
|
||||||
this.cellImagesToolStripMenuItem.Click += new System.EventHandler(this.cellImagesToolStripMenuItem_Click);
|
this.cellImagesToolStripMenuItem.Click += new System.EventHandler(this.cellImagesToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
// slippyMapToolStripMenuItem
|
// slippyMapToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.slippyMapToolStripMenuItem.Enabled = false;
|
this.slippyMapToolStripMenuItem.Enabled = false;
|
||||||
this.slippyMapToolStripMenuItem.Name = "slippyMapToolStripMenuItem";
|
this.slippyMapToolStripMenuItem.Name = "slippyMapToolStripMenuItem";
|
||||||
this.slippyMapToolStripMenuItem.Size = new System.Drawing.Size(138, 22);
|
this.slippyMapToolStripMenuItem.Size = new System.Drawing.Size(271, 22);
|
||||||
this.slippyMapToolStripMenuItem.Text = "Slippy Map";
|
this.slippyMapToolStripMenuItem.Text = "Generate Slippy Map (Optional Tools)";
|
||||||
this.slippyMapToolStripMenuItem.Click += new System.EventHandler(this.slippyMapToolStripMenuItem_Click);
|
this.slippyMapToolStripMenuItem.Click += new System.EventHandler(this.slippyMapToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
// testsToolStripMenuItem
|
// testsToolStripMenuItem
|
||||||
|
|
@ -878,6 +885,7 @@
|
||||||
private System.Windows.Forms.Label atlasLocation;
|
private System.Windows.Forms.Label atlasLocation;
|
||||||
private System.Windows.Forms.ToolStripMenuItem editServerTemplatesToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem editServerTemplatesToolStripMenuItem;
|
||||||
private System.Windows.Forms.ToolStripMenuItem editLocksToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem editLocksToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1665,6 +1665,11 @@ namespace ServerGridEditor
|
||||||
return;
|
return;
|
||||||
|
|
||||||
saveFileDialog.Filter = "jpg files (*.jpg)|*.jpg";
|
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)
|
if (saveFileDialog.ShowDialog() == DialogResult.OK)
|
||||||
{
|
{
|
||||||
ExportImage(saveFileDialog.FileName, -1, -1, true, editorConfig.AtlasImagesRes);
|
ExportImage(saveFileDialog.FileName, -1, -1, true, editorConfig.AtlasImagesRes);
|
||||||
|
|
@ -2027,7 +2032,12 @@ namespace ServerGridEditor
|
||||||
if (currentProject == null)
|
if (currentProject == null)
|
||||||
return;
|
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)
|
if (saveFileDialog.ShowDialog() == DialogResult.OK)
|
||||||
{
|
{
|
||||||
ExportCellImages(saveFileDialog.FileName);
|
ExportCellImages(saveFileDialog.FileName);
|
||||||
|
|
@ -2154,8 +2164,10 @@ namespace ServerGridEditor
|
||||||
string serverConfigPathServerOnly = serverConfigPath.Replace(".json", ".ServerOnly.json");
|
string serverConfigPathServerOnly = serverConfigPath.Replace(".json", ".ServerOnly.json");
|
||||||
File.WriteAllText(serverConfigPathServerOnly, JsonConvert.SerializeObject(ServerOnlyObject, Formatting.Indented)); //ServerGrid.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/
|
//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));
|
string path = Path.GetFullPath(gameDir + "/" + Path.GetFileName(serverConfigPath));
|
||||||
if (path != Path.GetFullPath(serverConfigPath))
|
if (path != Path.GetFullPath(serverConfigPath))
|
||||||
|
|
@ -2164,17 +2176,19 @@ namespace ServerGridEditor
|
||||||
path = Path.GetFullPath(gameDir + "/" + Path.GetFileName(serverConfigPathServerOnly));
|
path = Path.GetFullPath(gameDir + "/" + Path.GetFileName(serverConfigPathServerOnly));
|
||||||
File.Copy(serverConfigPathServerOnly, path, true);
|
File.Copy(serverConfigPathServerOnly, path, true);
|
||||||
|
|
||||||
string gameMapExportDir = Path.GetFullPath(gameDir + "/" + JsonNameNoExtension);
|
//Overwrite where to export images
|
||||||
if (!Directory.Exists(gameMapExportDir))
|
gameMapExportDir = Path.GetFullPath(gameDir + "/" + JsonNameNoExtension);
|
||||||
Directory.CreateDirectory(gameMapExportDir);
|
|
||||||
|
|
||||||
if (!disableImageExportingCheckBox.Checked)
|
|
||||||
{
|
|
||||||
ExportImage(gameMapExportDir + "/MapImg.jpg", -1, -1, true, editorConfig.AtlasImagesRes);
|
|
||||||
ExportCellImages(gameMapExportDir + string.Format("/{0}.jpg", cellImgName));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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");
|
MessageBox.Show("Export successful!\nFiles in " + exportDir, "Success");
|
||||||
}
|
}
|
||||||
catch (System.Exception ex)
|
catch (System.Exception ex)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue