示例#1
0
文件: Form1.cs 项目: ushalin/OpenRA
        void OpenClicked(object sender, EventArgs e)
        {
            using (var nms = new MapSelect(currentMod))
            {
                nms.NewText.ReadOnly     = true;
                nms.PathOutText.ReadOnly = true;
                nms.ButtonOkay.Text      = "Open";

                if (DialogResult.OK == nms.ShowDialog())
                {
                    LoadMap((string)nms.NewText.Tag);
                }
            }
        }
示例#2
0
        void OpenClicked(object sender, EventArgs e)
        {
            using (var nms = new MapSelect(currentMod))
            {
                nms.txtNew.ReadOnly     = true;
                nms.txtPathOut.ReadOnly = true;
                nms.btnOk.Text          = "Open";

                if (DialogResult.OK == nms.ShowDialog())
                {
                    LoadMap(nms.txtNew.Tag as string);
                }
            }
        }
示例#3
0
文件: Form1.cs 项目: ushalin/OpenRA
        void SaveAsClicked(object sender, EventArgs e)
        {
            using (var nms = new MapSelect(currentMod))
            {
                nms.NewText.ReadOnly     = false;
                nms.ButtonOkay.Text      = "Save";
                nms.NewText.Text         = "unnamed";
                nms.PathOutText.ReadOnly = false;

                if (DialogResult.OK == nms.ShowDialog())
                {
                    if (nms.NewText.Text == "")
                    {
                        nms.NewText.Text = "unnamed";
                    }

                    // TODO: Allow the user to choose map format (directory vs oramap)
                    loadedMapName = Path.Combine(nms.MapFolderPath, nms.NewText.Text + ".oramap");
                    SaveClicked(sender, e);
                }
            }
        }
        void SaveAsClicked(object sender, EventArgs e)
        {
            using (var nms = new MapSelect(currentMod))
            {
                nms.txtNew.ReadOnly = false;
                nms.btnOk.Text = "Save";
                nms.txtNew.Text = "unnamed";
                nms.txtPathOut.ReadOnly = false;

                if (DialogResult.OK == nms.ShowDialog())
                {
                    if (nms.txtNew.Text == "")
                        nms.txtNew.Text = "unnamed";

                    // TODO: Allow the user to choose map format (directory vs oramap)
                    loadedMapName = Path.Combine(nms.MapFolderPath, nms.txtNew.Text + ".oramap");
                    SaveClicked(sender, e);
                }
            }
        }
        void OpenClicked(object sender, EventArgs e)
        {
            using (var nms = new MapSelect(currentMod))
            {
                nms.txtNew.ReadOnly = true;
                nms.txtPathOut.ReadOnly = true;
                nms.btnOk.Text = "Open";

                if (DialogResult.OK == nms.ShowDialog())
                    LoadMap(nms.txtNew.Tag as string);
            }
        }
示例#6
0
文件: Form1.cs 项目: RunCraze/OpenRA
        void OpenClicked(object sender, EventArgs e)
        {
            using (var nms = new MapSelect(currentMod))
            {
                nms.NewText.ReadOnly = true;
                nms.PathOutText.ReadOnly = true;
                nms.ButtonOkay.Text = "Open";

                if (DialogResult.OK == nms.ShowDialog())
                    LoadMap((string)nms.NewText.Tag);
            }
        }
示例#7
0
文件: Form1.cs 项目: pdovy/OpenRA
        void SaveAsClicked(object sender, EventArgs e)
        {
            using (var nms = new MapSelect())
            {
                nms.MapFolderPath = new string[] { Environment.CurrentDirectory, "mods", currentMod, "maps" }
                .Aggregate(Path.Combine);

                nms.txtNew.ReadOnly = false;
                nms.btnOk.Text = "Save";
                nms.txtNew.Text = "unnamed";
                nms.txtPathOut.ReadOnly = false;

                if (DialogResult.OK == nms.ShowDialog())
                {
                    if (nms.txtNew.Text == "")
                        nms.txtNew.Text = "unnamed";

                    string mapfoldername = Path.Combine(nms.MapFolderPath, nms.txtNew.Text);
                    loadedMapName = mapfoldername;

                    try
                    {
                        Directory.CreateDirectory(mapfoldername);
                    }
                    catch (Exception ed)
                    {
                        MessageBox.Show("Directory creation failed: {0}", ed.ToString());
                    }

                    SaveClicked(sender, e);
                }
            }
        }
示例#8
0
文件: Form1.cs 项目: pdovy/OpenRA
        void OpenClicked(object sender, EventArgs e)
        {
            using (var nms = new MapSelect())
            {
                nms.MapFolderPath = new string[] { Environment.CurrentDirectory, "mods", currentMod, "maps" }
                .Aggregate(Path.Combine);

                nms.txtNew.ReadOnly = true;
                nms.txtPathOut.ReadOnly = true;
                nms.btnOk.Text = "Open";

                if (DialogResult.OK == nms.ShowDialog())
                {
                    string mapfoldername = Path.Combine(nms.MapFolderPath, nms.txtNew.Text);
                    LoadMap(mapfoldername);
                }
            }
        }