예제 #1
0
        private void button_AddTile_Click(object sender, EventArgs e)
        {
            TileDialog NewTileForm = new TileDialog(myTileSet, null);

            if (NewTileForm.ShowDialog() == DialogResult.OK)
            {
                // Update the tile list
                listBox_Tiles.Items.Clear();
                for (int i = 0; i < myTileSet.Tiles.Count; i++)
                {
                    listBox_Tiles.Items.Add(myTileSet.Tiles[i]);
                }
            }

            //NewMapDialog NewMapForm = new NewMapDialog();
            //if (NewMapForm.ShowDialog() == DialogResult.OK)
        }
예제 #2
0
        // Make sure we pass the selected tile to the TileDialog
        private void button_EditTile_Click(object sender, EventArgs e)
        {
            Tile SelectedTile = (Tile)listBox_Tiles.SelectedItem;

            if (SelectedTile != null)
            {
                TileDialog AddTileForm = new TileDialog(myTileSet, SelectedTile);
                if (AddTileForm.ShowDialog() == DialogResult.OK)
                {
                    // Update the tile list
                    listBox_Tiles.Items.Clear();
                    for (int i = 0; i < myTileSet.Tiles.Count; i++)
                    {
                        listBox_Tiles.Items.Add(myTileSet.Tiles[i]);
                    }
                }
            }
        }