private void mapView_MouseClick(object sender, MouseEventArgs e)
        {
            if (_placementMode == PlacementMode.Paint)
            {
                if (e.Button == MouseButtons.Left)
                {
                    this.PlaceTile((e.X + (int)_camera.Position.X) / Constants.TILE_SIZE,
                                   (e.Y + (int)_camera.Position.Y) / Constants.TILE_SIZE);
                }
                else
                {
                    this.RemoveTile((e.X + (int)_camera.Position.X) / Constants.TILE_SIZE,
                                    (e.Y + (int)_camera.Position.Y) / Constants.TILE_SIZE);
                }
            }
            else if (_placementMode == PlacementMode.Erase)
            {
                this.RemoveTile((e.X + (int)_camera.Position.X) / Constants.TILE_SIZE, (e.Y + (int)_camera.Position.Y) / Constants.TILE_SIZE);
            }
            else if (_placementMode == PlacementMode.Fill)
            {
                for (int x = 0; x < _map.Dimensions.X; x++)
                {
                    for (int y = 0; y < _map.Dimensions.Y; y++)
                    {
                        this.PlaceTile(x, y);
                    }
                }
            }
            else if (_placementMode == PlacementMode.MapObject)
            {
                this.PlaceMapObject((e.X + (int)_camera.Position.X) / Constants.TILE_SIZE, (e.Y + (int)_camera.Position.Y) / Constants.TILE_SIZE);
            }
            else if (_placementMode == PlacementMode.Place_Attribute)
            {
                if (e.Button == MouseButtons.Left)
                {
                    this.PlaceTileAttribute((e.X + (int)_camera.Position.X) / Constants.TILE_SIZE,
                                            (e.Y + (int)_camera.Position.Y) / Constants.TILE_SIZE, _dockMapAttributes.Attribute);
                }
                else
                {
                    this.RemoveMapAttribute((e.X + (int)_camera.Position.X) / Constants.TILE_SIZE,
                                            (e.Y + (int)_camera.Position.Y) / Constants.TILE_SIZE);
                }
            }
            else if (_placementMode == PlacementMode.Picking_Tile)
            {
                _tileAttributeDialog.WarpX         = (int)(e.X + _camera.Position.X);
                _tileAttributeDialog.WarpY         = (int)(e.Y + _camera.Position.Y);
                _tileAttributeDialog.WarpMapID     = _map.Name;
                _tileAttributeDialog.WarpLayerName = _dockLayers.SelectedLayer;
                _tileAttributeDialog.Show();

                _placementMode = _prevPlacementMode;
            }
        }
예제 #2
0
        private void btnWarp_CheckedChanged(object sender, EventArgs e)
        {
            if (!((DarkRadioButton)sender).Checked)
            {
                return;
            }

            _tileAttributeDialog             = new WarpAttributeDialog(this.ParentForm, this.MapSubject);
            _tileAttributeDialog.SelectTile += (o, args) => this.SelectingTile?.Invoke(o, args);
            _tileAttributeDialog.Submitted  += WarpDialog_Submitted;
            _tileAttributeDialog.Show(this.ParentForm);
        }