(svn r11304) -Feature: Control-Clicking the Center Main View button on the vehicle window allows the main viewport to follow the chosen vehicle.(stevenh)

This commit is contained in:
belugas
2007-10-20 00:09:39 +00:00
parent 95f2181a1d
commit 705f0ae90c
2 changed files with 17 additions and 3 deletions

View File

@@ -1466,6 +1466,13 @@ static bool HandleViewportScroll()
w = FindWindowFromPt(_cursor.pos.x, _cursor.pos.y);
if (WP(w, vp_d).follow_vehicle != INVALID_VEHICLE && w == FindWindowById(WC_MAIN_WINDOW, 0)) {
/* If the main window is following a vehicle, then first let go of it! */
const Vehicle *veh = GetVehicle(WP(w, vp_d).follow_vehicle);
ScrollMainWindowTo(veh->x_pos, veh->y_pos, true); /* This also resets follow_vehicle */
return true;
}
if (!(_right_button_down || scrollwheel_scrolling) || w == NULL) {
_cursor.fix_at = false;
_scrolling_viewport = false;