File diff r15389:8837d7b56780 → r15390:44d506cb3529
src/autoreplace_gui.cpp
Show inline comments
 
@@ -318,25 +318,25 @@ public:
 
				const Company *c = Company::Get(_local_company);
 
				if (this->sel_engine[0] != INVALID_ENGINE) {
 
					if (!EngineHasReplacementForCompany(c, this->sel_engine[0], this->sel_group)) {
 
						SetDParam(0, STR_REPLACE_NOT_REPLACING);
 
					} else {
 
						SetDParam(0, STR_ENGINE_NAME);
 
						SetDParam(1, EngineReplacementForCompany(c, this->sel_engine[0], this->sel_group));
 
					}
 
				} else {
 
					SetDParam(0, STR_REPLACE_NOT_REPLACING_VEHICLE_SELECTED);
 
				}
 

	
 
				DrawString(r.left + WD_FRAMETEXT_LEFT, r.right - WD_FRAMETEXT_RIGHT, r.top + WD_FRAMERECT_TOP, STR_BLACK_STRING, TC_FROMSTRING, SA_CENTER);
 
				DrawString(r.left + WD_FRAMETEXT_LEFT, r.right - WD_FRAMETEXT_RIGHT, r.top + WD_FRAMERECT_TOP, STR_BLACK_STRING, TC_FROMSTRING, SA_HOR_CENTER);
 
				break;
 
			}
 

	
 
			case RVW_WIDGET_LEFT_MATRIX:
 
			case RVW_WIDGET_RIGHT_MATRIX: {
 
				int side = (widget == RVW_WIDGET_LEFT_MATRIX) ? 0 : 1;
 
				EngineID start  = side == 0 ? this->vscroll.GetPosition() : this->vscroll2.GetPosition(); // what is the offset for the start (scrolling)
 
				EngineID end    = min((side == 0 ? this->vscroll.GetCapacity() : this->vscroll2.GetCapacity()) + start, this->engines[side].Length());
 

	
 
				/* Do the actual drawing */
 
				DrawEngineList((VehicleType)this->window_number, r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP,
 
						&this->engines[side], start, end, this->sel_engine[side], side == 0, this->sel_group);