File diff r16430:b3f65f9bc976 → r16431:ec558deca9d7
src/depot_gui.cpp
Show inline comments
 
@@ -270,13 +270,13 @@ struct DepotWindow : Window {
 
	 */
 
	void DrawVehicleInDepot(const Vehicle *v, int left, int right, int y) const
 
	{
 
		bool free_wagon = false;
 
		int sprite_y = y + (this->resize.step_height - GetVehicleHeight(v->type)) / 2;
 

	
 
		bool rtl = _dynlang.text_dir == TD_RTL;
 
		bool rtl = _current_text_dir == TD_RTL;
 
		int image_left  = rtl ? left  + this->count_width  : left  + this->header_width;
 
		int image_right = rtl ? right - this->header_width : right - this->count_width;
 

	
 
		switch (v->type) {
 
			case VEH_TRAIN: {
 
				const Train *u = Train::From(v);
 
@@ -328,13 +328,13 @@ struct DepotWindow : Window {
 
	}
 

	
 
	void DrawWidget(const Rect &r, int widget) const
 
	{
 
		if (widget != DEPOT_WIDGET_MATRIX) return;
 

	
 
		bool rtl = _dynlang.text_dir == TD_RTL;
 
		bool rtl = _current_text_dir == TD_RTL;
 

	
 
		/* Set the row and number of boxes in each row based on the number of boxes drawn in the matrix */
 
		uint16 mat_data = this->GetWidget<NWidgetCore>(DEPOT_WIDGET_MATRIX)->widget_data;
 
		uint16 rows_in_display   = GB(mat_data, MAT_ROW_START, MAT_ROW_BITS);
 
		uint16 boxes_in_each_row = GB(mat_data, MAT_COL_START, MAT_COL_BITS);
 

	
 
@@ -386,13 +386,13 @@ struct DepotWindow : Window {
 
	};
 

	
 
	DepotGUIAction GetVehicleFromDepotWndPt(int x, int y, const Vehicle **veh, GetDepotVehiclePtData *d) const
 
	{
 
		const NWidgetCore *matrix_widget = this->GetWidget<NWidgetCore>(DEPOT_WIDGET_MATRIX);
 
		/* In case of RTL the widgets are swapped as a whole */
 
		if (_dynlang.text_dir == TD_RTL) x = matrix_widget->current_x - x;
 
		if (_current_text_dir == TD_RTL) x = matrix_widget->current_x - x;
 

	
 
		uint xt = 0, xm = 0, ym = 0;
 
		if (this->type == VEH_TRAIN) {
 
			xm = x;
 
		} else {
 
			xt = x / this->resize.step_width;