src/roadveh_gui.cpp
branch0.6
changeset 11132 6dd6907c378d
parent 8760 ce0891c412ce
equal deleted inserted replaced
11131:d8136dad6b1c 11132:6dd6907c378d
    21 #include "table/sprites.h"
    21 #include "table/sprites.h"
    22 #include "table/strings.h"
    22 #include "table/strings.h"
    23 
    23 
    24 void DrawRoadVehDetails(const Vehicle *v, int x, int y)
    24 void DrawRoadVehDetails(const Vehicle *v, int x, int y)
    25 {
    25 {
    26 	uint y_offset = RoadVehHasArticPart(v) ? 15 :0;
    26 	uint y_offset = RoadVehHasArticPart(v) ? 15 : 0;
    27 	StringID str;
    27 	StringID str;
    28 
    28 
    29 	SetDParam(0, v->engine_type);
    29 	SetDParam(0, v->engine_type);
    30 	SetDParam(1, v->build_year);
    30 	SetDParam(1, v->build_year);
    31 	SetDParam(2, v->value);
    31 	SetDParam(2, v->value);
    60 
    60 
    61 		SetDParamStr(0, capacity);
    61 		SetDParamStr(0, capacity);
    62 		DrawStringTruncated(x, y + 10 + y_offset, STR_JUST_STRING, TC_BLUE, 380 - x);
    62 		DrawStringTruncated(x, y + 10 + y_offset, STR_JUST_STRING, TC_BLUE, 380 - x);
    63 
    63 
    64 		for (const Vehicle *u = v; u != NULL; u = u->Next()) {
    64 		for (const Vehicle *u = v; u != NULL; u = u->Next()) {
       
    65 			if (u->cargo_cap == 0) continue;
       
    66 
    65 			str = STR_8812_EMPTY;
    67 			str = STR_8812_EMPTY;
    66 			if (!u->cargo.Empty()) {
    68 			if (!u->cargo.Empty()) {
    67 				SetDParam(0, u->cargo_type);
    69 				SetDParam(0, u->cargo_type);
    68 				SetDParam(1, u->cargo.Count());
    70 				SetDParam(1, u->cargo.Count());
    69 				SetDParam(2, u->cargo.Source());
    71 				SetDParam(2, u->cargo.Source());