summaryrefslogtreecommitdiff
path: root/vehicle_gui.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2004-12-10 18:16:08 +0000
committertron <tron@openttd.org>2004-12-10 18:16:08 +0000
commit13e8d01dcbc3c7573de1667d5c392d3640197890 (patch)
tree66a06b77592865f6aa9640d6c1ddd3648d89f2d3 /vehicle_gui.h
parent804d6828dd4f8948e121adecf698b13c43a206b5 (diff)
downloadopenttd-13e8d01dcbc3c7573de1667d5c392d3640197890.tar.xz
(svn r1009) -Feature: per-station vehicle lists
This adds a little button per vehicle class to the station window which opens a list of all vehicles that have this station on their schedule. As side effect this gets rid of some global variables.
Diffstat (limited to 'vehicle_gui.h')
-rw-r--r--vehicle_gui.h26
1 files changed, 8 insertions, 18 deletions
diff --git a/vehicle_gui.h b/vehicle_gui.h
index 3883967f0..9339d4647 100644
--- a/vehicle_gui.h
+++ b/vehicle_gui.h
@@ -1,10 +1,18 @@
#ifndef VEHICLE_GUI_H
#define VEHICLE_GUI_H
+struct vehiclelist_d;
+
void DrawVehicleProfitButton(Vehicle *v, int x, int y);
void InitializeVehiclesGuiList();
/* sorter stuff */
+void RebuildVehicleLists(void);
+void ResortVehicleLists(void);
+
+void BuildVehicleList(struct vehiclelist_d *vl, int type, int owner, int station);
+void SortVehicleList(struct vehiclelist_d *vl);
+
typedef struct SortStruct { // store owner through sorting process
uint32 index;
byte owner;
@@ -42,24 +50,6 @@ enum VehicleSortTypes {
VEHAIRCRAFT = 3
};
-VARDEF bool _vehicle_sort_dirty[4]; // global sort, vehicles added/removed (4 types of vehicles)
-
-VARDEF bool _train_sort_dirty[MAX_PLAYERS]; // vehicles for a given player needs to be resorted (new criteria)
-VARDEF byte _train_sort_type[MAX_PLAYERS]; // different criteria for sorting
-VARDEF bool _train_sort_order[MAX_PLAYERS]; // sort descending/ascending
-
-VARDEF bool _aircraft_sort_dirty[MAX_PLAYERS]; // vehicles for a given player needs to be resorted (new criteria)
-VARDEF byte _aircraft_sort_type[MAX_PLAYERS]; // different criteria for sorting
-VARDEF bool _aircraft_sort_order[MAX_PLAYERS]; // sort descending/ascending
-
-VARDEF bool _ship_sort_dirty[MAX_PLAYERS]; // vehicles for a given player needs to be resorted (new criteria)
-VARDEF byte _ship_sort_type[MAX_PLAYERS]; // different criteria for sorting
-VARDEF bool _ship_sort_order[MAX_PLAYERS]; // sort descending/ascending
-
-VARDEF bool _road_sort_dirty[MAX_PLAYERS]; // vehicles for a given player needs to be resorted (new criteria)
-VARDEF byte _road_sort_type[MAX_PLAYERS]; // different criteria for sorting
-VARDEF bool _road_sort_order[MAX_PLAYERS]; // sort descending/ascending
-
enum {
PLY_WND_PRC__OFFSET_TOP_WIDGET = 26,
PLY_WND_PRC__SIZE_OF_ROW_SMALL = 26,