Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/TSMapEditor/Rendering/MapView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1614,10 +1614,9 @@ private static void DrawArrow(Vector2 start, Vector2 end,

public void Draw(bool isActive, TechnoBase technoUnderCursor, MapTile tileUnderCursor, CursorAction cursorAction)
{
if (isActive && tileUnderCursor != null && cursorAction != null)
{
cursorAction.PreMapDraw(tileUnderCursor.CoordsToPoint());
}
// Note: the cursor action's PreMapDraw is invoked by MapUI.Draw before this method,
// so that TechnoUnderCursor assignments made by placement previews are
// visible to DrawPerFrameTransparentElements below.

if (mapInvalidated || cameraMoved)
{
Expand Down
6 changes: 6 additions & 0 deletions src/TSMapEditor/UI/MapUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,12 @@ public void DeleteObjectFromCell(Point2D cellCoords)

public override void Draw(GameTime gameTime)
{
// Run the cursor action's pre-map-draw logic before passing TechnoUnderCursor
// to the renderer, so that placement previews (which assign TechnoUnderCursor)
// get their range indicators drawn during placement.
if (IsActive && tileUnderCursor != null && CursorAction != null)
CursorAction.PreMapDraw(tileUnderCursor.CoordsToPoint());

mapView.Draw(IsActive, TechnoUnderCursor, tileUnderCursor, CursorAction);

mapView.DrawOnTileUnderCursor(tileUnderCursor, CursorAction, isDraggingObject,
Expand Down
Loading