Example #1
0
        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);
                }
            }
        }
Example #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);
                }
            }
        }
Example #3
0
        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);
            }
        }
Example #6
0
        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);
            }
        }
Example #7
0
        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);
                }
            }
        }
Example #8
0
        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);
                }
            }
        }