(svn r13045) -Codechange: make list_d (now GUIList) more generic and uniform.

This commit is contained in:
rubidium
2008-05-11 14:23:45 +00:00
parent aa0929351d
commit 89a60ce249
5 changed files with 177 additions and 188 deletions

View File

@@ -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 */