Пример #1
0
        private void addFolderToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var dialog = new FolderSelectDialog
            {
                InitialDirectory = Environment.CurrentDirectory,
                Title            = "Select a folder to tiles from."
            };

            if (dialog.Show(Handle))
            {
                TrinityEdit.CConsole.DebugMsg("Scanning folder:" + dialog.FileName + " for tiles.");
                //musicFolderTextBox.Text = dialog.FileName;
                foreach (var file in new System.IO.DirectoryInfo(dialog.FileName).GetFiles())
                {
                    TrinityEdit.CConsole.DebugMsg("File:" + file.Name);
                    TrinityEdit.CConsole.DebugMsg("Ext:" + file.Extension);

                    switch (file.Extension.ToLower())
                    {
                    case ".bmp":
                    case ".jpg":
                    case ".tga":
                    case ".png":
                        if (file.FullName.ToLower().Contains("nrm"))
                        {
                            continue;
                        }
                        var new_Tile = new TrinityEngine.Map.Tile.Tile(file.FullName);
                        Set.Tiles.Add(new_Tile);
                        break;
                    }
                }
            }
            RebuildMap();
        }
Пример #2
0
        private void View_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                DragOn = true;
            }

            if (e.Button == MouseButtons.Left)
            {
                if (p_hit != null)
                {
                    var htile = p_hit.Tile;

                    TileMap.SetActive(p_hit.TileX, p_hit.TileY);

                    if (htile != null)
                    {
                        ActiveTile = htile;
                        //    propGrid.Text = htile.ImagePath;
                        //      propGrid.SelectedObject = htile;
                    }
                }
            }

            //throw new NotImplementedException();
        }
Пример #3
0
        private void addImageToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var fd = new System.Windows.Forms.OpenFileDialog();

            fd.InitialDirectory = Environment.CurrentDirectory;

            fd.Title = "Select an image to add as a Tile";

            fd.CheckFileExists = true;

            fd.ShowDialog();

            if (System.IO.File.Exists(fd.FileName))
            {
                var new_Tile = new TrinityEngine.Map.Tile.Tile(fd.FileName);
                Set.Tiles.Add(new_Tile);
                RebuildMap();
                TrinityEdit.CConsole.DebugMsg("Adding tile:" + fd.FileName + " to set:" + Set.Name);
            }
        }