Show viewport route overlay for shared order vehicle list windows

This commit is contained in:
Jonathan G Rennison
2022-11-19 00:00:23 +00:00
parent 4990a25e48
commit b52bb3ca44
2 changed files with 31 additions and 0 deletions

View File

@@ -2133,6 +2133,15 @@ private:
BP_SHARED_ORDERS, ///< Show the normal caption.
};
void RefreshRouteOverlay() const
{
if (this->vli.type == VL_SHARED_ORDERS) {
const Vehicle *v = Vehicle::GetIfValid(this->vli.index);
MarkAllRoutePathsDirty(v);
MarkAllRouteStepsDirty(v);
}
}
public:
VehicleListWindow(WindowDesc *desc, WindowNumber window_number) : BaseVehicleListWindow(desc, window_number)
{
@@ -2168,6 +2177,17 @@ public:
~VehicleListWindow()
{
*this->sorting = this->vehgroups.GetListing();
this->RefreshRouteOverlay();
}
virtual void OnFocus(Window *previously_focused_window) override
{
this->RefreshRouteOverlay();
}
virtual void OnFocusLost(Window *newly_focused_window) override
{
this->RefreshRouteOverlay();
}
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override