Beispiel #1
0
        private void TileContextSwap_Click(object sender, EventArgs e)
        {
            if (MapView.SelectedTiles.Count != 1)
            {
                return;
            }

            TileData       td  = MapView.SelectedTiles[0];
            Tile           t   = Session.FindTile(td.TileID, SearchType.Global);
            TileSelectForm dlg = new TileSelectForm(t.Size, t.Category);

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                // Swap tile
                int width  = (td.Rotations % 2 == 0) ? t.Size.Width : t.Size.Height;
                int height = (td.Rotations % 2 == 0) ? t.Size.Height : t.Size.Width;

                int rot = 0;
                if ((dlg.Tile.Size.Width != width) || (dlg.Tile.Size.Height != height))
                {
                    rot = 1;
                }

                td.TileID    = dlg.Tile.ID;
                td.Rotations = rot;

                MapView.MapChanged();
            }
        }
Beispiel #2
0
        private void UseTileBtn_Click(object sender, EventArgs e)
        {
            TileSelectForm dlg = new TileSelectForm(Size.Empty, TileCategory.Map);

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                TileData td = new TileData();
                td.TileID = dlg.Tile.ID;

                Map map = new Map();
                map.Name = Tools.FileName.Name("New Map");
                map.Tiles.Add(td);

                Session.Project.Maps.Add(map);
                Session.Modified = true;

                MapBox.Items.Add(map);
                MapBox.SelectedItem = map;
            }
        }
Beispiel #3
0
        private void UseTileBtn_Click(object sender, EventArgs e)
        {
            TileSelectForm tileSelectForm = new TileSelectForm(System.Drawing.Size.Empty, TileCategory.Map);

            if (tileSelectForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                TileData tileDatum = new TileData()
                {
                    TileID = tileSelectForm.Tile.ID
                };
                Masterplan.Data.Map map = new Masterplan.Data.Map()
                {
                    Name = FileName.Name("New Map")
                };
                map.Tiles.Add(tileDatum);
                Session.Project.Maps.Add(map);
                Session.Modified = true;
                this.MapBox.Items.Add(map);
                this.MapBox.SelectedItem = map;
            }
        }
Beispiel #4
0
        private void AddTile_Click(object sender, EventArgs e)
        {
            TileSelectForm tileSelectForm = new TileSelectForm(System.Drawing.Size.Empty, TileCategory.Map);

            if (tileSelectForm.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }
            TileData tileDatum = new TileData()
            {
                TileID = tileSelectForm.Tile.ID
            };
            Map map = new Map()
            {
                Name = FileName.Name("New Map")
            };

            map.Tiles.Add(tileDatum);
            Session.Project.Maps.Add(map);
            Session.Modified = true;
            this.update_maps();
        }
Beispiel #5
0
        private void AddTile_Click(object sender, EventArgs e)
        {
            TileSelectForm dlg = new TileSelectForm(Size.Empty, TileCategory.Map);

            if (dlg.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            TileData td = new TileData();

            td.TileID = dlg.Tile.ID;

            Map map = new Map();

            map.Name = Tools.FileName.Name("New Map");
            map.Tiles.Add(td);

            Session.Project.Maps.Add(map);
            Session.Modified = true;

            update_maps();
        }