Use a lower resort interval in veh windows when sorting by timetable delay
This commit is contained in:
@@ -1032,6 +1032,7 @@ public:
|
|||||||
|
|
||||||
case WID_GL_SORT_BY_DROPDOWN:
|
case WID_GL_SORT_BY_DROPDOWN:
|
||||||
this->vehgroups.SetSortType(index);
|
this->vehgroups.SetSortType(index);
|
||||||
|
this->UpdateSortingInterval();
|
||||||
break;
|
break;
|
||||||
case WID_GL_FILTER_BY_CARGO: // Select a cargo filter criteria
|
case WID_GL_FILTER_BY_CARGO: // Select a cargo filter criteria
|
||||||
this->SetCargoFilterIndex(index);
|
this->SetCargoFilterIndex(index);
|
||||||
|
@@ -3680,6 +3680,7 @@ public:
|
|||||||
switch (widget) {
|
switch (widget) {
|
||||||
case WID_TRSL_SORT_BY_DROPDOWN:
|
case WID_TRSL_SORT_BY_DROPDOWN:
|
||||||
this->vehgroups.SetSortType(index);
|
this->vehgroups.SetSortType(index);
|
||||||
|
this->UpdateSortingInterval();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WID_TRSL_FILTER_BY_CARGO: // Select a cargo filter criteria
|
case WID_TRSL_FILTER_BY_CARGO: // Select a cargo filter criteria
|
||||||
|
@@ -1995,6 +1995,13 @@ void BaseVehicleListWindow::DrawVehicleListItems(VehicleID selected_vehicle, int
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BaseVehicleListWindow::UpdateSortingInterval()
|
||||||
|
{
|
||||||
|
uint16 resort_interval = DAY_TICKS * 10;
|
||||||
|
if (this->grouping == GB_NONE && this->vehgroups.SortType() == VST_TIMETABLE_DELAY) resort_interval = DAY_TICKS;
|
||||||
|
this->vehgroups.SetResortInterval(resort_interval);
|
||||||
|
}
|
||||||
|
|
||||||
void BaseVehicleListWindow::UpdateSortingFromGrouping()
|
void BaseVehicleListWindow::UpdateSortingFromGrouping()
|
||||||
{
|
{
|
||||||
/* Set up sorting. Make the window-specific _sorting variable
|
/* Set up sorting. Make the window-specific _sorting variable
|
||||||
@@ -2011,6 +2018,7 @@ void BaseVehicleListWindow::UpdateSortingFromGrouping()
|
|||||||
this->vehgroups.SetListing(*this->sorting);
|
this->vehgroups.SetListing(*this->sorting);
|
||||||
this->vehgroups.ForceRebuild();
|
this->vehgroups.ForceRebuild();
|
||||||
this->vehgroups.NeedResort();
|
this->vehgroups.NeedResort();
|
||||||
|
this->UpdateSortingInterval();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseVehicleListWindow::UpdateVehicleGroupBy(GroupBy group_by)
|
void BaseVehicleListWindow::UpdateVehicleGroupBy(GroupBy group_by)
|
||||||
@@ -2314,6 +2322,7 @@ public:
|
|||||||
|
|
||||||
case WID_VL_SORT_BY_PULLDOWN:
|
case WID_VL_SORT_BY_PULLDOWN:
|
||||||
this->vehgroups.SetSortType(index);
|
this->vehgroups.SetSortType(index);
|
||||||
|
this->UpdateSortingInterval();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WID_VL_FILTER_BY_CARGO:
|
case WID_VL_FILTER_BY_CARGO:
|
||||||
|
@@ -133,6 +133,7 @@ public:
|
|||||||
|
|
||||||
void OnInit() override;
|
void OnInit() override;
|
||||||
|
|
||||||
|
void UpdateSortingInterval();
|
||||||
void UpdateSortingFromGrouping();
|
void UpdateSortingFromGrouping();
|
||||||
|
|
||||||
void DrawVehicleListItems(VehicleID selected_vehicle, int line_height, const Rect &r) const;
|
void DrawVehicleListItems(VehicleID selected_vehicle, int line_height, const Rect &r) const;
|
||||||
|
Reference in New Issue
Block a user