Esempio n. 1
0
        public override void Draw(Graphics graphics, int tileSize)
        {
            var rect = location.ToRectangle(tileSize);

            rect.Inflate(-1, -1);
            graphics.DrawRectangle(Pen, rect);
        }
Esempio n. 2
0
        protected override void OnMouseMove(MouseEventArgs e)
        {
            base.OnMouseMove(e);

            var location = new TileLocation(e.X / _owner.TileSize, e.Y / _owner.TileSize);

            if (currentTileLocation == location || !location.IsValid())
            {
                return;
            }
            var previousTileLocation = currentTileLocation;

            currentTileLocation = location;

            _owner.EditorTool.OnMouseMove(this, location, _mouseButtons, ModifierKeys);

            var upperTile = Level.UpperLayer[location];
            var lowerTile = Level.LowerLayer[location];

            if (upperTile != Tile.Floor || lowerTile != Tile.Floor)
            {
                _owner.ItemDescriptionStatusText = lowerTile == Tile.Floor ? TileUtilities.GetDescription(upperTile) : string.Format(CultureInfo.CurrentCulture, "{0} | {1}", TileUtilities.GetDescription(upperTile), TileUtilities.GetDescription(lowerTile));
            }
            else
            {
                _owner.ItemDescriptionStatusText = string.Empty;
            }

            Invalidate(previousTileLocation.ToRectangle(_owner.TileSize));
            Invalidate(location.ToRectangle(_owner.TileSize));

            UpdateTileCoordinatesAndHighlights();
        }
Esempio n. 3
0
        private void DrawCurrentTile(Graphics graphics)
        {
            var rectangle = currentTileLocation.ToRectangle(_owner.TileSize);
            var decrease  = Math.Max(_owner.TileSize / 16, 1);

            rectangle.Inflate(-decrease, -decrease);
            graphics.FillRectangle(CurrentTileBrush, rectangle);
            graphics.DrawRectangle(CurrentTilePen, rectangle);
        }
Esempio n. 4
0
 public void Invalidate(TileLocation location)
 {
     Invalidate(location.ToRectangle(_owner.TileSize));
 }