Changeset - r13351:43a3e6e1e395
[Not reviewed]
master
0 3 0
alberth - 15 years ago 2009-10-25 17:21:57
alberth@openttd.org
(svn r17870) -Codechange: Use fontsize when drawing roadveh, ship, and aircraft details.
3 files changed with 15 insertions and 15 deletions:
0 comments (0 inline, 0 general)
src/aircraft_gui.cpp
Show inline comments
 
@@ -31,7 +31,7 @@
 
 */
 
void DrawAircraftDetails(const Aircraft *v, int left, int right, int y)
 
{
 
	int y_offset = (v->Next()->cargo_cap != 0) ? -11 : 0;
 
	int y_offset = (v->Next()->cargo_cap != 0) ? -(FONT_HEIGHT_NORMAL + 1): 0;
 
	Money feeder_share = 0;
 

	
 
	for (const Aircraft *u = v ; u != NULL ; u = u->Next()) {
 
@@ -46,26 +46,26 @@ void DrawAircraftDetails(const Aircraft 
 
			SetDParam(2, u->Next()->cargo_type);
 
			SetDParam(3, u->Next()->cargo_cap);
 
			SetDParam(4, GetCargoSubtypeText(u));
 
			DrawString(left, right, y + 10, (u->Next()->cargo_cap != 0) ? STR_VEHICLE_INFO_CAPACITY_CAPACITY : STR_VEHICLE_INFO_CAPACITY);
 
			DrawString(left, right, y + FONT_HEIGHT_NORMAL, (u->Next()->cargo_cap != 0) ? STR_VEHICLE_INFO_CAPACITY_CAPACITY : STR_VEHICLE_INFO_CAPACITY);
 
		}
 

	
 
		if (u->cargo_cap != 0) {
 
			uint cargo_count = u->cargo.Count();
 

	
 
			y_offset += 11;
 
			y_offset += FONT_HEIGHT_NORMAL + 1;
 
			if (cargo_count != 0) {
 
				/* Cargo names (fix pluralness) */
 
				SetDParam(0, u->cargo_type);
 
				SetDParam(1, cargo_count);
 
				SetDParam(2, u->cargo.Source());
 
				DrawString(left, right, y + 21 + y_offset, STR_VEHICLE_DETAILS_CARGO_FROM);
 
				DrawString(left, right, y + 2 * FONT_HEIGHT_NORMAL + 1 + y_offset, STR_VEHICLE_DETAILS_CARGO_FROM);
 
				feeder_share += u->cargo.FeederShare();
 
			}
 
		}
 
	}
 

	
 
	SetDParam(0, feeder_share);
 
	DrawString(left, right, y + 33 + y_offset, STR_VEHICLE_INFO_FEEDER_CARGO_VALUE);
 
	DrawString(left, right, y + 3 * FONT_HEIGHT_NORMAL + 3 + y_offset, STR_VEHICLE_INFO_FEEDER_CARGO_VALUE);
 
}
 

	
 

	
src/roadveh_gui.cpp
Show inline comments
 
@@ -33,7 +33,7 @@ void DrawRoadVehDetails(const Vehicle *v
 
{
 
	const RoadVehicle *rv = RoadVehicle::From(v);
 

	
 
	uint y_offset = rv->HasArticulatedPart() ? 15 : 0;
 
	uint y_offset = rv->HasArticulatedPart() ? 15 : 0; // Draw the first line below the sprite of an articulated RV instead of after it.
 
	StringID str;
 
	Money feeder_share = 0;
 

	
 
@@ -80,7 +80,7 @@ void DrawRoadVehDetails(const Vehicle *v
 
			}
 
		}
 

	
 
		DrawString(left, right, y + 10 + y_offset, capacity, TC_BLUE);
 
		DrawString(left, right, y + FONT_HEIGHT_NORMAL + y_offset, capacity, TC_BLUE);
 

	
 
		for (const Vehicle *u = v; u != NULL; u = u->Next()) {
 
			if (u->cargo_cap == 0) continue;
 
@@ -93,12 +93,12 @@ void DrawRoadVehDetails(const Vehicle *v
 
				str = STR_VEHICLE_DETAILS_CARGO_FROM;
 
				feeder_share += u->cargo.FeederShare();
 
			}
 
			DrawString(left, right, y + 21 + y_offset, str);
 
			DrawString(left, right, y + 2 * FONT_HEIGHT_NORMAL + 1 + y_offset, str);
 

	
 
			y_offset += 11;
 
			y_offset += FONT_HEIGHT_NORMAL + 1;
 
		}
 

	
 
		y_offset -= 11;
 
		y_offset -= FONT_HEIGHT_NORMAL + 1;
 
	} else {
 
		SetDParam(0, v->cargo_type);
 
		SetDParam(1, v->cargo_cap);
 
@@ -113,12 +113,12 @@ void DrawRoadVehDetails(const Vehicle *v
 
			str = STR_VEHICLE_DETAILS_CARGO_FROM;
 
			feeder_share += v->cargo.FeederShare();
 
		}
 
		DrawString(left, right, y + 21 + y_offset, str);
 
		DrawString(left, right, y + 2 * FONT_HEIGHT_NORMAL + 1 + y_offset, str);
 
	}
 

	
 
	/* Draw Transfer credits text */
 
	SetDParam(0, feeder_share);
 
	DrawString(left, right, y + 33 + y_offset, STR_VEHICLE_INFO_FEEDER_CARGO_VALUE);
 
	DrawString(left, right, y + 3 * FONT_HEIGHT_NORMAL + 3 + y_offset, STR_VEHICLE_INFO_FEEDER_CARGO_VALUE);
 
}
 

	
 
/**
src/ship_gui.cpp
Show inline comments
 
@@ -59,7 +59,7 @@ void DrawShipDetails(const Vehicle *v, i
 
	SetDParam(0, v->cargo_type);
 
	SetDParam(1, v->cargo_cap);
 
	SetDParam(4, GetCargoSubtypeText(v));
 
	DrawString(left, right, y + 10, STR_VEHICLE_INFO_CAPACITY);
 
	DrawString(left, right, y + FONT_HEIGHT_NORMAL, STR_VEHICLE_INFO_CAPACITY);
 

	
 
	StringID str = STR_VEHICLE_DETAILS_CARGO_EMPTY;
 
	if (!v->cargo.Empty()) {
 
@@ -68,9 +68,9 @@ void DrawShipDetails(const Vehicle *v, i
 
		SetDParam(2, v->cargo.Source());
 
		str = STR_VEHICLE_DETAILS_CARGO_FROM;
 
	}
 
	DrawString(left, right, y + 21, str);
 
	DrawString(left, right, y + 2 * FONT_HEIGHT_NORMAL + 1, str);
 

	
 
	/* Draw Transfer credits text */
 
	SetDParam(0, v->cargo.FeederShare());
 
	DrawString(left, right, y + 33, STR_VEHICLE_INFO_FEEDER_CARGO_VALUE);
 
	DrawString(left, right, y + 3 * FONT_HEIGHT_NORMAL + 3, STR_VEHICLE_INFO_FEEDER_CARGO_VALUE);
 
}
0 comments (0 inline, 0 general)