Little fix for "indian" code
Signed-off-by: katzsmile <katzsmile@lead-games.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
13
OpenRA.Editor/MapSelect.Designer.cs
generated
13
OpenRA.Editor/MapSelect.Designer.cs
generated
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
@@ -30,7 +32,7 @@ namespace OpenRA.Editor
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user