Show info about facility/station/vehicle on mouse up instead of mouse down, to allow better map dragging.

This commit is contained in:
pelya
2014-06-01 01:23:34 +03:00
parent d2feaa9316
commit f469e7f57b
3 changed files with 47 additions and 6 deletions

View File

@@ -1953,18 +1953,24 @@ bool HandleViewportClicked(const ViewPort *vp, int x, int y)
{
if (_move_pressed) return false;
if ((_thd.place_mode & HT_DRAG_MASK) != HT_NONE) {
PlaceObject();
return true;
}
return false;
}
bool HandleViewportMouseUp(const ViewPort *vp, int x, int y)
{
if (_move_pressed) return false;
const Vehicle *v = CheckClickOnVehicle(vp, x, y);
if (_thd.place_mode & HT_VEHICLE) {
if (v != NULL && VehicleClicked(v)) return true;
}
/* Vehicle placement mode already handled above. */
if ((_thd.place_mode & HT_DRAG_MASK) != HT_NONE) {
PlaceObject();
return true;
}
if (CheckClickOnTown(vp, x, y)) return true;
if (CheckClickOnStation(vp, x, y)) return true;
if (CheckClickOnSign(vp, x, y)) return true;