diff --git a/src/vehicle_gui.h b/src/vehicle_gui.h --- a/src/vehicle_gui.h +++ b/src/vehicle_gui.h @@ -15,12 +15,6 @@ void DrawVehicleProfitButton(const Vehicle *v, int x, int y); void ShowVehicleRefitWindow(const Vehicle *v, VehicleOrderID order); -/* sorter stuff */ -void RebuildVehicleLists(); -void ResortVehicleLists(); -void SortVehicleList(vehiclelist_d *vl); -void BuildVehicleList(vehiclelist_d *vl, PlayerID owner, uint16 index, uint16 window_type); - #define PERIODIC_RESORT_DAYS 10 extern const StringID _vehicle_sort_listing[]; @@ -69,7 +63,7 @@ static inline bool ValidVLWFlags(uint16 return (flags == VLW_STANDARD || flags == VLW_SHARED_ORDERS || flags == VLW_STATION_LIST || flags == VLW_DEPOT_LIST || flags == VLW_GROUP_LIST); } -void PlayerVehWndProc(Window *w, WindowEvent *e); +void PlayerVehWndProc(Window *w, struct WindowEvent *e); int DrawVehiclePurchaseInfo(int x, int y, uint w, EngineID engine_number); @@ -136,6 +130,29 @@ static inline WindowClass GetWindowClass /* Unified window procedure */ void ShowVehicleViewWindow(const Vehicle *v); -Vehicle *CheckClickOnVehicle(const ViewPort *vp, int x, int y); +Vehicle *CheckClickOnVehicle(const struct ViewPort *vp, int x, int y); + +typedef GUIList GUIVehicleList; + +struct vehiclelist_d { + GUIVehicleList vehicles; ///< The list of vehicles + Listing *sorting; ///< Pointer to the vehicle type related sorting. + VehicleType vehicle_type; ///< The vehicle type that is sorted +}; + +struct Sorting { + Listing aircraft; + Listing roadveh; + Listing ship; + Listing train; +}; + +extern Sorting _sorting; + +/* sorter stuff */ +void RebuildVehicleLists(); +void ResortVehicleLists(); +void SortVehicleList(vehiclelist_d *vl); +void BuildVehicleList(vehiclelist_d *vl, PlayerID owner, uint16 index, uint16 window_type); #endif /* VEHICLE_GUI_H */