From 87015f5b6395f15a624f67e25dce10fe52a12c81 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 17 May 2008 13:01:30 +0000 Subject: (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. --- src/vehicle_gui.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/vehicle_gui.cpp') 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; + } +} -- cgit v1.2.3-70-g09d2