1
0
Fork 0

Add: Show and toggle follow vehicle state in vehicle view window. (#13076)

* After double-clicking on a location button to follow a vehicle, show that state by drawing the location button in a lowered state.
* Allow cancelling the follow state by clicking on the location button again.
pull/13077/head
Peter Nelson 2024-11-12 17:36:24 +00:00 committed by GitHub
parent 78258f13bc
commit bbc1f7b3dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -3165,6 +3165,11 @@ public:
this->SetWidgetDisabledState(WID_VV_ORDER_LOCATION, v->current_order.GetLocation(v) == INVALID_TILE);
const Window *mainwindow = GetMainWindow();
if (mainwindow->viewport->follow_vehicle == v->index) {
this->LowerWidget(WID_VV_LOCATION);
}
this->DrawWidgets();
}
@ -3323,6 +3328,7 @@ public:
/* main window 'follows' vehicle */
mainwindow->viewport->follow_vehicle = v->index;
} else {
if (mainwindow->viewport->follow_vehicle == v->index) mainwindow->viewport->follow_vehicle = INVALID_VEHICLE;
ScrollMainWindowTo(v->x_pos, v->y_pos, v->z_pos);
}
}