Skip to content

Commit e7c7e0f

Browse files
authored
Allow ending tunnel by double-clicking on an existing tunnel node
1 parent 967072d commit e7c7e0f

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/TSMapEditor/UI/CursorActions/PlaceTubeCursorAction.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,14 +241,18 @@ public override void LeftClick(Point2D cellCoords)
241241
points.Add(cellCoords);
242242
RefreshTube();
243243
TubeRefreshHelper.MapViewRefreshTube(tube, CursorActionTarget.MutationTarget);
244-
lastClickedCell = cellCoords;
245-
lastClickedCellDateTime = DateTime.Now;
246244
}
247245
else
248246
{
249247
if (points.Count > 1 && lastClickedCell == cellCoords && DateTime.Now - lastClickedCellDateTime < TimeSpan.FromSeconds(DoubleClickTime))
248+
{
250249
ConfirmTube();
250+
return;
251+
}
251252
}
253+
254+
lastClickedCell = cellCoords;
255+
lastClickedCellDateTime = DateTime.Now;
252256
}
253257
}
254258
}

0 commit comments

Comments
 (0)