# HG changeset patch # User frosch # Date 2011-08-27 10:34:31 # Node ID 67e02ed243b4218ce79f1ca054c3c0ff4ee71e3f # Parent 9fef0937e079e24040344066153dace7214b002f (svn r22850) -Feature: Display separate ocean and canal speeds in the ship purchase list, if they differ. diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -666,10 +666,27 @@ static int DrawShipPurchaseInfo(int left 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()); diff --git a/src/lang/english.txt b/src/lang/english.txt --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -2836,6 +2836,8 @@ STR_BUY_VEHICLE_AIRCRAFT_CAPTION 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)