2005-07-24 16:12:37 +02:00
|
|
|
/* $Id$ */
|
|
|
|
|
2004-09-06 20:15:13 +02:00
|
|
|
#ifndef VEHICLE_GUI_H
|
|
|
|
#define VEHICLE_GUI_H
|
|
|
|
|
2006-08-29 19:41:13 +02:00
|
|
|
#include "window.h"
|
2006-10-05 10:15:51 +02:00
|
|
|
#include "vehicle.h"
|
2005-05-03 01:59:11 +02:00
|
|
|
|
2005-09-18 22:56:44 +02:00
|
|
|
void DrawVehicleProfitButton(const Vehicle *v, int x, int y);
|
2006-10-03 16:52:39 +02:00
|
|
|
void ShowVehicleRefitWindow(const Vehicle *v, VehicleOrderID order);
|
2005-01-22 21:23:18 +01:00
|
|
|
void InitializeVehiclesGuiList(void);
|
2004-09-06 20:15:13 +02:00
|
|
|
|
|
|
|
/* sorter stuff */
|
2004-12-10 19:16:08 +01:00
|
|
|
void RebuildVehicleLists(void);
|
|
|
|
void ResortVehicleLists(void);
|
|
|
|
|
2004-09-06 20:15:13 +02:00
|
|
|
#define PERIODIC_RESORT_DAYS 10
|
|
|
|
|
2006-08-29 23:36:39 +02:00
|
|
|
/* Vehicle List Window type flags */
|
|
|
|
enum {
|
2006-09-04 17:16:58 +02:00
|
|
|
VLW_STANDARD = 0 << 8,
|
2006-08-29 23:36:39 +02:00
|
|
|
VLW_SHARED_ORDERS = 1 << 8,
|
|
|
|
VLW_STATION_LIST = 2 << 8,
|
2006-09-30 15:39:34 +02:00
|
|
|
VLW_DEPOT_LIST = 3 << 8,
|
2006-09-04 17:16:58 +02:00
|
|
|
VLW_MASK = 0x700,
|
2006-08-29 23:36:39 +02:00
|
|
|
};
|
|
|
|
|
2006-09-01 12:24:15 +02:00
|
|
|
static inline bool ValidVLWFlags(uint16 flags)
|
|
|
|
{
|
2006-09-30 15:39:34 +02:00
|
|
|
return (flags == VLW_STANDARD || flags == VLW_SHARED_ORDERS || flags == VLW_STATION_LIST || flags == VLW_DEPOT_LIST);
|
2006-09-01 12:24:15 +02:00
|
|
|
}
|
|
|
|
|
2006-08-29 19:41:13 +02:00
|
|
|
void PlayerVehWndProc(Window *w, WindowEvent *e);
|
|
|
|
|
2006-10-23 20:45:43 +02:00
|
|
|
void DrawTrainEnginePurchaseInfo(int x, int y, uint w, EngineID engine_number);
|
|
|
|
void DrawTrainWagonPurchaseInfo(int x, int y, uint w, EngineID engine_number);
|
|
|
|
void DrawRoadVehPurchaseInfo(int x, int y, uint w, EngineID engine_number);
|
|
|
|
void DrawAircraftPurchaseInfo(int x, int y, uint w, EngineID engine_number);
|
|
|
|
void DrawShipPurchaseInfo(int x, int y, uint w, EngineID engine_number);
|
2005-01-02 18:23:04 +01:00
|
|
|
|
2006-08-29 19:41:13 +02:00
|
|
|
void DrawTrainImage(const Vehicle *v, int x, int y, int count, int skip, VehicleID selection);
|
|
|
|
void DrawRoadVehImage(const Vehicle *v, int x, int y, VehicleID selection);
|
|
|
|
void DrawShipImage(const Vehicle *v, int x, int y, VehicleID selection);
|
2006-09-04 01:27:38 +02:00
|
|
|
void DrawAircraftImage(const Vehicle *v, int x, int y, VehicleID selection);
|
2006-08-29 19:41:13 +02:00
|
|
|
|
|
|
|
void ShowBuildTrainWindow(TileIndex tile);
|
|
|
|
void ShowBuildRoadVehWindow(TileIndex tile);
|
|
|
|
void ShowBuildShipWindow(TileIndex tile);
|
2006-10-10 17:02:38 +02:00
|
|
|
void ShowBuildVehicleWindow(TileIndex tile, byte type);
|
2006-08-29 19:41:13 +02:00
|
|
|
|
2005-10-24 21:40:48 +02:00
|
|
|
void ChangeVehicleViewWindow(const Vehicle *from_v, const Vehicle *to_v);
|
|
|
|
|
2006-10-23 23:39:15 +02:00
|
|
|
uint ShowAdditionalText(int x, int y, uint w, EngineID engine);
|
|
|
|
uint ShowRefitOptionsList(int x, int y, uint w, EngineID engine);
|
2005-10-24 21:40:48 +02:00
|
|
|
|
2006-09-29 01:05:03 +02:00
|
|
|
void ShowVehicleListWindow(PlayerID player, StationID station, byte vehicle_type);
|
|
|
|
void ShowVehWithSharedOrders(Vehicle *v, byte vehicle_type);
|
2006-09-30 15:39:34 +02:00
|
|
|
void ShowVehDepotOrders(PlayerID player, byte vehicle_type, TileIndex depot_tile);
|
2006-09-29 01:05:03 +02:00
|
|
|
|
2006-10-05 10:15:51 +02:00
|
|
|
|
|
|
|
static inline void DrawVehicleImage(const Vehicle *v, int x, int y, int count, int skip, VehicleID selection)
|
|
|
|
{
|
|
|
|
switch (v->type) {
|
|
|
|
case VEH_Train: DrawTrainImage(v, x, y, count, skip, selection); break;
|
|
|
|
case VEH_Road: DrawRoadVehImage(v, x, y, selection); break;
|
|
|
|
case VEH_Ship: DrawShipImage(v, x, y, selection); break;
|
|
|
|
case VEH_Aircraft: DrawAircraftImage(v, x, y, selection); break;
|
|
|
|
default: NOT_REACHED();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-10-10 12:04:09 +02:00
|
|
|
static inline byte GetVehicleListHeight(byte type)
|
|
|
|
{
|
|
|
|
return (type == VEH_Train || type == VEH_Road) ? 14 : 24;
|
|
|
|
}
|
|
|
|
|
2004-09-06 20:15:13 +02:00
|
|
|
#endif /* VEHICLE_GUI_H */
|