Changeset - r18025:67e02ed243b4
[Not reviewed]
master
0 2 0
frosch - 13 years ago 2011-08-27 10:34:31
frosch@openttd.org
(svn r22850) -Feature: Display separate ocean and canal speeds in the ship purchase list, if they differ.
2 files changed with 22 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/build_vehicle_gui.cpp
Show inline comments
 
@@ -663,16 +663,33 @@ static int DrawRoadVehPurchaseInfo(int l
 
/* Draw ship specific details */
 
static int DrawShipPurchaseInfo(int left, int right, int y, EngineID engine_number, bool refittable)
 
{
 
	const Engine *e = Engine::Get(engine_number);
 

	
 
	/* Purchase cost - Max speed */
 
	uint raw_speed = e->GetDisplayMaxSpeed();
 
	uint ocean_speed = e->u.ship.ApplyWaterClassSpeedFrac(raw_speed, true);
 
	uint canal_speed = e->u.ship.ApplyWaterClassSpeedFrac(raw_speed, false);
 

	
 
	SetDParam(0, e->GetCost());
 
	SetDParam(1, e->GetDisplayMaxSpeed());
 
	DrawString(left, right, y, STR_PURCHASE_INFO_COST_SPEED);
 
	y += FONT_HEIGHT_NORMAL;
 
	if (ocean_speed == canal_speed) {
 
		SetDParam(1, ocean_speed);
 
		DrawString(left, right, y, STR_PURCHASE_INFO_COST_SPEED);
 
		y += FONT_HEIGHT_NORMAL;
 
	} else {
 
		DrawString(left, right, y, STR_PURCHASE_INFO_COST);
 
		y += FONT_HEIGHT_NORMAL;
 

	
 
		SetDParam(0, ocean_speed);
 
		DrawString(left, right, y, STR_PURCHASE_INFO_SPEED_OCEAN);
 
		y += FONT_HEIGHT_NORMAL;
 

	
 
		SetDParam(0, canal_speed);
 
		DrawString(left, right, y, STR_PURCHASE_INFO_SPEED_CANAL);
 
		y += FONT_HEIGHT_NORMAL;
 
	}
 

	
 
	/* Cargo type + capacity */
 
	SetDParam(0, e->GetDefaultCargoType());
 
	SetDParam(1, e->GetDisplayDefaultCapacity());
 
	SetDParam(2, refittable ? STR_PURCHASE_INFO_REFITTABLE : STR_EMPTY);
 
	DrawString(left, right, y, STR_PURCHASE_INFO_CAPACITY);
src/lang/english.txt
Show inline comments
 
@@ -2833,12 +2833,14 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_CAPTION    
 
STR_BUY_VEHICLE_SHIP_CAPTION                                    :New Ships
 
STR_BUY_VEHICLE_AIRCRAFT_CAPTION                                :New Aircraft
 

	
 
STR_PURCHASE_INFO_COST_WEIGHT                                   :{BLACK}Cost: {GOLD}{CURRENCY}{BLACK} Weight: {GOLD}{WEIGHT_S}
 
STR_PURCHASE_INFO_SPEED_POWER                                   :{BLACK}Speed: {GOLD}{VELOCITY}{BLACK} Power: {GOLD}{POWER}
 
STR_PURCHASE_INFO_SPEED                                         :{BLACK}Speed: {GOLD}{VELOCITY}
 
STR_PURCHASE_INFO_SPEED_OCEAN                                   :{BLACK}Speed on ocean: {GOLD}{VELOCITY}
 
STR_PURCHASE_INFO_SPEED_CANAL                                   :{BLACK}Speed on canal/river: {GOLD}{VELOCITY}
 
STR_PURCHASE_INFO_RUNNINGCOST                                   :{BLACK}Running Cost: {GOLD}{CURRENCY}/yr
 
STR_PURCHASE_INFO_CAPACITY                                      :{BLACK}Capacity: {GOLD}{CARGO} {STRING}
 
STR_PURCHASE_INFO_REFITTABLE                                    :(refittable)
 
STR_PURCHASE_INFO_DESIGNED_LIFE                                 :{BLACK}Designed: {GOLD}{NUM}{BLACK} Life: {GOLD}{COMMA} year{P "" s}
 
STR_PURCHASE_INFO_RELIABILITY                                   :{BLACK}Max. Reliability: {GOLD}{COMMA}%
 
STR_PURCHASE_INFO_COST                                          :{BLACK}Cost: {GOLD}{CURRENCY}
0 comments (0 inline, 0 general)