Change: improve when to stops following vehicle (#12808)

- Changing zoom no longer stops following vehicle
- Key scrolling while following a vehicle stops following
- Autoscrolling while following a vehicle stops following
- Main viewport can begin following a vehicle at any zoom
This commit is contained in:
steve-goldman
2024-06-30 18:13:47 -05:00
committed by GitHub
parent 9e14f989f9
commit f5f488e778
4 changed files with 21 additions and 8 deletions
+2 -2
View File
@@ -3234,7 +3234,7 @@ public:
ShowExtraViewportWindow(TileVirtXY(v->x_pos, v->y_pos));
} else {
const Window *mainwindow = GetMainWindow();
if (click_count > 1 && mainwindow->viewport->zoom <= ZOOM_LVL_NORMAL) {
if (click_count > 1) {
/* main window 'follows' vehicle */
mainwindow->viewport->follow_vehicle = v->index;
} else {
@@ -3320,7 +3320,7 @@ public:
void OnMouseWheel(int wheel) override
{
if (_settings_client.gui.scrollwheel_scrolling != SWS_OFF) {
DoZoomInOutWindow(wheel < 0 ? ZOOM_IN : ZOOM_OUT, this, false);
DoZoomInOutWindow(wheel < 0 ? ZOOM_IN : ZOOM_OUT, this);
}
}