示例#1
0
 private void appendTilesItem_Click(object sender, EventArgs e)
 {
     using (StringInputForm form = new StringInputForm("Append Tiles", "Add how many tiles?"))
     {
         form.NumOnly = true;
         if (form.ShowDialog() == DialogResult.OK)
         {
             AddTiles((short)_tileset.Tiles.Count, short.Parse(form.Input));
         }
     }
 }
示例#2
0
 private void removeTilesItem_Click(object sender, EventArgs e)
 {
     using (StringInputForm form = new StringInputForm("Remove Tiles", "Remove how many tiles?"))
     {
         form.NumOnly = true;
         if (form.ShowDialog() == DialogResult.OK)
         {
             RemoveTiles(int.Parse(form.Input));
         }
     }
 }
示例#3
0
        private void SetDelayItem_Click(object sender, EventArgs e)
        {
            StringInputForm frm = new StringInputForm("Set Frame Delay");

            frm.Input   = SelectedFrame.Delay.ToString();
            frm.NumOnly = true;
            if (frm.ShowDialog() == DialogResult.OK)
            {
                SelectedFrame.Delay = short.Parse(frm.Input);
            }
            SelectedFrame.Refresh();
        }
示例#4
0
 private void RenameLayerMenuItem_Click(object sender, EventArgs e)
 {
     using (var form = new StringInputForm("Rename Map Layer"))
     {
         form.Input = Layers.SelectedItem.Text;
         if (form.ShowDialog() == DialogResult.OK)
         {
             Layers.SelectedItem.Text = form.Input;
         }
         Refresh();
     }
 }
示例#5
0
        private static int ShowStringInputDialog(String Title, String Prompt,
                                                 ref String InputString)
        {
            DialogResult result;

            result = StringInputForm.ShowModal(Title, "", Prompt, ref InputString);
            if (result == DialogResult.OK)
            {
                return(1);
            }
            else
            {
                return(0);
            }
        }
示例#6
0
        /// <summary>
        /// Adds a blank layer to the map
        /// </summary>
        /// <param name="name"> The name of the layer </param>
        public Layer AddLayer(string name)
        {
            StringInputForm form = new StringInputForm();

            form.Input = name;
            if (form.ShowDialog() == DialogResult.OK)
            {
                name = form.Input;
            }
            Layer lay = new Layer(name, (short)BaseWidth, (short)BaseHeight, tile_width, tile_height);

            lay.Zoom = _zoom;
            lay.UpdateDrawingWindow(Width, Height);
            Layers.Add(lay);
            if (Layers.Count > 1)
            {
                UpdateAllLayers();
            }
            ResetHistory();
            return(lay);
        }
示例#7
0
        private void AddFolderItem_Click(object sender, EventArgs e)
        {
            using (var form = new StringInputForm("Create New Folder", "What do you want to name the new folder?"))
            {
                form.Input = "Untitled Folder";
                if (form.ShowDialog() == DialogResult.OK)
                {
                    string path = "";
                    if (ProjectTreeView.SelectedNode.Index == 0)
                    {
                        path = Path.Combine(Core.Project.RootPath, form.Input);
                    }
                    else
                    {
                        string toppath = ProjectTreeView.SelectedNode.FullPath;
                        toppath = toppath.Substring(toppath.IndexOf('\\'));
                        string rootpath = Core.Project.RootPath + toppath;
                        path = Path.Combine(rootpath, form.Input);
                    }

                    if (!Directory.Exists(path))
                    {
                        Directory.CreateDirectory(path);
                        TreeNode node = new TreeNode(form.Input, 2, 1)
                        {
                            Tag = "directory-node"
                        };
                        ProjectTreeView.SelectedNode.Nodes.Add(node);
                    }
                    else
                    {
                        MessageBox.Show("Directory already exists!", "Directory Exists", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                }
            }
        }
示例#8
0
 /// <summary>
 /// Adds a blank layer to the map
 /// </summary>
 /// <param name="name"> The name of the layer </param>
 public Layer AddLayer(string name)
 {
     StringInputForm form = new StringInputForm();
     form.Input = name;
     if (form.ShowDialog() == DialogResult.OK) name = form.Input;
     Layer lay = new Layer(name, (short)BaseWidth, (short)BaseHeight, tile_width, tile_height);
     lay.Zoom = _zoom;
     lay.UpdateDrawingWindow(Width, Height);
     Layers.Add(lay);
     if (Layers.Count > 1) UpdateAllLayers();
     ResetHistory();
     return lay;
 }