343 |
343 |
344 static void TrainDetailsInfoTab(const Vehicle *v, int x, int y) |
344 static void TrainDetailsInfoTab(const Vehicle *v, int x, int y) |
345 { |
345 { |
346 if (RailVehInfo(v->engine_type)->railveh_type == RAILVEH_WAGON) { |
346 if (RailVehInfo(v->engine_type)->railveh_type == RAILVEH_WAGON) { |
347 SetDParam(0, GetCustomEngineName(v->engine_type)); |
347 SetDParam(0, GetCustomEngineName(v->engine_type)); |
348 SetDParamMoney(1, v->value); |
348 SetDParam(1, v->value); |
349 DrawString(x, y, STR_882D_VALUE, 0x10); |
349 DrawString(x, y, STR_882D_VALUE, 0x10); |
350 } else { |
350 } else { |
351 SetDParam(0, GetCustomEngineName(v->engine_type)); |
351 SetDParam(0, GetCustomEngineName(v->engine_type)); |
352 SetDParam(1, v->build_year); |
352 SetDParam(1, v->build_year); |
353 SetDParamMoney(2, v->value); |
353 SetDParam(2, v->value); |
354 DrawString(x, y, STR_882C_BUILT_VALUE, 0x10); |
354 DrawString(x, y, STR_882C_BUILT_VALUE, 0x10); |
355 } |
355 } |
356 } |
356 } |
357 |
357 |
358 static void TrainDetailsCapacityTab(const Vehicle *v, int x, int y) |
358 static void TrainDetailsCapacityTab(const Vehicle *v, int x, int y) |
421 |
421 |
422 x = 2; |
422 x = 2; |
423 |
423 |
424 SetDParam(0, (v->age + 365 < v->max_age) ? STR_AGE : STR_AGE_RED); |
424 SetDParam(0, (v->age + 365 < v->max_age) ? STR_AGE : STR_AGE_RED); |
425 SetDParam(2, v->max_age / 366); |
425 SetDParam(2, v->max_age / 366); |
426 SetDParamMoney(3, GetTrainRunningCost(v) >> 8); |
426 SetDParam(3, GetTrainRunningCost(v) >> 8); |
427 DrawString(x, 15, STR_885D_AGE_RUNNING_COST_YR, 0); |
427 DrawString(x, 15, STR_885D_AGE_RUNNING_COST_YR, 0); |
428 |
428 |
429 SetDParam(2, v->u.rail.cached_max_speed * 10 / 16); |
429 SetDParam(2, v->u.rail.cached_max_speed * 10 / 16); |
430 SetDParam(1, v->u.rail.cached_power); |
430 SetDParam(1, v->u.rail.cached_power); |
431 SetDParam(0, v->u.rail.cached_weight); |
431 SetDParam(0, v->u.rail.cached_weight); |
432 SetDParam(3, v->u.rail.cached_max_te / 1000); |
432 SetDParam(3, v->u.rail.cached_max_te / 1000); |
433 DrawString(x, 25, (_patches.realistic_acceleration && v->u.rail.railtype != RAILTYPE_MAGLEV) ? |
433 DrawString(x, 25, (_patches.realistic_acceleration && v->u.rail.railtype != RAILTYPE_MAGLEV) ? |
434 STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE : |
434 STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE : |
435 STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED, 0); |
435 STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED, 0); |
436 |
436 |
437 SetDParamMoney(0, v->profit_this_year); |
437 SetDParam(0, v->profit_this_year); |
438 SetDParamMoney(1, v->profit_last_year); |
438 SetDParam(1, v->profit_last_year); |
439 DrawString(x, 35, STR_885F_PROFIT_THIS_YEAR_LAST_YEAR, 0); |
439 DrawString(x, 35, STR_885F_PROFIT_THIS_YEAR_LAST_YEAR, 0); |
440 |
440 |
441 SetDParam(0, 100 * (v->reliability>>8) >> 8); |
441 SetDParam(0, 100 * (v->reliability>>8) >> 8); |
442 SetDParam(1, v->breakdowns_since_last_service); |
442 SetDParam(1, v->breakdowns_since_last_service); |
443 DrawString(x, 45, STR_8860_RELIABILITY_BREAKDOWNS, 0); |
443 DrawString(x, 45, STR_8860_RELIABILITY_BREAKDOWNS, 0); |
502 SetDParam(3, max_cargo[i]); // {SHORTCARGO} #2 |
502 SetDParam(3, max_cargo[i]); // {SHORTCARGO} #2 |
503 SetDParam(4, _patches.freight_trains); |
503 SetDParam(4, _patches.freight_trains); |
504 DrawString(x, y + 2, FreightWagonMult(i) > 1 ? STR_TOTAL_CAPACITY_MULT : STR_013F_TOTAL_CAPACITY, 0); |
504 DrawString(x, y + 2, FreightWagonMult(i) > 1 ? STR_TOTAL_CAPACITY_MULT : STR_013F_TOTAL_CAPACITY, 0); |
505 } |
505 } |
506 } |
506 } |
507 SetDParamMoney(0, v->cargo_feeder_share); |
507 SetDParam(0, v->cargo_feeder_share); |
508 DrawString(x, y + 15, STR_FEEDER_CARGO_VALUE, 0); |
508 DrawString(x, y + 15, STR_FEEDER_CARGO_VALUE, 0); |
509 } |
509 } |
510 } |
510 } |
511 |
511 |
512 static void TrainDetailsWndProc(Window *w, WindowEvent *e) |
512 static void TrainDetailsWndProc(Window *w, WindowEvent *e) |