(svn r20753) -Feature [FS#3999]: make it possible to select vehicle to clone and vehicle to clone orders from directly from vehicle lists and depot window

This commit is contained in:
smatz
2010-09-06 14:14:09 +00:00
parent d2572f94d2
commit fd54943c7a
11 changed files with 77 additions and 111 deletions

View File

@@ -1805,14 +1805,19 @@ static bool CheckClickOnLandscape(const ViewPort *vp, int x, int y)
bool HandleViewportClicked(const ViewPort *vp, int x, int y)
{
const Vehicle *v;
const Vehicle *v = CheckClickOnVehicle(vp, x, y);
if (_thd.place_mode & HT_VEHICLE) {
if (v != NULL && VehicleClicked(v)) return true;
}
if (_thd.place_mode & HT_DRAG_MASK) return false;
if (CheckClickOnTown(vp, x, y)) return true;
if (CheckClickOnStation(vp, x, y)) return true;
if (CheckClickOnSign(vp, x, y)) return true;
CheckClickOnLandscape(vp, x, y);
v = CheckClickOnVehicle(vp, x, y);
if (v != NULL) {
DEBUG(misc, 2, "Vehicle %d (index %d) at %p", v->unitnumber, v->index, v);
if (IsCompanyBuildableVehicleType(v)) {
@@ -1971,7 +1976,7 @@ void UpdateTileSelection()
_thd.new_size.y = y2 - y1 + TILE_SIZE;
_thd.new_drawstyle = _thd.next_drawstyle;
}
} else if (_thd.place_mode != HT_NONE) {
} else if ((_thd.place_mode & HT_DRAG_MASK) != HT_NONE) {
Point pt = GetTileBelowCursor();
x1 = pt.x;
y1 = pt.y;