(svn r20777) -Codechange: make VehicleListIdentifier a variable of BaseVehicleList and use that instead of "dereferencing" the window number and storing some information twice
This commit is contained in:
		| @@ -22,9 +22,9 @@ typedef GUIList<const Vehicle*> GUIVehicleList; | ||||
| struct BaseVehicleListWindow : public Window { | ||||
| 	GUIVehicleList vehicles;  ///< The list of vehicles | ||||
| 	Listing *sorting;         ///< Pointer to the vehicle type related sorting. | ||||
| 	VehicleType vehicle_type; ///< The vehicle type that is sorted | ||||
| 	byte unitnumber_digits;   ///< The number of digits of the highest unit number | ||||
| 	Scrollbar *vscroll; | ||||
| 	VehicleListIdentifier vli; ///< Identifier of the vehicle list we want to currently show. | ||||
|  | ||||
| 	enum ActionDropdownItem { | ||||
| 		ADI_REPLACE, | ||||
| @@ -38,14 +38,14 @@ struct BaseVehicleListWindow : public Window { | ||||
| 	static const StringID vehicle_sorter_names[]; | ||||
| 	static GUIVehicleList::SortFunction * const vehicle_sorter_funcs[]; | ||||
|  | ||||
| 	BaseVehicleListWindow() : Window() | ||||
| 	BaseVehicleListWindow(WindowNumber wno) : Window(), vli(wno) | ||||
| 	{ | ||||
| 		this->vehicles.SetSortFuncs(this->vehicle_sorter_funcs); | ||||
| 	} | ||||
|  | ||||
| 	void DrawVehicleListItems(VehicleID selected_vehicle, int line_height, const Rect &r) const; | ||||
| 	void SortVehicleList(); | ||||
| 	void BuildVehicleList(const VehicleListIdentifier &identifier); | ||||
| 	void BuildVehicleList(); | ||||
| 	Dimension GetActionDropdownSize(bool show_autoreplace, bool show_group); | ||||
| 	DropDownList *BuildActionDropdownList(bool show_autoreplace, bool show_group); | ||||
| }; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 rubidium
					rubidium