diff options
author | frosch <frosch@openttd.org> | 2010-02-22 20:53:45 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2010-02-22 20:53:45 +0000 |
commit | e0171330c16b2bfb1bd6077468b88c1133cbfd29 (patch) | |
tree | 9d8a0555fdd62bd99e5d0706654ad2666ca16df6 /src/vehicle_gui.cpp | |
parent | 3222ace3e1f522d8095cc5e1979f98499e2f09fe (diff) | |
download | openttd-e0171330c16b2bfb1bd6077468b88c1133cbfd29.tar.xz |
(svn r19216) -Feature: Scroll to current order destination when ctrl+clicking the start/stop bar.
Diffstat (limited to 'src/vehicle_gui.cpp')
-rw-r--r-- | src/vehicle_gui.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 9da03c143..c559702e7 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -2043,8 +2043,15 @@ public: switch (widget) { case VVW_WIDGET_START_STOP_VEH: // start stop - DoCommandP(v->tile, v->index, 0, - _vehicle_command_translation_table[VCT_CMD_START_STOP][v->type]); + if (_ctrl_pressed) { + /* Scroll to current order destination */ + TileIndex tile = v->current_order.GetLocation(v); + if (tile != INVALID_TILE) ScrollMainWindowToTile(tile); + } else { + /* Start/Stop */ + DoCommandP(v->tile, v->index, 0, + _vehicle_command_translation_table[VCT_CMD_START_STOP][v->type]); + } break; case VVW_WIDGET_CENTER_MAIN_VIEH: {// center main view const Window *mainwindow = FindWindowById(WC_MAIN_WINDOW, 0); |