Пример #1
0
        private void ux_AddLayer_Click(object sender, EventArgs e)
        {
            var dialog = new AddLayer(CurrentLevel.MapLayers);
            var result = dialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                // create a layer object
                // TODO: make sure this is relative to one of the content directories...
                var layer = new MapLayer {
                    TileSetTexturePath = dialog.TileSet,
                    TileSize           = dialog.TileSize,
                    Name = dialog.LayerName
                };

                CurrentLevel.MapLayers.Add(layer);

                RefreshLayerList();
            }
        }
Пример #2
0
        private void ux_AddLayer_Click( object sender, EventArgs e )
        {
            var dialog = new AddLayer( CurrentLevel.MapLayers );
            var result = dialog.ShowDialog();
            if( result == DialogResult.OK )
            {
                // create a layer object
                // TODO: make sure this is relative to one of the content directories...
                var layer = new MapLayer {
                    TileSetTexturePath = dialog.TileSet,
                    TileSize = dialog.TileSize,
                    Name = dialog.LayerName
                };

                CurrentLevel.MapLayers.Add( layer );

                RefreshLayerList();
            }
        }