diff --git a/NHSE.WinForms/Subforms/Map/FieldItemEditor.Designer.cs b/NHSE.WinForms/Subforms/Map/FieldItemEditor.Designer.cs index 20c82e3..2af4a5b 100644 --- a/NHSE.WinForms/Subforms/Map/FieldItemEditor.Designer.cs +++ b/NHSE.WinForms/Subforms/Map/FieldItemEditor.Designer.cs @@ -69,7 +69,6 @@ private void InitializeComponent() this.GB_Remove = new System.Windows.Forms.Label(); this.TC_Editor = new System.Windows.Forms.TabControl(); this.Tab_Item = new System.Windows.Forms.TabPage(); - this.ItemEdit = new NHSE.WinForms.ItemEditor(); this.B_DumpLoadField = new System.Windows.Forms.Button(); this.CM_DLField = new System.Windows.Forms.ContextMenuStrip(this.components); this.B_DumpAcre = new System.Windows.Forms.ToolStripMenuItem(); @@ -135,6 +134,9 @@ private void InitializeComponent() this.RB_Item = new System.Windows.Forms.RadioButton(); this.RB_Terrain = new System.Windows.Forms.RadioButton(); this.L_TileMode = new System.Windows.Forms.Label(); + this.ItemEdit = new NHSE.WinForms.ItemEditor(); + this.Menu_SavePNGItems = new System.Windows.Forms.ToolStripMenuItem(); + this.Menu_SavePNGTerrain = new System.Windows.Forms.ToolStripMenuItem(); this.CM_Click.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.PB_Map)).BeginInit(); this.CM_Picture.SuspendLayout(); @@ -295,15 +297,16 @@ private void InitializeComponent() // CM_Picture // this.CM_Picture.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.Menu_SavePNG}); + this.Menu_SavePNG, + this.Menu_SavePNGItems, + this.Menu_SavePNGTerrain}); this.CM_Picture.Name = "CM_Picture"; - this.CM_Picture.ShowImageMargin = false; - this.CM_Picture.Size = new System.Drawing.Size(101, 26); + this.CM_Picture.Size = new System.Drawing.Size(152, 70); // // Menu_SavePNG // this.Menu_SavePNG.Name = "Menu_SavePNG"; - this.Menu_SavePNG.Size = new System.Drawing.Size(100, 22); + this.Menu_SavePNG.Size = new System.Drawing.Size(180, 22); this.Menu_SavePNG.Text = "Save .png"; this.Menu_SavePNG.Click += new System.EventHandler(this.Menu_SavePNG_Click); // @@ -546,14 +549,6 @@ private void InitializeComponent() this.Tab_Item.Text = "Items"; this.Tab_Item.UseVisualStyleBackColor = true; // - // ItemEdit - // - this.ItemEdit.Dock = System.Windows.Forms.DockStyle.Top; - this.ItemEdit.Location = new System.Drawing.Point(3, 3); - this.ItemEdit.Name = "ItemEdit"; - this.ItemEdit.Size = new System.Drawing.Size(238, 390); - this.ItemEdit.TabIndex = 40; - // // B_DumpLoadField // this.B_DumpLoadField.ContextMenuStrip = this.CM_DLField; @@ -1243,6 +1238,32 @@ private void InitializeComponent() this.L_TileMode.Text = "Tile Editor Mode"; this.L_TileMode.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // + // ItemEdit + // + this.ItemEdit.Dock = System.Windows.Forms.DockStyle.Top; + this.ItemEdit.Location = new System.Drawing.Point(3, 3); + this.ItemEdit.Name = "ItemEdit"; + this.ItemEdit.Size = new System.Drawing.Size(238, 390); + this.ItemEdit.TabIndex = 40; + // + // Menu_SavePNGItems + // + this.Menu_SavePNGItems.Checked = true; + this.Menu_SavePNGItems.CheckOnClick = true; + this.Menu_SavePNGItems.CheckState = System.Windows.Forms.CheckState.Checked; + this.Menu_SavePNGItems.Name = "Menu_SavePNGItems"; + this.Menu_SavePNGItems.Size = new System.Drawing.Size(180, 22); + this.Menu_SavePNGItems.Text = "Include Items"; + // + // Menu_SavePNGTerrain + // + this.Menu_SavePNGTerrain.Checked = true; + this.Menu_SavePNGTerrain.CheckOnClick = true; + this.Menu_SavePNGTerrain.CheckState = System.Windows.Forms.CheckState.Checked; + this.Menu_SavePNGTerrain.Name = "Menu_SavePNGTerrain"; + this.Menu_SavePNGTerrain.Size = new System.Drawing.Size(151, 22); + this.Menu_SavePNGTerrain.Text = "Include Terrain"; + // // FieldItemEditor // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1420,5 +1441,7 @@ private void InitializeComponent() private System.Windows.Forms.NumericUpDown NUD_MapAcreTemplateOutside; private System.Windows.Forms.NumericUpDown NUD_MapAcreTemplateField; private System.Windows.Forms.Label L_MapAcreTemplateField; + private System.Windows.Forms.ToolStripMenuItem Menu_SavePNGItems; + private System.Windows.Forms.ToolStripMenuItem Menu_SavePNGTerrain; } } \ No newline at end of file diff --git a/NHSE.WinForms/Subforms/Map/FieldItemEditor.cs b/NHSE.WinForms/Subforms/Map/FieldItemEditor.cs index 5a68a82..d03e9f7 100644 --- a/NHSE.WinForms/Subforms/Map/FieldItemEditor.cs +++ b/NHSE.WinForms/Subforms/Map/FieldItemEditor.cs @@ -456,10 +456,21 @@ private void Menu_SavePNG_Click(object sender, EventArgs e) if (sfd.ShowDialog() != DialogResult.OK) return; - var img = (Bitmap)PB_Map.BackgroundImage.Clone(); - using var gfx = Graphics.FromImage(img); - gfx.DrawImage(PB_Map.Image, new Point(0, 0)); - img.Save(sfd.FileName, ImageFormat.Png); + if (!Menu_SavePNGTerrain.Checked) + { + PB_Map.Image.Save(sfd.FileName, ImageFormat.Png); + } + else if (!Menu_SavePNGItems.Checked) + { + PB_Map.BackgroundImage.Save(sfd.FileName, ImageFormat.Png); + } + else + { + var img = (Bitmap)PB_Map.BackgroundImage.Clone(); + using var gfx = Graphics.FromImage(img); + gfx.DrawImage(PB_Map.Image, new Point(0, 0)); + img.Save(sfd.FileName, ImageFormat.Png); + } } private void PB_Map_MouseDown(object sender, MouseEventArgs e) => ClickMapAt(e, true); diff --git a/NHSE.WinForms/Subforms/Map/FieldItemEditor.resx b/NHSE.WinForms/Subforms/Map/FieldItemEditor.resx index 8b99e1b..b5a05c3 100644 --- a/NHSE.WinForms/Subforms/Map/FieldItemEditor.resx +++ b/NHSE.WinForms/Subforms/Map/FieldItemEditor.resx @@ -129,15 +129,15 @@ 465, 17 - - 17, 56 - 620, 17 930, 17 + + 17, 56 + 775, 17