summaryrefslogtreecommitdiff
path: root/src/vehicle_gui.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-05-11 14:23:45 +0000
committerrubidium <rubidium@openttd.org>2008-05-11 14:23:45 +0000
commit75e3792aa34785a30e97b2aca97f527baef948dc (patch)
tree8e70266c44dd64a99df691b845962a790765964e /src/vehicle_gui.h
parent568464aa96c04511e6f3d2af39bed2fba2b98697 (diff)
downloadopenttd-75e3792aa34785a30e97b2aca97f527baef948dc.tar.xz
(svn r13045) -Codechange: make list_d (now GUIList) more generic and uniform.
Diffstat (limited to 'src/vehicle_gui.h')
-rw-r--r--src/vehicle_gui.h33
1 files changed, 25 insertions, 8 deletions
diff --git a/src/vehicle_gui.h b/src/vehicle_gui.h
index 59959088d..40c37a70b 100644
--- 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 flags)
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 GetWindowClassForVehicleType(VehicleType vt)
/* 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<const Vehicle*> 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 */