private void Emulate() { if (WithinBounds(out var x, out var y)) { var tileSource = Layout.Current.Map.Tileset.GetIndexSource(tilePicker.SelectedTile); mousePosition.X = (float)Math.Floor(mousePosition.X / LayoutMap.TileSize) * LayoutMap.TileSize; mousePosition.Y = (float)Math.Floor(mousePosition.Y / LayoutMap.TileSize) * LayoutMap.TileSize; Renderer.Instance.Draw(Layout.Current.Map.Tileset.Texture, tileSource, mousePosition, new Color(200, 200, 200, 200)); } if (InputManager.WasMouseLeftPressed()) { paintCommand = new PaintTileCommand(Layout.Current.Map.Data); currentMode = Paint; } else if (InputManager.WasMouseRightPressed()) { paintCommand = new PaintTileCommand(Layout.Current.Map.Data); currentMode = Erase; } }
private void PushPaintCommand() { editorBase.Commands.Insert(paintCommand); paintCommand = null; }