src/build_vehicle_gui.cpp
changeset 6608 dc0b009642a4
parent 6595 5239d6e72066
child 6638 09c5d7bf69a5
equal deleted inserted replaced
6607:ef92dcaaa49c 6608:dc0b009642a4
   384 	y += 10;
   384 	y += 10;
   385 
   385 
   386 	/* Wagon weight - (including cargo) */
   386 	/* Wagon weight - (including cargo) */
   387 	uint weight = GetEngineProperty(engine_number, 0x16, rvi->weight);
   387 	uint weight = GetEngineProperty(engine_number, 0x16, rvi->weight);
   388 	SetDParam(0, weight);
   388 	SetDParam(0, weight);
   389 	SetDParam(1, (GetCargo(rvi->cargo_type)->weight * rvi->capacity >> 4) + weight);
   389 	SetDParam(1, (GetCargo(rvi->cargo_type)->weight * GetEngineProperty(engine_number, 0x14, rvi->capacity) >> 4) + weight);
   390 	DrawString(x, y, STR_PURCHASE_INFO_WEIGHT_CWEIGHT, 0);
   390 	DrawString(x, y, STR_PURCHASE_INFO_WEIGHT_CWEIGHT, 0);
   391 	y += 10;
   391 	y += 10;
   392 
   392 
   393 	/* Wagon speed limit, displayed if above zero */
   393 	/* Wagon speed limit, displayed if above zero */
   394 	if (_patches.wagon_speed_limits) {
   394 	if (_patches.wagon_speed_limits) {
   459 	DrawString(x, y, STR_PURCHASE_INFO_RUNNINGCOST, 0);
   459 	DrawString(x, y, STR_PURCHASE_INFO_RUNNINGCOST, 0);
   460 	y += 10;
   460 	y += 10;
   461 
   461 
   462 	/* Cargo type + capacity */
   462 	/* Cargo type + capacity */
   463 	SetDParam(0, rvi->cargo_type);
   463 	SetDParam(0, rvi->cargo_type);
   464 	SetDParam(1, rvi->capacity);
   464 	SetDParam(1, GetEngineProperty(engine_number, 0x0F, rvi->capacity));
   465 	SetDParam(2, refittable ? STR_9842_REFITTABLE : STR_EMPTY);
   465 	SetDParam(2, refittable ? STR_9842_REFITTABLE : STR_EMPTY);
   466 	DrawString(x, y, STR_PURCHASE_INFO_CAPACITY, 0);
   466 	DrawString(x, y, STR_PURCHASE_INFO_CAPACITY, 0);
   467 	y += 10;
   467 	y += 10;
   468 
   468 
   469 	return y;
   469 	return y;
   478 	DrawString(x, y, STR_PURCHASE_INFO_COST_SPEED, 0);
   478 	DrawString(x, y, STR_PURCHASE_INFO_COST_SPEED, 0);
   479 	y += 10;
   479 	y += 10;
   480 
   480 
   481 	/* Cargo type + capacity */
   481 	/* Cargo type + capacity */
   482 	SetDParam(0, svi->cargo_type);
   482 	SetDParam(0, svi->cargo_type);
   483 	SetDParam(1, svi->capacity);
   483 	SetDParam(1, GetEngineProperty(engine_number, 0x0D, svi->capacity));
   484 	SetDParam(2, svi->refittable ? STR_9842_REFITTABLE : STR_EMPTY);
   484 	SetDParam(2, svi->refittable ? STR_9842_REFITTABLE : STR_EMPTY);
   485 	DrawString(x, y, STR_PURCHASE_INFO_CAPACITY, 0);
   485 	DrawString(x, y, STR_PURCHASE_INFO_CAPACITY, 0);
   486 	y += 10;
   486 	y += 10;
   487 
   487 
   488 	/* Running cost */
   488 	/* Running cost */
   543 	bool refitable = false;
   543 	bool refitable = false;
   544 
   544 
   545 	switch (e->type) {
   545 	switch (e->type) {
   546 		case VEH_TRAIN: {
   546 		case VEH_TRAIN: {
   547 			const RailVehicleInfo *rvi = RailVehInfo(engine_number);
   547 			const RailVehicleInfo *rvi = RailVehInfo(engine_number);
   548 
   548 			uint capacity = GetEngineProperty(engine_number, 0x14, rvi->capacity);
   549 			refitable = (EngInfo(engine_number)->refit_mask != 0) && (rvi->capacity > 0);
   549 
       
   550 			refitable = (EngInfo(engine_number)->refit_mask != 0) && (capacity > 0);
   550 
   551 
   551 			if (rvi->railveh_type == RAILVEH_WAGON) {
   552 			if (rvi->railveh_type == RAILVEH_WAGON) {
   552 				y = DrawRailWagonPurchaseInfo(x, y, engine_number, rvi);
   553 				y = DrawRailWagonPurchaseInfo(x, y, engine_number, rvi);
   553 			} else {
   554 			} else {
   554 				y = DrawRailEnginePurchaseInfo(x, y, engine_number, rvi);
   555 				y = DrawRailEnginePurchaseInfo(x, y, engine_number, rvi);
   560 				SetDParam(2, STR_EMPTY);
   561 				SetDParam(2, STR_EMPTY);
   561 			} else {
   562 			} else {
   562 				int multihead = (rvi->railveh_type == RAILVEH_MULTIHEAD ? 1 : 0);
   563 				int multihead = (rvi->railveh_type == RAILVEH_MULTIHEAD ? 1 : 0);
   563 
   564 
   564 				SetDParam(0, rvi->cargo_type);
   565 				SetDParam(0, rvi->cargo_type);
   565 				SetDParam(1, (rvi->capacity * (CountArticulatedParts(engine_number) + 1)) << multihead);
   566 				SetDParam(1, (capacity * (CountArticulatedParts(engine_number) + 1)) << multihead);
   566 				SetDParam(2, refitable ? STR_9842_REFITTABLE : STR_EMPTY);
   567 				SetDParam(2, refitable ? STR_9842_REFITTABLE : STR_EMPTY);
   567 			}
   568 			}
   568 			DrawString(x, y, STR_PURCHASE_INFO_CAPACITY, 0);
   569 			DrawString(x, y, STR_PURCHASE_INFO_CAPACITY, 0);
   569 			y += 10;
   570 			y += 10;
   570 		}
   571 		}