(svn r19714) -Feature: ctrl+click on a vehicle to start/stop it

This commit is contained in:
smatz
2010-04-24 20:55:51 +00:00
parent 82136fbc62
commit e3c89df398
8 changed files with 42 additions and 7 deletions

View File

@@ -1811,7 +1811,14 @@ bool HandleViewportClicked(const ViewPort *vp, int x, int 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)) ShowVehicleViewWindow(v->First());
if (IsCompanyBuildableVehicleType(v)) {
v = v->First();
if (_ctrl_pressed && v->owner == _local_company) {
StartStopVehicle(v, true);
} else {
ShowVehicleViewWindow(v);
}
}
return true;
}
return CheckClickOnLandscape(vp, x, y);