vehicle_gui.h

Go to the documentation of this file.
00001 /* $Id: vehicle_gui.h 11916 2008-01-18 13:02:47Z smatz $ */
00002 
00005 #ifndef VEHICLE_GUI_H
00006 #define VEHICLE_GUI_H
00007 
00008 #include "window_gui.h"
00009 #include "vehicle_type.h"
00010 
00011 void DrawVehicleProfitButton(const Vehicle *v, int x, int y);
00012 void ShowVehicleRefitWindow(const Vehicle *v, VehicleOrderID order);
00013 void InitializeVehiclesGuiList();
00014 
00015 /* sorter stuff */
00016 void RebuildVehicleLists();
00017 void ResortVehicleLists();
00018 void SortVehicleList(vehiclelist_d *vl);
00019 void BuildVehicleList(vehiclelist_d *vl, PlayerID owner, uint16 index, uint16 window_type);
00020 
00021 #define PERIODIC_RESORT_DAYS 10
00022 
00023 extern const StringID _vehicle_sort_listing[];
00024 
00026 enum VehicleViewWindowWidgets {
00027   VVW_WIDGET_CLOSEBOX = 0,
00028   VVW_WIDGET_CAPTION,
00029   VVW_WIDGET_STICKY,
00030   VVW_WIDGET_PANEL,
00031   VVW_WIDGET_VIEWPORT,
00032   VVW_WIDGET_START_STOP_VEH,
00033   VVW_WIDGET_CENTER_MAIN_VIEH,
00034   VVW_WIDGET_GOTO_DEPOT,
00035   VVW_WIDGET_REFIT_VEH,
00036   VVW_WIDGET_SHOW_ORDERS,
00037   VVW_WIDGET_SHOW_DETAILS,
00038   VVW_WIDGET_CLONE_VEH,
00039   VVW_WIDGET_EMPTY_BOTTOM_RIGHT,
00040   VVW_WIDGET_RESIZE,
00041   VVW_WIDGET_TURN_AROUND,
00042   VVW_WIDGET_FORCE_PROCEED,
00043 };
00044 
00046 enum {
00047   PLY_WND_PRC__OFFSET_TOP_WIDGET = 26,
00048   PLY_WND_PRC__SIZE_OF_ROW_TINY  = 13,
00049   PLY_WND_PRC__SIZE_OF_ROW_SMALL = 26,
00050   PLY_WND_PRC__SIZE_OF_ROW_BIG   = 36,
00051   PLY_WND_PRC__SIZE_OF_ROW_BIG2  = 39,
00052 };
00053 
00055 enum {
00056   VLW_STANDARD      = 0 << 8,
00057   VLW_SHARED_ORDERS = 1 << 8,
00058   VLW_STATION_LIST  = 2 << 8,
00059   VLW_DEPOT_LIST    = 3 << 8,
00060   VLW_GROUP_LIST    = 4 << 8,
00061   VLW_MASK          = 0x700,
00062 };
00063 
00064 static inline bool ValidVLWFlags(uint16 flags)
00065 {
00066   return (flags == VLW_STANDARD || flags == VLW_SHARED_ORDERS || flags == VLW_STATION_LIST || flags == VLW_DEPOT_LIST || flags == VLW_GROUP_LIST);
00067 }
00068 
00069 void PlayerVehWndProc(Window *w, WindowEvent *e);
00070 
00071 int DrawVehiclePurchaseInfo(int x, int y, uint w, EngineID engine_number);
00072 
00073 void DrawTrainImage(const Vehicle *v, int x, int y, VehicleID selection, int count, int skip);
00074 void DrawRoadVehImage(const Vehicle *v, int x, int y, VehicleID selection, int count);
00075 void DrawShipImage(const Vehicle *v, int x, int y, VehicleID selection);
00076 void DrawAircraftImage(const Vehicle *v, int x, int y, VehicleID selection);
00077 
00078 void ShowBuildVehicleWindow(TileIndex tile, VehicleType type);
00079 
00080 void ChangeVehicleViewWindow(const Vehicle *from_v, const Vehicle *to_v);
00081 
00082 uint ShowAdditionalText(int x, int y, uint w, EngineID engine);
00083 uint ShowRefitOptionsList(int x, int y, uint w, EngineID engine);
00084 
00085 void ShowVehicleListWindow(const Vehicle *v);
00086 void ShowVehicleListWindow(PlayerID player, VehicleType vehicle_type);
00087 void ShowVehicleListWindow(PlayerID player, VehicleType vehicle_type, StationID station);
00088 void ShowVehicleListWindow(PlayerID player, VehicleType vehicle_type, TileIndex depot_tile);
00089 
00090 void DrawSmallOrderList(const Vehicle *v, int x, int y);
00091 
00092 void DrawVehicleImage(const Vehicle *v, int x, int y, VehicleID selection, int count, int skip);
00093 
00094 static inline uint GetVehicleListHeight(VehicleType type)
00095 {
00096   return (type == VEH_TRAIN || type == VEH_ROAD) ? 14 : 24;
00097 }
00098 
00099 /* Unified window procedure */
00100 void ShowVehicleViewWindow(const Vehicle *v);
00101 
00102 #endif /* VEHICLE_GUI_H */

Generated on Wed Oct 1 17:03:25 2008 for openttd by  doxygen 1.5.6