From e0171330c16b2bfb1bd6077468b88c1133cbfd29 Mon Sep 17 00:00:00 2001 From: frosch Date: Mon, 22 Feb 2010 20:53:45 +0000 Subject: (svn r19216) -Feature: Scroll to current order destination when ctrl+clicking the start/stop bar. --- src/vehicle_gui.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/vehicle_gui.cpp') 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); -- cgit v1.2.3-54-g00ecf