Changeset - r9585:ea8ab5462274
[Not reviewed]
master
0 2 0
rubidium - 16 years ago 2008-06-24 13:49:13
rubidium@openttd.org
(svn r13623) -Codechange: only show the 'load' of articulated RV parts that have a capacity instead of showing 'empty' parts when a vehicle is completely full.
2 files changed with 4 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/roadveh_gui.cpp
Show inline comments
 
@@ -20,13 +20,13 @@
 

	
 
#include "table/sprites.h"
 
#include "table/strings.h"
 

	
 
void DrawRoadVehDetails(const Vehicle *v, int x, int y)
 
{
 
	uint y_offset = RoadVehHasArticPart(v) ? 15 :0;
 
	uint y_offset = RoadVehHasArticPart(v) ? 15 : 0;
 
	StringID str;
 

	
 
	SetDParam(0, v->engine_type);
 
	SetDParam(1, v->build_year);
 
	SetDParam(2, v->value);
 
	DrawString(x, y + y_offset, STR_9011_BUILT_VALUE, TC_FROMSTRING);
 
@@ -59,12 +59,14 @@ void DrawRoadVehDetails(const Vehicle *v
 
		}
 

	
 
		SetDParamStr(0, capacity);
 
		DrawStringTruncated(x, y + 10 + y_offset, STR_JUST_STRING, TC_BLUE, 380 - x);
 

	
 
		for (const Vehicle *u = v; u != NULL; u = u->Next()) {
 
			if (u->cargo_cap == 0) continue;
 

	
 
			str = STR_8812_EMPTY;
 
			if (!u->cargo.Empty()) {
 
				SetDParam(0, u->cargo_type);
 
				SetDParam(1, u->cargo.Count());
 
				SetDParam(2, u->cargo.Source());
 
				str = STR_8813_FROM;
src/vehicle_gui.cpp
Show inline comments
 
@@ -1306,13 +1306,13 @@ struct VehicleDetailsWindow : Window {
 
				/* Draw the text under the vehicle instead of next to it, minus the
 
				 * height already allocated for the cargo of the first vehicle. */
 
				uint height_extension = 15 - 11;
 

	
 
				/* Add space for the cargo amount for each part. */
 
				for (const Vehicle *u = v; u != NULL; u = u->Next()) {
 
					height_extension += 11;
 
					if (u->cargo_cap != 0) height_extension += 11;
 
				}
 

	
 
				ResizeWindow(this, 0, height_extension);
 
			} break;
 

	
 
			case VEH_SHIP:
0 comments (0 inline, 0 general)