public override void Excute()
        {
            if (form.TextureList.Items.Count > 0 && form.TextureList.SelectedItem != null)
            {
                LayerStateBeforeRecursion = new TileLayer(currentLayer.TileMapArray);
                foreach (Texture2D text in currentLayer.TexturesList)
                {
                    LayerStateBeforeRecursion.AddTexture(text);
                }

                fillCounter = 5000;
                FillCellIndex((int)form.TileX, (int)form.TileY, -1);
            }
        }
Esempio n. 2
0
        private void btnAddLayer_Click(object sender, EventArgs e)
        {
            string layerName;
            int layerWidth;
            int layerHeight;
            TileLayer layer;

            LayerForm Form = new LayerForm(LayerList.Items.Count);
            Form.ShowDialog();

            if (Form.OkPressed)
            {
                layerName = Form.txtLayerName.Text;
                layerWidth = int.Parse(Form.txtLayrWidth.Text);
                layerHeight = int.Parse(Form.txtLayHeight.Text);
                layer = new TileLayer(layerWidth, layerHeight);
                dictLayer.Add(layerName, layer);
                LayerList.Items.Add(layerName);
                Map.Addlayer(layer);
                currentLayer = layer;
                foreach (string s in TextureList.Items)
                {
                    currentLayer.AddTexture(dictTextures[s]);
                }
                LayerList.SetSelected(LayerList.Items.Count - 1, true);
            }
        }