From 4e4725fc5efd6cefcae136843e630d38c99ce9c4 Mon Sep 17 00:00:00 2001 From: Mark Williamson Date: Wed, 7 Sep 2016 10:01:03 -0500 Subject: [PATCH 1/3] Added map file button and text box to main form to be consistent with rest of form. Modified behavior of Open File and the new Map File button to simply set the name of the map file rather than load it in the session, this way we can just leave tiled2unity open with our map file and hti the export button for more rapid iteration testing of map changes to unity testing. --- .../src/Tiled2UnityForm.Designer.cs | 205 +++++++++++------- tool/Tiled2Unity/src/Tiled2UnityForm.cs | 24 +- 2 files changed, 154 insertions(+), 75 deletions(-) diff --git a/tool/Tiled2Unity/src/Tiled2UnityForm.Designer.cs b/tool/Tiled2Unity/src/Tiled2UnityForm.Designer.cs index 0ed8884..fdb0db7 100644 --- a/tool/Tiled2Unity/src/Tiled2UnityForm.Designer.cs +++ b/tool/Tiled2Unity/src/Tiled2UnityForm.Designer.cs @@ -67,6 +67,8 @@ private void InitializeComponent() this.groupBoxReviewExport = new System.Windows.Forms.GroupBox(); this.tableLayoutPanelReviewExport = new System.Windows.Forms.TableLayoutPanel(); this.richTextBoxLaunchTip = new System.Windows.Forms.RichTextBox(); + this.button1 = new System.Windows.Forms.Button(); + this.tmxFileTextBox = new System.Windows.Forms.TextBox(); this.menuStrip.SuspendLayout(); this.groupBoxAdvancedOptions.SuspendLayout(); this.groupBoxExportOptions.SuspendLayout(); @@ -84,10 +86,11 @@ private void InitializeComponent() this.richTextBoxOutput.Dock = System.Windows.Forms.DockStyle.Fill; this.richTextBoxOutput.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.richTextBoxOutput.ForeColor = System.Drawing.SystemColors.WindowText; - this.richTextBoxOutput.Location = new System.Drawing.Point(3, 16); + this.richTextBoxOutput.Location = new System.Drawing.Point(4, 19); + this.richTextBoxOutput.Margin = new System.Windows.Forms.Padding(4); this.richTextBoxOutput.Name = "richTextBoxOutput"; this.richTextBoxOutput.ReadOnly = true; - this.richTextBoxOutput.Size = new System.Drawing.Size(649, 119); + this.richTextBoxOutput.Size = new System.Drawing.Size(865, 238); this.richTextBoxOutput.TabIndex = 9; this.richTextBoxOutput.Text = ""; this.richTextBoxOutput.WordWrap = false; @@ -96,9 +99,10 @@ private void InitializeComponent() // buttonFolderBrowser // this.buttonFolderBrowser.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.buttonFolderBrowser.Location = new System.Drawing.Point(22, 105); + this.buttonFolderBrowser.Location = new System.Drawing.Point(29, 129); + this.buttonFolderBrowser.Margin = new System.Windows.Forms.Padding(4); this.buttonFolderBrowser.Name = "buttonFolderBrowser"; - this.buttonFolderBrowser.Size = new System.Drawing.Size(135, 23); + this.buttonFolderBrowser.Size = new System.Drawing.Size(180, 28); this.buttonFolderBrowser.TabIndex = 7; this.buttonFolderBrowser.Text = "Export To ..."; this.buttonFolderBrowser.UseVisualStyleBackColor = true; @@ -109,9 +113,10 @@ private void InitializeComponent() this.buttonExport.BackColor = System.Drawing.Color.Lavender; this.buttonExport.Dock = System.Windows.Forms.DockStyle.Fill; this.buttonExport.ForeColor = System.Drawing.Color.MidnightBlue; - this.buttonExport.Location = new System.Drawing.Point(3, 43); + this.buttonExport.Location = new System.Drawing.Point(4, 53); + this.buttonExport.Margin = new System.Windows.Forms.Padding(4); this.buttonExport.Name = "buttonExport"; - this.buttonExport.Size = new System.Drawing.Size(126, 70); + this.buttonExport.Size = new System.Drawing.Size(168, 177); this.buttonExport.TabIndex = 11; this.buttonExport.Text = "Big Ass Export Button"; this.buttonExport.UseVisualStyleBackColor = false; @@ -122,9 +127,10 @@ private void InitializeComponent() this.buttonViewer.BackColor = System.Drawing.Color.LightSteelBlue; this.buttonViewer.Dock = System.Windows.Forms.DockStyle.Fill; this.buttonViewer.ForeColor = System.Drawing.Color.MidnightBlue; - this.buttonViewer.Location = new System.Drawing.Point(3, 3); + this.buttonViewer.Location = new System.Drawing.Point(4, 4); + this.buttonViewer.Margin = new System.Windows.Forms.Padding(4); this.buttonViewer.Name = "buttonViewer"; - this.buttonViewer.Size = new System.Drawing.Size(126, 34); + this.buttonViewer.Size = new System.Drawing.Size(168, 41); this.buttonViewer.TabIndex = 10; this.buttonViewer.Text = "Preview Map"; this.buttonViewer.UseVisualStyleBackColor = false; @@ -139,7 +145,8 @@ private void InitializeComponent() this.helpToolStripMenuItem}); this.menuStrip.Location = new System.Drawing.Point(0, 0); this.menuStrip.Name = "menuStrip"; - this.menuStrip.Size = new System.Drawing.Size(824, 24); + this.menuStrip.Padding = new System.Windows.Forms.Padding(8, 2, 0, 2); + this.menuStrip.Size = new System.Drawing.Size(1109, 26); this.menuStrip.TabIndex = 6; this.menuStrip.Text = "menuStrip1"; // @@ -149,20 +156,20 @@ private void InitializeComponent() this.openTiledFileToolStripMenuItem, this.exitToolStripMenuItem}); this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; - this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); + this.fileToolStripMenuItem.Size = new System.Drawing.Size(40, 22); this.fileToolStripMenuItem.Text = "&File"; // // openTiledFileToolStripMenuItem // this.openTiledFileToolStripMenuItem.Name = "openTiledFileToolStripMenuItem"; - this.openTiledFileToolStripMenuItem.Size = new System.Drawing.Size(165, 22); + this.openTiledFileToolStripMenuItem.Size = new System.Drawing.Size(197, 26); this.openTiledFileToolStripMenuItem.Text = "&Open Tiled File ..."; this.openTiledFileToolStripMenuItem.Click += new System.EventHandler(this.openTiledFileToolStripMenuItem_Click); // // exitToolStripMenuItem // this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; - this.exitToolStripMenuItem.Size = new System.Drawing.Size(165, 22); + this.exitToolStripMenuItem.Size = new System.Drawing.Size(197, 26); this.exitToolStripMenuItem.Text = "E&xit"; this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); // @@ -171,13 +178,13 @@ private void InitializeComponent() this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.clearOutputWindowToolStripMenuItem}); this.editToolStripMenuItem.Name = "editToolStripMenuItem"; - this.editToolStripMenuItem.Size = new System.Drawing.Size(39, 20); + this.editToolStripMenuItem.Size = new System.Drawing.Size(43, 22); this.editToolStripMenuItem.Text = "&Edit"; // // clearOutputWindowToolStripMenuItem // this.clearOutputWindowToolStripMenuItem.Name = "clearOutputWindowToolStripMenuItem"; - this.clearOutputWindowToolStripMenuItem.Size = new System.Drawing.Size(189, 22); + this.clearOutputWindowToolStripMenuItem.Size = new System.Drawing.Size(219, 26); this.clearOutputWindowToolStripMenuItem.Text = "&Clear Output Window"; this.clearOutputWindowToolStripMenuItem.Click += new System.EventHandler(this.clearOutputWindowToolStripMenuItem_Click); // @@ -192,51 +199,51 @@ private void InitializeComponent() this.toolStripSeparator2, this.aboutTiled2UnityToolStripMenuItem}); this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; - this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20); + this.helpToolStripMenuItem.Size = new System.Drawing.Size(48, 22); this.helpToolStripMenuItem.Text = "&Help"; // // addUnityPackageToProjectToolStripMenuItem // this.addUnityPackageToProjectToolStripMenuItem.Name = "addUnityPackageToProjectToolStripMenuItem"; - this.addUnityPackageToProjectToolStripMenuItem.Size = new System.Drawing.Size(242, 22); + this.addUnityPackageToProjectToolStripMenuItem.Size = new System.Drawing.Size(292, 26); this.addUnityPackageToProjectToolStripMenuItem.Text = "Import &Unity Package to Project"; this.addUnityPackageToProjectToolStripMenuItem.Click += new System.EventHandler(this.addUnityPackageToProjectToolStripMenuItem_Click); // // showHelpToolStripMenuItem // this.showHelpToolStripMenuItem.Name = "showHelpToolStripMenuItem"; - this.showHelpToolStripMenuItem.Size = new System.Drawing.Size(242, 22); + this.showHelpToolStripMenuItem.Size = new System.Drawing.Size(292, 26); this.showHelpToolStripMenuItem.Text = "Show Command &Help"; this.showHelpToolStripMenuItem.Click += new System.EventHandler(this.showHelpToolStripMenuItem_Click); // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(239, 6); + this.toolStripSeparator1.Size = new System.Drawing.Size(289, 6); // // supportTiledMapEditorToolStripMenuItem // this.supportTiledMapEditorToolStripMenuItem.Name = "supportTiledMapEditorToolStripMenuItem"; - this.supportTiledMapEditorToolStripMenuItem.Size = new System.Drawing.Size(242, 22); + this.supportTiledMapEditorToolStripMenuItem.Size = new System.Drawing.Size(292, 26); this.supportTiledMapEditorToolStripMenuItem.Text = "&Support Tiled On Patreon ..."; this.supportTiledMapEditorToolStripMenuItem.Click += new System.EventHandler(this.supportTiledMapEditorToolStripMenuItem_Click); // // donateToTiled2UnityToolStripMenuItem // this.donateToTiled2UnityToolStripMenuItem.Name = "donateToTiled2UnityToolStripMenuItem"; - this.donateToTiled2UnityToolStripMenuItem.Size = new System.Drawing.Size(242, 22); + this.donateToTiled2UnityToolStripMenuItem.Size = new System.Drawing.Size(292, 26); this.donateToTiled2UnityToolStripMenuItem.Text = "&Donate to Tiled2Unity"; this.donateToTiled2UnityToolStripMenuItem.Click += new System.EventHandler(this.donateToTiled2UnityToolStripMenuItem_Click); // // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(239, 6); + this.toolStripSeparator2.Size = new System.Drawing.Size(289, 6); // // aboutTiled2UnityToolStripMenuItem // this.aboutTiled2UnityToolStripMenuItem.Name = "aboutTiled2UnityToolStripMenuItem"; - this.aboutTiled2UnityToolStripMenuItem.Size = new System.Drawing.Size(242, 22); + this.aboutTiled2UnityToolStripMenuItem.Size = new System.Drawing.Size(292, 26); this.aboutTiled2UnityToolStripMenuItem.Text = "&About Tiled2Unity"; this.aboutTiled2UnityToolStripMenuItem.Click += new System.EventHandler(this.aboutTiled2UnityToolStripMenuItem_Click); // @@ -244,10 +251,11 @@ private void InitializeComponent() // this.labelScale.Anchor = System.Windows.Forms.AnchorStyles.Right; this.labelScale.AutoSize = true; - this.labelScale.Location = new System.Drawing.Point(87, 9); + this.labelScale.Location = new System.Drawing.Point(118, 11); + this.labelScale.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.labelScale.Name = "labelScale"; this.labelScale.RightToLeft = System.Windows.Forms.RightToLeft.No; - this.labelScale.Size = new System.Drawing.Size(70, 13); + this.labelScale.Size = new System.Drawing.Size(91, 17); this.labelScale.TabIndex = 5; this.labelScale.Text = "Vertex Scale:"; this.labelScale.TextAlign = System.Drawing.ContentAlignment.MiddleRight; @@ -255,9 +263,10 @@ private void InitializeComponent() // textBoxScale // this.textBoxScale.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.textBoxScale.Location = new System.Drawing.Point(3, 3); + this.textBoxScale.Location = new System.Drawing.Point(4, 4); + this.textBoxScale.Margin = new System.Windows.Forms.Padding(4); this.textBoxScale.Name = "textBoxScale"; - this.textBoxScale.Size = new System.Drawing.Size(94, 20); + this.textBoxScale.Size = new System.Drawing.Size(124, 22); this.textBoxScale.TabIndex = 3; this.textBoxScale.Text = "1"; this.textBoxScale.Validating += new System.ComponentModel.CancelEventHandler(this.textBoxScale_Validating); @@ -266,10 +275,11 @@ private void InitializeComponent() // this.textBoxExportFolder.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); this.textBoxExportFolder.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::Tiled2Unity.Properties.Settings.Default, "LastExportDirectory", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.textBoxExportFolder.Location = new System.Drawing.Point(163, 106); + this.textBoxExportFolder.Location = new System.Drawing.Point(217, 132); + this.textBoxExportFolder.Margin = new System.Windows.Forms.Padding(4); this.textBoxExportFolder.Name = "textBoxExportFolder"; this.textBoxExportFolder.ReadOnly = true; - this.textBoxExportFolder.Size = new System.Drawing.Size(621, 20); + this.textBoxExportFolder.Size = new System.Drawing.Size(828, 22); this.textBoxExportFolder.TabIndex = 8; this.textBoxExportFolder.Text = global::Tiled2Unity.Properties.Settings.Default.LastExportDirectory; // @@ -280,9 +290,10 @@ private void InitializeComponent() this.checkBoxPreferConvexPolygons.BackColor = System.Drawing.SystemColors.ControlLight; this.checkBoxPreferConvexPolygons.Checked = global::Tiled2Unity.Properties.Settings.Default.LastPreferConvexPolygons; this.checkBoxPreferConvexPolygons.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::Tiled2Unity.Properties.Settings.Default, "LastPreferConvexPolygons", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.checkBoxPreferConvexPolygons.Location = new System.Drawing.Point(6, 19); + this.checkBoxPreferConvexPolygons.Location = new System.Drawing.Point(8, 22); + this.checkBoxPreferConvexPolygons.Margin = new System.Windows.Forms.Padding(4); this.checkBoxPreferConvexPolygons.Name = "checkBoxPreferConvexPolygons"; - this.checkBoxPreferConvexPolygons.Size = new System.Drawing.Size(326, 17); + this.checkBoxPreferConvexPolygons.Size = new System.Drawing.Size(431, 21); this.checkBoxPreferConvexPolygons.TabIndex = 1; this.checkBoxPreferConvexPolygons.Text = "Convex Polygon Colliders (may be overridden with unity:convex)"; this.checkBoxPreferConvexPolygons.UseVisualStyleBackColor = false; @@ -291,9 +302,10 @@ private void InitializeComponent() // buttonObjectTypesXml // this.buttonObjectTypesXml.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.buttonObjectTypesXml.Location = new System.Drawing.Point(22, 40); + this.buttonObjectTypesXml.Location = new System.Drawing.Point(29, 49); + this.buttonObjectTypesXml.Margin = new System.Windows.Forms.Padding(4); this.buttonObjectTypesXml.Name = "buttonObjectTypesXml"; - this.buttonObjectTypesXml.Size = new System.Drawing.Size(135, 23); + this.buttonObjectTypesXml.Size = new System.Drawing.Size(180, 28); this.buttonObjectTypesXml.TabIndex = 4; this.buttonObjectTypesXml.Text = "Object Types XML ..."; this.buttonObjectTypesXml.UseVisualStyleBackColor = true; @@ -303,10 +315,11 @@ private void InitializeComponent() // this.textBoxObjectTypesXml.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); this.textBoxObjectTypesXml.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::Tiled2Unity.Properties.Settings.Default, "LastObjectTypeXmlFile", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.textBoxObjectTypesXml.Location = new System.Drawing.Point(3, 6); + this.textBoxObjectTypesXml.Location = new System.Drawing.Point(4, 9); + this.textBoxObjectTypesXml.Margin = new System.Windows.Forms.Padding(4); this.textBoxObjectTypesXml.Name = "textBoxObjectTypesXml"; this.textBoxObjectTypesXml.ReadOnly = true; - this.textBoxObjectTypesXml.Size = new System.Drawing.Size(495, 20); + this.textBoxObjectTypesXml.Size = new System.Drawing.Size(660, 22); this.textBoxObjectTypesXml.TabIndex = 5; this.textBoxObjectTypesXml.Text = global::Tiled2Unity.Properties.Settings.Default.LastObjectTypeXmlFile; this.textBoxObjectTypesXml.TextChanged += new System.EventHandler(this.textBoxObjectTypesXml_TextChanged); @@ -314,10 +327,10 @@ private void InitializeComponent() // buttonClearObjectTypes // this.buttonClearObjectTypes.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.buttonClearObjectTypes.Location = new System.Drawing.Point(503, 5); - this.buttonClearObjectTypes.Margin = new System.Windows.Forms.Padding(2); + this.buttonClearObjectTypes.Location = new System.Drawing.Point(671, 6); + this.buttonClearObjectTypes.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.buttonClearObjectTypes.Name = "buttonClearObjectTypes"; - this.buttonClearObjectTypes.Size = new System.Drawing.Size(116, 23); + this.buttonClearObjectTypes.Size = new System.Drawing.Size(154, 28); this.buttonClearObjectTypes.TabIndex = 6; this.buttonClearObjectTypes.Text = "Clear Object Types"; this.buttonClearObjectTypes.UseVisualStyleBackColor = true; @@ -330,9 +343,10 @@ private void InitializeComponent() this.checkBoxDepthBuffer.BackColor = System.Drawing.SystemColors.ControlLight; this.checkBoxDepthBuffer.Checked = global::Tiled2Unity.Properties.Settings.Default.LastDepthBufferEnabled; this.checkBoxDepthBuffer.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::Tiled2Unity.Properties.Settings.Default, "LastDepthBufferEnabled", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.checkBoxDepthBuffer.Location = new System.Drawing.Point(6, 42); + this.checkBoxDepthBuffer.Location = new System.Drawing.Point(8, 51); + this.checkBoxDepthBuffer.Margin = new System.Windows.Forms.Padding(4); this.checkBoxDepthBuffer.Name = "checkBoxDepthBuffer"; - this.checkBoxDepthBuffer.Size = new System.Drawing.Size(589, 17); + this.checkBoxDepthBuffer.Size = new System.Drawing.Size(783, 21); this.checkBoxDepthBuffer.TabIndex = 2; this.checkBoxDepthBuffer.Text = "Use Depth Buffer (For sprites using SpriteDepthInMap component to draw sprite bel" + "ow/above layers based on position.)"; @@ -346,9 +360,11 @@ private void InitializeComponent() this.groupBoxAdvancedOptions.BackColor = System.Drawing.SystemColors.ControlLightLight; this.groupBoxAdvancedOptions.Controls.Add(this.checkBoxPreferConvexPolygons); this.groupBoxAdvancedOptions.Controls.Add(this.checkBoxDepthBuffer); - this.groupBoxAdvancedOptions.Location = new System.Drawing.Point(7, 68); + this.groupBoxAdvancedOptions.Location = new System.Drawing.Point(16, 130); + this.groupBoxAdvancedOptions.Margin = new System.Windows.Forms.Padding(4); this.groupBoxAdvancedOptions.Name = "groupBoxAdvancedOptions"; - this.groupBoxAdvancedOptions.Size = new System.Drawing.Size(800, 65); + this.groupBoxAdvancedOptions.Padding = new System.Windows.Forms.Padding(4); + this.groupBoxAdvancedOptions.Size = new System.Drawing.Size(1054, 80); this.groupBoxAdvancedOptions.TabIndex = 13; this.groupBoxAdvancedOptions.TabStop = false; this.groupBoxAdvancedOptions.Text = "Advanced Options"; @@ -358,9 +374,11 @@ private void InitializeComponent() this.groupBoxExportOptions.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.groupBoxExportOptions.Controls.Add(this.tableLayoutPanelExportOptions); - this.groupBoxExportOptions.Location = new System.Drawing.Point(7, 139); + this.groupBoxExportOptions.Location = new System.Drawing.Point(16, 218); + this.groupBoxExportOptions.Margin = new System.Windows.Forms.Padding(4); this.groupBoxExportOptions.Name = "groupBoxExportOptions"; - this.groupBoxExportOptions.Size = new System.Drawing.Size(799, 186); + this.groupBoxExportOptions.Padding = new System.Windows.Forms.Padding(4); + this.groupBoxExportOptions.Size = new System.Drawing.Size(1065, 229); this.groupBoxExportOptions.TabIndex = 14; this.groupBoxExportOptions.TabStop = false; this.groupBoxExportOptions.Text = "Export Options"; @@ -369,7 +387,7 @@ private void InitializeComponent() // this.tableLayoutPanelExportOptions.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); this.tableLayoutPanelExportOptions.ColumnCount = 2; - this.tableLayoutPanelExportOptions.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 160F)); + this.tableLayoutPanelExportOptions.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 213F)); this.tableLayoutPanelExportOptions.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanelExportOptions.Controls.Add(this.labelScale, 0, 0); this.tableLayoutPanelExportOptions.Controls.Add(this.tableLayoutPanelScale, 1, 0); @@ -379,30 +397,32 @@ private void InitializeComponent() this.tableLayoutPanelExportOptions.Controls.Add(this.buttonFolderBrowser, 0, 3); this.tableLayoutPanelExportOptions.Controls.Add(this.textBoxExportFolder, 1, 3); this.tableLayoutPanelExportOptions.Controls.Add(this.labelObjectTypesDescription, 1, 2); - this.tableLayoutPanelExportOptions.Location = new System.Drawing.Point(6, 19); + this.tableLayoutPanelExportOptions.Location = new System.Drawing.Point(8, 23); + this.tableLayoutPanelExportOptions.Margin = new System.Windows.Forms.Padding(4); this.tableLayoutPanelExportOptions.Name = "tableLayoutPanelExportOptions"; this.tableLayoutPanelExportOptions.RowCount = 5; this.tableLayoutPanelExportOptions.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 45.07042F)); this.tableLayoutPanelExportOptions.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 54.92958F)); - this.tableLayoutPanelExportOptions.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 27F)); - this.tableLayoutPanelExportOptions.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 37F)); - this.tableLayoutPanelExportOptions.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); - this.tableLayoutPanelExportOptions.Size = new System.Drawing.Size(787, 161); + this.tableLayoutPanelExportOptions.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 33F)); + this.tableLayoutPanelExportOptions.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 46F)); + this.tableLayoutPanelExportOptions.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 31F)); + this.tableLayoutPanelExportOptions.Size = new System.Drawing.Size(1049, 198); this.tableLayoutPanelExportOptions.TabIndex = 0; // // tableLayoutPanelScale // this.tableLayoutPanelScale.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); this.tableLayoutPanelScale.ColumnCount = 2; - this.tableLayoutPanelScale.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F)); + this.tableLayoutPanelScale.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 133F)); this.tableLayoutPanelScale.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanelScale.Controls.Add(this.textBoxScale, 0, 0); this.tableLayoutPanelScale.Controls.Add(this.labelScaleDescription, 1, 0); - this.tableLayoutPanelScale.Location = new System.Drawing.Point(163, 3); + this.tableLayoutPanelScale.Location = new System.Drawing.Point(217, 4); + this.tableLayoutPanelScale.Margin = new System.Windows.Forms.Padding(4); this.tableLayoutPanelScale.Name = "tableLayoutPanelScale"; this.tableLayoutPanelScale.RowCount = 1; this.tableLayoutPanelScale.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanelScale.Size = new System.Drawing.Size(621, 26); + this.tableLayoutPanelScale.Size = new System.Drawing.Size(828, 31); this.tableLayoutPanelScale.TabIndex = 6; // // labelScaleDescription @@ -410,9 +430,10 @@ private void InitializeComponent() this.labelScaleDescription.Anchor = System.Windows.Forms.AnchorStyles.Left; this.labelScaleDescription.AutoSize = true; this.labelScaleDescription.BackColor = System.Drawing.SystemColors.ControlLight; - this.labelScaleDescription.Location = new System.Drawing.Point(103, 6); + this.labelScaleDescription.Location = new System.Drawing.Point(137, 7); + this.labelScaleDescription.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.labelScaleDescription.Name = "labelScaleDescription"; - this.labelScaleDescription.Size = new System.Drawing.Size(325, 13); + this.labelScaleDescription.Size = new System.Drawing.Size(432, 17); this.labelScaleDescription.TabIndex = 7; this.labelScaleDescription.Text = "Scale is inverse of Unity\'s \"Pixels Per Unit\" Texture Importer setting."; // @@ -421,23 +442,25 @@ private void InitializeComponent() this.tableLayoutPanelObjectTypes.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); this.tableLayoutPanelObjectTypes.ColumnCount = 2; this.tableLayoutPanelObjectTypes.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanelObjectTypes.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 120F)); + this.tableLayoutPanelObjectTypes.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 160F)); this.tableLayoutPanelObjectTypes.Controls.Add(this.buttonClearObjectTypes, 1, 0); this.tableLayoutPanelObjectTypes.Controls.Add(this.textBoxObjectTypesXml, 0, 0); - this.tableLayoutPanelObjectTypes.Location = new System.Drawing.Point(163, 35); + this.tableLayoutPanelObjectTypes.Location = new System.Drawing.Point(217, 43); + this.tableLayoutPanelObjectTypes.Margin = new System.Windows.Forms.Padding(4); this.tableLayoutPanelObjectTypes.Name = "tableLayoutPanelObjectTypes"; this.tableLayoutPanelObjectTypes.RowCount = 1; this.tableLayoutPanelObjectTypes.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanelObjectTypes.Size = new System.Drawing.Size(621, 33); + this.tableLayoutPanelObjectTypes.Size = new System.Drawing.Size(828, 40); this.tableLayoutPanelObjectTypes.TabIndex = 10; // // labelExportDescription // this.labelExportDescription.AutoSize = true; this.labelExportDescription.BackColor = System.Drawing.SystemColors.ControlLight; - this.labelExportDescription.Location = new System.Drawing.Point(163, 135); + this.labelExportDescription.Location = new System.Drawing.Point(217, 166); + this.labelExportDescription.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.labelExportDescription.Name = "labelExportDescription"; - this.labelExportDescription.Size = new System.Drawing.Size(532, 13); + this.labelExportDescription.Size = new System.Drawing.Size(707, 17); this.labelExportDescription.TabIndex = 7; this.labelExportDescription.Text = "Export Hint: Select the \"Tiled2Unity.export.txt\" file in your Unity Project. This" + " tells Tiled2Unity where to export to."; @@ -446,9 +469,10 @@ private void InitializeComponent() // this.labelObjectTypesDescription.AutoSize = true; this.labelObjectTypesDescription.BackColor = System.Drawing.SystemColors.ControlLight; - this.labelObjectTypesDescription.Location = new System.Drawing.Point(163, 71); + this.labelObjectTypesDescription.Location = new System.Drawing.Point(217, 87); + this.labelObjectTypesDescription.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.labelObjectTypesDescription.Name = "labelObjectTypesDescription"; - this.labelObjectTypesDescription.Size = new System.Drawing.Size(609, 26); + this.labelObjectTypesDescription.Size = new System.Drawing.Size(818, 33); this.labelObjectTypesDescription.TabIndex = 11; this.labelObjectTypesDescription.Text = "(Optional) Select the Object Types XML file to be used with your map. The Object " + "Type file may contain extra properties for your Tiled objects."; @@ -459,9 +483,11 @@ private void InitializeComponent() | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.groupBoxOutput.Controls.Add(this.richTextBoxOutput); - this.groupBoxOutput.Location = new System.Drawing.Point(12, 331); + this.groupBoxOutput.Location = new System.Drawing.Point(16, 455); + this.groupBoxOutput.Margin = new System.Windows.Forms.Padding(4); this.groupBoxOutput.Name = "groupBoxOutput"; - this.groupBoxOutput.Size = new System.Drawing.Size(655, 138); + this.groupBoxOutput.Padding = new System.Windows.Forms.Padding(4); + this.groupBoxOutput.Size = new System.Drawing.Size(873, 261); this.groupBoxOutput.TabIndex = 15; this.groupBoxOutput.TabStop = false; this.groupBoxOutput.Text = "Output"; @@ -471,9 +497,11 @@ private void InitializeComponent() this.groupBoxReviewExport.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Right))); this.groupBoxReviewExport.Controls.Add(this.tableLayoutPanelReviewExport); - this.groupBoxReviewExport.Location = new System.Drawing.Point(674, 331); + this.groupBoxReviewExport.Location = new System.Drawing.Point(899, 455); + this.groupBoxReviewExport.Margin = new System.Windows.Forms.Padding(4); this.groupBoxReviewExport.Name = "groupBoxReviewExport"; - this.groupBoxReviewExport.Size = new System.Drawing.Size(138, 135); + this.groupBoxReviewExport.Padding = new System.Windows.Forms.Padding(4); + this.groupBoxReviewExport.Size = new System.Drawing.Size(184, 257); this.groupBoxReviewExport.TabIndex = 16; this.groupBoxReviewExport.TabStop = false; this.groupBoxReviewExport.Text = "Review and Export"; @@ -485,12 +513,13 @@ private void InitializeComponent() this.tableLayoutPanelReviewExport.Controls.Add(this.buttonViewer, 0, 0); this.tableLayoutPanelReviewExport.Controls.Add(this.buttonExport, 0, 1); this.tableLayoutPanelReviewExport.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanelReviewExport.Location = new System.Drawing.Point(3, 16); + this.tableLayoutPanelReviewExport.Location = new System.Drawing.Point(4, 19); + this.tableLayoutPanelReviewExport.Margin = new System.Windows.Forms.Padding(4); this.tableLayoutPanelReviewExport.Name = "tableLayoutPanelReviewExport"; this.tableLayoutPanelReviewExport.RowCount = 2; - this.tableLayoutPanelReviewExport.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40F)); + this.tableLayoutPanelReviewExport.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 49F)); this.tableLayoutPanelReviewExport.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanelReviewExport.Size = new System.Drawing.Size(132, 116); + this.tableLayoutPanelReviewExport.Size = new System.Drawing.Size(176, 234); this.tableLayoutPanelReviewExport.TabIndex = 0; // // richTextBoxLaunchTip @@ -499,20 +528,47 @@ private void InitializeComponent() | System.Windows.Forms.AnchorStyles.Right))); this.richTextBoxLaunchTip.BackColor = System.Drawing.SystemColors.Info; this.richTextBoxLaunchTip.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.richTextBoxLaunchTip.Location = new System.Drawing.Point(7, 28); + this.richTextBoxLaunchTip.Location = new System.Drawing.Point(9, 34); + this.richTextBoxLaunchTip.Margin = new System.Windows.Forms.Padding(4); this.richTextBoxLaunchTip.Name = "richTextBoxLaunchTip"; this.richTextBoxLaunchTip.ReadOnly = true; - this.richTextBoxLaunchTip.Size = new System.Drawing.Size(800, 34); + this.richTextBoxLaunchTip.Size = new System.Drawing.Size(1067, 42); this.richTextBoxLaunchTip.TabIndex = 17; this.richTextBoxLaunchTip.TabStop = false; this.richTextBoxLaunchTip.Text = "Load rtf text here"; // + // button1 + // + this.button1.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.button1.Location = new System.Drawing.Point(20, 84); + this.button1.Margin = new System.Windows.Forms.Padding(4); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(180, 28); + this.button1.TabIndex = 18; + this.button1.Text = "Map File ..."; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // tmxFileTextBox + // + this.tmxFileTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.tmxFileTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::Tiled2Unity.Properties.Settings.Default, "LastExportDirectory", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); + this.tmxFileTextBox.Location = new System.Drawing.Point(208, 87); + this.tmxFileTextBox.Margin = new System.Windows.Forms.Padding(4); + this.tmxFileTextBox.Name = "tmxFileTextBox"; + this.tmxFileTextBox.ReadOnly = true; + this.tmxFileTextBox.Size = new System.Drawing.Size(828, 22); + this.tmxFileTextBox.TabIndex = 19; + this.tmxFileTextBox.Text = global::Tiled2Unity.Properties.Settings.Default.LastExportDirectory; + // // Tiled2UnityForm // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.ClientSize = new System.Drawing.Size(824, 481); + this.ClientSize = new System.Drawing.Size(1109, 740); + this.Controls.Add(this.button1); + this.Controls.Add(this.tmxFileTextBox); this.Controls.Add(this.richTextBoxLaunchTip); this.Controls.Add(this.groupBoxReviewExport); this.Controls.Add(this.groupBoxOutput); @@ -521,7 +577,8 @@ private void InitializeComponent() this.Controls.Add(this.menuStrip); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MainMenuStrip = this.menuStrip; - this.MinimumSize = new System.Drawing.Size(840, 520); + this.Margin = new System.Windows.Forms.Padding(4); + this.MinimumSize = new System.Drawing.Size(1117, 633); this.Name = "Tiled2UnityForm"; this.Text = "Tiled2Unity"; this.menuStrip.ResumeLayout(false); @@ -583,6 +640,8 @@ private void InitializeComponent() private System.Windows.Forms.GroupBox groupBoxReviewExport; private System.Windows.Forms.TableLayoutPanel tableLayoutPanelReviewExport; private System.Windows.Forms.RichTextBox richTextBoxLaunchTip; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.TextBox tmxFileTextBox; } } diff --git a/tool/Tiled2Unity/src/Tiled2UnityForm.cs b/tool/Tiled2Unity/src/Tiled2UnityForm.cs index df380a0..dcdb063 100644 --- a/tool/Tiled2Unity/src/Tiled2UnityForm.cs +++ b/tool/Tiled2Unity/src/Tiled2UnityForm.cs @@ -18,7 +18,7 @@ public partial class Tiled2UnityForm : Form private static readonly string Tiled2UnityObjectTypesXmlFilter = "Tiled Object Types XML|*.xml"; private Tiled2Unity.Session tmxSession = new Session(); - + private String tmxFileName = ""; public Tiled2UnityForm() { InitializeComponent(); @@ -170,6 +170,7 @@ void ChooseExportPath_FileOk(object sender, CancelEventArgs e) private void buttonViewer_Click(object sender, EventArgs e) { + this.tmxSession.LoadTmxFile(this.tmxFileName); if (this.tmxSession.TmxMap.IsLoaded) { Tiled2UnityViewer viewer = new Tiled2UnityViewer(this.tmxSession.TmxMap); @@ -183,6 +184,7 @@ private void buttonViewer_Click(object sender, EventArgs e) private void buttonExport_Click(object sender, EventArgs e) { + this.tmxSession.LoadTmxFile(this.tmxFileName); this.tmxSession.ExportTmxMap(); } @@ -199,7 +201,8 @@ private void openTiledFileToolStripMenuItem_Click(object sender, EventArgs e) { Properties.Settings.Default.LastOpenDirectory = Path.GetDirectoryName(dialog.FileName); Properties.Settings.Default.Save(); - this.tmxSession.LoadTmxFile(dialog.FileName); + this.tmxFileName = dialog.FileName; + } } @@ -333,6 +336,23 @@ private void buttonClearObjectTypes_Click(object sender, EventArgs e) this.tmxSession.TmxMap.ClearObjectTypeXml(); } + private void button1_Click(object sender, EventArgs e) + { + OpenFileDialog dialog = new OpenFileDialog(); + dialog.InitialDirectory = Properties.Settings.Default.LastOpenDirectory; + dialog.Title = "Open Tiled (*.tmx) File"; + dialog.Filter = "TMX files (*.tmx)|*.tmx"; + dialog.RestoreDirectory = true; + dialog.Multiselect = false; + + if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) + { + Properties.Settings.Default.LastOpenDirectory = Path.GetDirectoryName(dialog.FileName); + Properties.Settings.Default.Save(); + this.tmxFileName = dialog.FileName; + + } + } } } From f7d98e935ab14c0ba65b9271cde159ef44395c09 Mon Sep 17 00:00:00 2001 From: Mark Williamson Date: Wed, 7 Sep 2016 13:03:50 -0500 Subject: [PATCH 2/3] Implemented drag and drop multiple tmx files onto form, export will generate prefabs for each dropped tmx file. --- .../src/Tiled2UnityForm.Designer.cs | 14 ++-- tool/Tiled2Unity/src/Tiled2UnityForm.cs | 67 +++++++++++++++++-- 2 files changed, 70 insertions(+), 11 deletions(-) diff --git a/tool/Tiled2Unity/src/Tiled2UnityForm.Designer.cs b/tool/Tiled2Unity/src/Tiled2UnityForm.Designer.cs index fdb0db7..6d96668 100644 --- a/tool/Tiled2Unity/src/Tiled2UnityForm.Designer.cs +++ b/tool/Tiled2Unity/src/Tiled2UnityForm.Designer.cs @@ -282,6 +282,7 @@ private void InitializeComponent() this.textBoxExportFolder.Size = new System.Drawing.Size(828, 22); this.textBoxExportFolder.TabIndex = 8; this.textBoxExportFolder.Text = global::Tiled2Unity.Properties.Settings.Default.LastExportDirectory; + this.textBoxExportFolder.TextChanged += new System.EventHandler(this.textBoxExportFolder_TextChanged); // // checkBoxPreferConvexPolygons // @@ -433,9 +434,9 @@ private void InitializeComponent() this.labelScaleDescription.Location = new System.Drawing.Point(137, 7); this.labelScaleDescription.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.labelScaleDescription.Name = "labelScaleDescription"; - this.labelScaleDescription.Size = new System.Drawing.Size(432, 17); + this.labelScaleDescription.Size = new System.Drawing.Size(428, 17); this.labelScaleDescription.TabIndex = 7; - this.labelScaleDescription.Text = "Scale is inverse of Unity\'s \"Pixels Per Unit\" Texture Importer setting."; + this.labelScaleDescription.Text = "Use Tile Height or Unity\'s Pixels Per Unit setting (Sprite properties)"; // // tableLayoutPanelObjectTypes // @@ -552,17 +553,18 @@ private void InitializeComponent() // tmxFileTextBox // this.tmxFileTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.tmxFileTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::Tiled2Unity.Properties.Settings.Default, "LastExportDirectory", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); + //this.tmxFileTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::Tiled2Unity.Properties.Settings.Default, "LastExportDirectory", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.tmxFileTextBox.Location = new System.Drawing.Point(208, 87); this.tmxFileTextBox.Margin = new System.Windows.Forms.Padding(4); this.tmxFileTextBox.Name = "tmxFileTextBox"; this.tmxFileTextBox.ReadOnly = true; this.tmxFileTextBox.Size = new System.Drawing.Size(828, 22); - this.tmxFileTextBox.TabIndex = 19; - this.tmxFileTextBox.Text = global::Tiled2Unity.Properties.Settings.Default.LastExportDirectory; + this.tmxFileTextBox.TabIndex = 2; + this.tmxFileTextBox.Text = ""; // // Tiled2UnityForm // + this.AllowDrop = true; this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.ControlLightLight; @@ -581,6 +583,8 @@ private void InitializeComponent() this.MinimumSize = new System.Drawing.Size(1117, 633); this.Name = "Tiled2UnityForm"; this.Text = "Tiled2Unity"; + this.DragDrop += new System.Windows.Forms.DragEventHandler(this.Tiled2UnityForm_DragDrop); + this.DragEnter += new System.Windows.Forms.DragEventHandler(this.Tiled2UnityForm_DragEnter); this.menuStrip.ResumeLayout(false); this.menuStrip.PerformLayout(); this.groupBoxAdvancedOptions.ResumeLayout(false); diff --git a/tool/Tiled2Unity/src/Tiled2UnityForm.cs b/tool/Tiled2Unity/src/Tiled2UnityForm.cs index dcdb063..3d77d0a 100644 --- a/tool/Tiled2Unity/src/Tiled2UnityForm.cs +++ b/tool/Tiled2Unity/src/Tiled2UnityForm.cs @@ -18,7 +18,7 @@ public partial class Tiled2UnityForm : Form private static readonly string Tiled2UnityObjectTypesXmlFilter = "Tiled Object Types XML|*.xml"; private Tiled2Unity.Session tmxSession = new Session(); - private String tmxFileName = ""; + public Tiled2UnityForm() { InitializeComponent(); @@ -170,7 +170,12 @@ void ChooseExportPath_FileOk(object sender, CancelEventArgs e) private void buttonViewer_Click(object sender, EventArgs e) { - this.tmxSession.LoadTmxFile(this.tmxFileName); + if(this.tmxFileTextBox.Text.Contains(";")) + { + MessageBox.Show("Cannot preview multiple tile maps."); + return; + } + this.tmxSession.LoadTmxFile(this.tmxFileTextBox.Text); if (this.tmxSession.TmxMap.IsLoaded) { Tiled2UnityViewer viewer = new Tiled2UnityViewer(this.tmxSession.TmxMap); @@ -184,8 +189,24 @@ private void buttonViewer_Click(object sender, EventArgs e) private void buttonExport_Click(object sender, EventArgs e) { - this.tmxSession.LoadTmxFile(this.tmxFileName); - this.tmxSession.ExportTmxMap(); + if (this.tmxFileTextBox.Text.Contains(";")) + { + if (DialogResult.Cancel == MessageBox.Show("About to export multiple tile maps. Proceed?", "Confirm export", MessageBoxButtons.OKCancel)) + { + return; + } + String[] mapfiles = this.tmxFileTextBox.Text.Split(';'); + for (int i = 0; i < mapfiles.Length; i++) + { + this.tmxSession.LoadTmxFile(mapfiles[i]); + this.tmxSession.ExportTmxMap(); + } + } else + { + this.tmxSession.LoadTmxFile(this.tmxFileTextBox.Text); + this.tmxSession.ExportTmxMap(); + } + } private void openTiledFileToolStripMenuItem_Click(object sender, EventArgs e) @@ -201,8 +222,9 @@ private void openTiledFileToolStripMenuItem_Click(object sender, EventArgs e) { Properties.Settings.Default.LastOpenDirectory = Path.GetDirectoryName(dialog.FileName); Properties.Settings.Default.Save(); - this.tmxFileName = dialog.FileName; + this.tmxFileTextBox.Text = dialog.FileName; + } } @@ -349,10 +371,43 @@ private void button1_Click(object sender, EventArgs e) { Properties.Settings.Default.LastOpenDirectory = Path.GetDirectoryName(dialog.FileName); Properties.Settings.Default.Save(); - this.tmxFileName = dialog.FileName; + this.tmxFileTextBox.Text = dialog.FileName; } } + + private void Tiled2UnityForm_DragEnter(object sender, DragEventArgs e) + { + if (e.Data.GetDataPresent(DataFormats.FileDrop)) + e.Effect = DragDropEffects.Copy; + + } + + private void Tiled2UnityForm_DragDrop(object sender, DragEventArgs e) + { + var dropped = ((string[])e.Data.GetData(DataFormats.FileDrop)); + var files = dropped.ToList(); + List fileList = new List(); + if (!files.Any()) + return; + + foreach (string drop in dropped) + if (Directory.Exists(drop)) + files.AddRange(Directory.GetFiles(drop, "*.tmx", SearchOption.AllDirectories)); + + foreach (string file in files) + { + if (!fileList.Contains(file) && file.ToLower().EndsWith(".tmx")) + fileList.Add(file); + } + this.tmxFileTextBox.Text = String.Join(";", fileList.ToArray()); + + } + + private void textBoxExportFolder_TextChanged(object sender, EventArgs e) + { + + } } } From 289404e8b4a87619357730ba9ac6ade004d7713b Mon Sep 17 00:00:00 2001 From: Mark Williamson Date: Wed, 7 Sep 2016 13:11:10 -0500 Subject: [PATCH 3/3] .gitignore for .net developers https://gist.github.com/mahdi/1119793 --- .gitignore | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/.gitignore b/.gitignore index 58bcbf8..64b9393 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ $RECYCLE.BIN/ *.msm *.msp + # ========================= # Operating System Files # ========================= @@ -41,3 +42,55 @@ Icon Network Trash Folder Temporary Items .apdisk + +#Junk Files +*.DS_Store +[Tt]humbs.db + +#Visual Studio Files +[Oo]bj +[Bb]in +[Dd]ebug +[Bb]uild/ +*.user +*.suo +*.exe +*.pdb +*.aps +*_i.c +*_p.c +*.ncb +*.tlb +*.tlh +*.[Cc]ache +*.bak +*.ncb +*.ilk +*.log +*.lib +*.sbr +*.sdf +ipch/ +*.dbmdl +*.csproj.user +*.cache +*.swp +*.vspscc +*.vssscc +*.bak.* +*.bak + +#Tools +_ReSharper.* +_ReSharper*/ +*.resharper +*.resharper.user +[Nn][Dd]epend[Oo]ut*/ +Ankh.NoLoad + +#Other +.svn + +# Include DLLs if they're in the NuGet packages directory +!/packages/*/lib/*.dll +!/packages/*/lib/*/*.dll \ No newline at end of file