summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-02-22 20:53:45 +0000
committerfrosch <frosch@openttd.org>2010-02-22 20:53:45 +0000
commite0171330c16b2bfb1bd6077468b88c1133cbfd29 (patch)
tree9d8a0555fdd62bd99e5d0706654ad2666ca16df6 /src
parent3222ace3e1f522d8095cc5e1979f98499e2f09fe (diff)
downloadopenttd-e0171330c16b2bfb1bd6077468b88c1133cbfd29.tar.xz
(svn r19216) -Feature: Scroll to current order destination when ctrl+clicking the start/stop bar.
Diffstat (limited to 'src')
-rw-r--r--src/lang/english.txt8
-rw-r--r--src/vehicle_gui.cpp11
2 files changed, 13 insertions, 6 deletions
diff --git a/src/lang/english.txt b/src/lang/english.txt
index 668d4ba46..f52fc8889 100644
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -2904,10 +2904,10 @@ STR_VEHICLE_VIEW_ROAD_VEHICLE_SHOW_DETAILS_TOOLTIP :{BLACK}Show roa
STR_VEHICLE_VIEW_SHIP_SHOW_DETAILS_TOOLTIP :{BLACK}Show ship details
STR_VEHICLE_VIEW_AIRCRAFT_SHOW_DETAILS_TOOLTIP :{BLACK}Show aircraft details
-STR_VEHICLE_VIEW_TRAIN_STATE_START_STOP_TOOLTIP :{BLACK}Current train action - click here to stop/start train
-STR_VEHICLE_VIEW_ROAD_VEHICLE_STATE_START_STOP_TOOLTIP :{BLACK}Current vehicle action - click here to stop/start vehicle
-STR_VEHICLE_VIEW_SHIP_STATE_START_STOP_TOOLTIP :{BLACK}Current ship action - click here to stop/start ship
-STR_VEHICLE_VIEW_AIRCRAFT_STATE_START_STOP_TOOLTIP :{BLACK}Current aircraft action - click here to stop/start aircraft
+STR_VEHICLE_VIEW_TRAIN_STATE_START_STOP_TOOLTIP :{BLACK}Current train action - click to stop/start train. Ctrl+Click to scroll to destination
+STR_VEHICLE_VIEW_ROAD_VEHICLE_STATE_START_STOP_TOOLTIP :{BLACK}Current vehicle action - click to stop/start vehicle. Ctrl+Click to scroll to destination
+STR_VEHICLE_VIEW_SHIP_STATE_START_STOP_TOOLTIP :{BLACK}Current ship action - click to stop/start ship. Ctrl+Click to scroll to destination
+STR_VEHICLE_VIEW_AIRCRAFT_STATE_START_STOP_TOOLTIP :{BLACK}Current aircraft action - click to stop/start aircraft. Ctrl+Click to scroll to destination
# Messages in the start stop button in the vehicle view
STR_VEHICLE_STATUS_LOADING_UNLOADING :{LTBLUE}Loading / Unloading
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);