2005-07-24 16:12:37 +02:00
|
|
|
/* $Id$ */
|
|
|
|
|
2007-04-04 06:08:47 +02:00
|
|
|
/** @file vehicle_gui.h */
|
|
|
|
|
2004-09-06 20:15:13 +02:00
|
|
|
#ifndef VEHICLE_GUI_H
|
|
|
|
#define VEHICLE_GUI_H
|
|
|
|
|
2007-12-19 20:44:29 +01:00
|
|
|
#include "window_gui.h"
|
2007-12-27 14:35:39 +01:00
|
|
|
#include "vehicle_type.h"
|
2008-03-28 17:36:32 +01:00
|
|
|
#include "order_type.h"
|
2008-03-28 17:33:28 +01:00
|
|
|
#include "station_type.h"
|
2008-03-28 19:00:38 +01:00
|
|
|
#include "engine_type.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);
|
2007-03-07 12:47:46 +01:00
|
|
|
void InitializeVehiclesGuiList();
|
2004-09-06 20:15:13 +02:00
|
|
|
|
|
|
|
/* sorter stuff */
|
2007-03-07 12:47:46 +01:00
|
|
|
void RebuildVehicleLists();
|
|
|
|
void ResortVehicleLists();
|
2007-05-19 11:40:18 +02:00
|
|
|
void SortVehicleList(vehiclelist_d *vl);
|
|
|
|
void BuildVehicleList(vehiclelist_d *vl, PlayerID owner, uint16 index, uint16 window_type);
|
2004-12-10 19:16:08 +01:00
|
|
|
|
2004-09-06 20:15:13 +02:00
|
|
|
#define PERIODIC_RESORT_DAYS 10
|
|
|
|
|
2007-05-19 11:40:18 +02:00
|
|
|
extern const StringID _vehicle_sort_listing[];
|
|
|
|
|
2008-01-18 14:02:47 +01:00
|
|
|
/** Constants of vehicle view widget indices */
|
|
|
|
enum VehicleViewWindowWidgets {
|
|
|
|
VVW_WIDGET_CLOSEBOX = 0,
|
|
|
|
VVW_WIDGET_CAPTION,
|
|
|
|
VVW_WIDGET_STICKY,
|
|
|
|
VVW_WIDGET_PANEL,
|
|
|
|
VVW_WIDGET_VIEWPORT,
|
|
|
|
VVW_WIDGET_START_STOP_VEH,
|
|
|
|
VVW_WIDGET_CENTER_MAIN_VIEH,
|
|
|
|
VVW_WIDGET_GOTO_DEPOT,
|
|
|
|
VVW_WIDGET_REFIT_VEH,
|
|
|
|
VVW_WIDGET_SHOW_ORDERS,
|
|
|
|
VVW_WIDGET_SHOW_DETAILS,
|
|
|
|
VVW_WIDGET_CLONE_VEH,
|
|
|
|
VVW_WIDGET_EMPTY_BOTTOM_RIGHT,
|
|
|
|
VVW_WIDGET_RESIZE,
|
|
|
|
VVW_WIDGET_TURN_AROUND,
|
|
|
|
VVW_WIDGET_FORCE_PROCEED,
|
|
|
|
};
|
|
|
|
|
|
|
|
/** Start of functions regarding vehicle list windows */
|
2007-05-19 11:40:18 +02:00
|
|
|
enum {
|
|
|
|
PLY_WND_PRC__OFFSET_TOP_WIDGET = 26,
|
|
|
|
PLY_WND_PRC__SIZE_OF_ROW_TINY = 13,
|
|
|
|
PLY_WND_PRC__SIZE_OF_ROW_SMALL = 26,
|
|
|
|
PLY_WND_PRC__SIZE_OF_ROW_BIG = 36,
|
|
|
|
PLY_WND_PRC__SIZE_OF_ROW_BIG2 = 39,
|
|
|
|
};
|
|
|
|
|
2008-01-18 14:02:47 +01:00
|
|
|
/** Vehicle List Window type flags */
|
2006-08-29 23:36:39 +02:00
|
|
|
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,
|
2007-05-19 11:40:18 +02:00
|
|
|
VLW_GROUP_LIST = 4 << 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)
|
|
|
|
{
|
2007-05-19 11:40:18 +02:00
|
|
|
return (flags == VLW_STANDARD || flags == VLW_SHARED_ORDERS || flags == VLW_STATION_LIST || flags == VLW_DEPOT_LIST || flags == VLW_GROUP_LIST);
|
2006-09-01 12:24:15 +02:00
|
|
|
}
|
|
|
|
|
2006-08-29 19:41:13 +02:00
|
|
|
void PlayerVehWndProc(Window *w, WindowEvent *e);
|
|
|
|
|
2007-03-26 13:41:14 +02:00
|
|
|
int DrawVehiclePurchaseInfo(int x, int y, uint w, EngineID engine_number);
|
2005-01-02 18:23:04 +01:00
|
|
|
|
2007-12-27 14:35:39 +01:00
|
|
|
void DrawTrainImage(const Vehicle *v, int x, int y, VehicleID selection, int count, int skip);
|
|
|
|
void DrawRoadVehImage(const Vehicle *v, int x, int y, VehicleID selection, int count);
|
2006-08-29 19:41:13 +02:00
|
|
|
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
|
|
|
|
2007-05-18 19:31:41 +02:00
|
|
|
void ShowBuildVehicleWindow(TileIndex tile, VehicleType 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
|
|
|
|
2007-01-21 01:01:47 +01:00
|
|
|
void ShowVehicleListWindow(const Vehicle *v);
|
2007-05-18 19:31:41 +02:00
|
|
|
void ShowVehicleListWindow(PlayerID player, VehicleType vehicle_type);
|
|
|
|
void ShowVehicleListWindow(PlayerID player, VehicleType vehicle_type, StationID station);
|
|
|
|
void ShowVehicleListWindow(PlayerID player, VehicleType vehicle_type, TileIndex depot_tile);
|
2006-09-29 01:05:03 +02:00
|
|
|
|
2007-05-19 11:40:18 +02:00
|
|
|
void DrawSmallOrderList(const Vehicle *v, int x, int y);
|
2006-10-05 10:15:51 +02:00
|
|
|
|
2007-12-27 14:35:39 +01:00
|
|
|
void DrawVehicleImage(const Vehicle *v, int x, int y, VehicleID selection, int count, int skip);
|
2006-10-05 10:15:51 +02:00
|
|
|
|
2007-05-18 19:31:41 +02:00
|
|
|
static inline uint GetVehicleListHeight(VehicleType type)
|
2006-10-10 12:04:09 +02:00
|
|
|
{
|
2007-03-08 17:27:54 +01:00
|
|
|
return (type == VEH_TRAIN || type == VEH_ROAD) ? 14 : 24;
|
2006-10-10 12:04:09 +02:00
|
|
|
}
|
|
|
|
|
2007-08-29 22:50:58 +02:00
|
|
|
/* Unified window procedure */
|
|
|
|
void ShowVehicleViewWindow(const Vehicle *v);
|
|
|
|
|
2008-03-28 17:38:18 +01:00
|
|
|
Vehicle *CheckClickOnVehicle(const ViewPort *vp, int x, int y);
|
|
|
|
|
2004-09-06 20:15:13 +02:00
|
|
|
#endif /* VEHICLE_GUI_H */
|