File diff r2162:7c64e21f12f9 → r2163:ae001e2aa5b0
vehicle_gui.c
Show inline comments
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "player.h"
 
#include "strings.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "vehicle.h"
 
#include "window.h"
 
#include "engine.h"
 
#include "gui.h"
 
#include "command.h"
 
#include "gfx.h"
 
#include "variables.h"
 
#include "vehicle_gui.h"
 

	
 
Sorting _sorting;
 

	
 
static uint32 _internal_name_sorter_id; // internal StringID for default vehicle-names
 
static uint32 _last_vehicle_idx;        // cached index to hopefully speed up name-sorting
 
static bool   _internal_sort_order;     // descending/ascending
 

	
 
VehicleSortListingTypeFunctions * const _vehicle_sorter[] = {
 
	&VehicleUnsortedSorter,
 
	&VehicleNumberSorter,
 
	&VehicleNameSorter,
 
	&VehicleAgeSorter,
 
	&VehicleProfitThisYearSorter,
 
	&VehicleProfitLastYearSorter,
 
	&VehicleCargoSorter,
 
	&VehicleReliabilitySorter,
 
	&VehicleMaxSpeedSorter
 
};
 

	
 
const StringID _vehicle_sort_listing[] = {
 
	STR_SORT_BY_UNSORTED,
 
	STR_SORT_BY_NUMBER,
 
	STR_SORT_BY_DROPDOWN_NAME,
 
	STR_SORT_BY_AGE,
 
	STR_SORT_BY_PROFIT_THIS_YEAR,
 
	STR_SORT_BY_PROFIT_LAST_YEAR,
 
	STR_SORT_BY_TOTAL_CAPACITY_PER_CARGOTYPE,
 
	STR_SORT_BY_RELIABILITY,
 
	STR_SORT_BY_MAX_SPEED,
 
	INVALID_STRING_ID
 
};
 

	
 
const StringID _rail_types_list[] = {
 
	STR_RAIL_VEHICLES,
 
	STR_MONORAIL_VEHICLES,
 
	STR_MAGLEV_VEHICLES,