diff options
author | rubidium <rubidium@openttd.org> | 2008-05-17 13:01:30 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-05-17 13:01:30 +0000 |
commit | ad6e52080c8ed09306e0f6603bb69d8af0310892 (patch) | |
tree | 46351975e7a6b7a08ca8eedc476a4109e9a1b776 /src/vehicle_gui.cpp | |
parent | a89b5721a8bff2a601161a1dc456f588c065b0eb (diff) | |
download | openttd-ad6e52080c8ed09306e0f6603bb69d8af0310892.tar.xz |
(svn r13140) -Codechange: move the gui-list-sorting out of window_gui.h so window_gui.h only needs to be included in *_gui.cpp.
Diffstat (limited to 'src/vehicle_gui.cpp')
-rw-r--r-- | src/vehicle_gui.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 274c9e20f..7fcd64b5b 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -2171,3 +2171,12 @@ void DrawVehicleImage(const Vehicle *v, int x, int y, VehicleID selection, int c default: NOT_REACHED(); } } + +void StopGlobalFollowVehicle(const Vehicle *v) +{ + Window *w = FindWindowById(WC_MAIN_WINDOW, 0); + if (w != NULL && w->viewport->follow_vehicle == v->index) { + ScrollMainWindowTo(v->x_pos, v->y_pos, true); // lock the main view on the vehicle's last position + w->viewport->follow_vehicle = INVALID_VEHICLE; + } +} |