(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.
authorrubidium
Tue, 24 Jun 2008 13:49:13 +0000
changeset 11066 942b9b820006
parent 11065 d322c7fa3a22
child 11067 df918e13ef3b
(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.
src/roadveh_gui.cpp
src/vehicle_gui.cpp
--- a/src/roadveh_gui.cpp	Tue Jun 24 13:47:15 2008 +0000
+++ b/src/roadveh_gui.cpp	Tue Jun 24 13:49:13 2008 +0000
@@ -23,7 +23,7 @@
 
 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);
@@ -62,6 +62,8 @@
 		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);
--- a/src/vehicle_gui.cpp	Tue Jun 24 13:47:15 2008 +0000
+++ b/src/vehicle_gui.cpp	Tue Jun 24 13:49:13 2008 +0000
@@ -1309,7 +1309,7 @@
 
 				/* 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);