(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.
This commit is contained in:
tron
2004-12-10 18:16:08 +00:00
parent 55bac62c5a
commit 5b0915e677
18 changed files with 676 additions and 748 deletions

View File

@@ -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,