diff options
-rw-r--r-- | src/vehicle_gui.cpp | 2 | ||||
-rw-r--r-- | src/vehicle_gui_base.h | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index b8c932136..00c8f5783 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -807,7 +807,7 @@ static void DrawVehicleImage(const Vehicle *v, int x, int y, VehicleID selection * @param line_height Height of a single item line. * @param r Rectangle with edge positions of the matrix widget. */ -void BaseVehicleListWindow::DrawVehicleListItems(VehicleID selected_vehicle, int line_height, const Rect &r) +void BaseVehicleListWindow::DrawVehicleListItems(VehicleID selected_vehicle, int line_height, const Rect &r) const { int left = r.left + WD_MATRIX_LEFT; int right = r.right - WD_MATRIX_RIGHT; diff --git a/src/vehicle_gui_base.h b/src/vehicle_gui_base.h index 4b7eb8fb3..7cad95687 100644 --- a/src/vehicle_gui_base.h +++ b/src/vehicle_gui_base.h @@ -37,7 +37,12 @@ struct BaseVehicleListWindow: public Window { this->vehicles.SetSortFuncs(this->vehicle_sorter_funcs); } - void DrawVehicleListItems(VehicleID selected_vehicle, int line_height, const Rect &r); + BaseVehicleListWindow() : Window() + { + this->vehicles.SetSortFuncs(this->vehicle_sorter_funcs); + } + + void DrawVehicleListItems(VehicleID selected_vehicle, int line_height, const Rect &r) const; void SortVehicleList(); void BuildVehicleList(Owner owner, uint16 index, uint16 window_type); }; |