diff --git a/OpenRA.Editor/Form1.cs b/OpenRA.Editor/Form1.cs index 9292560bd1..f33faecd52 100644 --- a/OpenRA.Editor/Form1.cs +++ b/OpenRA.Editor/Form1.cs @@ -341,7 +341,7 @@ namespace OpenRA.Editor { using (var nms = new MapSelect()) { - nms.txtPath.Text = new string[] { Environment.CurrentDirectory, "mods", currentMod, "maps" } + nms.MapFolderPath = new string[] { Environment.CurrentDirectory, "mods", currentMod, "maps" } .Aggregate(Path.Combine); nms.lblNew.Visible = true; @@ -353,14 +353,14 @@ namespace OpenRA.Editor if (DialogResult.OK == nms.ShowDialog()) { string mapfolderitem = nms.MapList.SelectedItems[0].Text; - string mapfoldername = nms.txtPath.Text + '\\' + mapfolderitem; + string mapfoldername = nms.MapFolderPath + '\\' + mapfolderitem; if (nms.txtNew.Text == "") { - mapfoldername = nms.txtPath.Text + '\\' + mapfolderitem; + mapfoldername = nms.MapFolderPath + '\\' + mapfolderitem; } else { - mapfoldername = nms.txtPath.Text + '\\' + nms.txtNew.Text; + mapfoldername = nms.MapFolderPath + '\\' + nms.txtNew.Text; } DirectoryInfo directory = new DirectoryInfo(mapfoldername); loadedMapName = mapfoldername; @@ -398,7 +398,7 @@ namespace OpenRA.Editor using (var nms = new MapSelect()) { - nms.txtPath.Text = new string[] { Environment.CurrentDirectory, "mods", currentMod, "maps" } + nms.MapFolderPath = new string[] { Environment.CurrentDirectory, "mods", currentMod, "maps" } .Aggregate(Path.Combine); nms.lblNew.Visible = false; @@ -408,8 +408,7 @@ namespace OpenRA.Editor if (DialogResult.OK == nms.ShowDialog()) { string mapfolderitem = nms.MapList.SelectedItems[0].Text; - string mapfoldername = nms.txtPath.Text + '\\'+ mapfolderitem; - // nms.txtPath.Text + '\\'; + string mapfoldername = nms.MapFolderPath + '\\' + mapfolderitem; LoadMap(mapfoldername); } } diff --git a/OpenRA.Editor/MapSelect.Designer.cs b/OpenRA.Editor/MapSelect.Designer.cs index 5337410287..b74e90ad90 100644 --- a/OpenRA.Editor/MapSelect.Designer.cs +++ b/OpenRA.Editor/MapSelect.Designer.cs @@ -38,7 +38,6 @@ this.btnOk = new System.Windows.Forms.Button(); this.lblNew = new System.Windows.Forms.Label(); this.txtNew = new System.Windows.Forms.TextBox(); - this.txtPath = new System.Windows.Forms.TextBox(); this.colTitle = new System.Windows.Forms.ColumnHeader(); this.SuspendLayout(); // @@ -117,14 +116,6 @@ this.txtNew.TabIndex = 4; this.txtNew.Visible = false; // - // txtPath - // - this.txtPath.Location = new System.Drawing.Point(12, 307); - this.txtPath.Name = "txtPath"; - this.txtPath.Size = new System.Drawing.Size(448, 20); - this.txtPath.TabIndex = 5; - this.txtPath.Visible = false; - // // colTitle // this.colTitle.Text = "Title"; @@ -134,8 +125,7 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(472, 303); - this.Controls.Add(this.txtPath); + this.ClientSize = new System.Drawing.Size(472, 299); this.Controls.Add(this.txtNew); this.Controls.Add(this.lblNew); this.Controls.Add(this.btnOk); @@ -160,7 +150,6 @@ private System.Windows.Forms.ColumnHeader colMapName; private System.Windows.Forms.ColumnHeader colTheater; private System.Windows.Forms.ImageList MapIconsList; - public System.Windows.Forms.TextBox txtPath; public System.Windows.Forms.ListView MapList; public System.Windows.Forms.Button btnCancel; public System.Windows.Forms.Button btnOk; diff --git a/OpenRA.Editor/MapSelect.cs b/OpenRA.Editor/MapSelect.cs index d158b197d9..7ea86460f7 100644 --- a/OpenRA.Editor/MapSelect.cs +++ b/OpenRA.Editor/MapSelect.cs @@ -13,6 +13,8 @@ namespace OpenRA.Editor { public partial class MapSelect : Form { + public string MapFolderPath; + public MapSelect() { InitializeComponent(); @@ -21,7 +23,7 @@ namespace OpenRA.Editor private void MapSelect_Load(object sender, EventArgs e) { - DirectoryInfo directory = new DirectoryInfo(txtPath.Text); + DirectoryInfo directory = new DirectoryInfo(MapFolderPath); DirectoryInfo[] directories = directory.GetDirectories(); MapList.Items.Clear(); foreach (DirectoryInfo subDirectory in directories) @@ -29,8 +31,8 @@ namespace OpenRA.Editor ListViewItem map1 = new ListViewItem(subDirectory.Name); map1.ImageIndex = 0; MapList.Items.Add(map1); - - var map = new Map(new Folder(txtPath.Text + "\\" + subDirectory.Name)); + + var map = new Map(new Folder(MapFolderPath + "\\" + subDirectory.Name)); map1.SubItems.Add(map.Title); map1.SubItems.Add(map.Theater); }