diff options
author | terkhen <terkhen@openttd.org> | 2010-03-06 12:59:28 +0000 |
---|---|---|
committer | terkhen <terkhen@openttd.org> | 2010-03-06 12:59:28 +0000 |
commit | be3b839ded1372ad6a3802118bb70fead2ccd4ce (patch) | |
tree | a3cd77841a20bf21b1dbcd7768b66467647a8046 /src/build_vehicle_gui.cpp | |
parent | b443a3ee0a39f28be1fde279e67c82ee51814f4d (diff) | |
download | openttd-be3b839ded1372ad6a3802118bb70fead2ccd4ce.tar.xz |
(svn r19347) -Add: Vehicle GUI now shows power, weight and tractive effort for road vehicles.
Diffstat (limited to 'src/build_vehicle_gui.cpp')
-rw-r--r-- | src/build_vehicle_gui.cpp | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index b521935f7..1ac9936e9 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -508,11 +508,37 @@ static int DrawRoadVehPurchaseInfo(int left, int right, int y, EngineID engine_n { const Engine *e = Engine::Get(engine_number); - /* Purchase cost - Max speed */ - SetDParam(0, e->GetCost()); - SetDParam(1, e->GetDisplayMaxSpeed()); - DrawString(left, right, y, STR_PURCHASE_INFO_COST_SPEED); - y += FONT_HEIGHT_NORMAL; + if (_settings_game.vehicle.roadveh_acceleration_model != AM_ORIGINAL) { + /* Purchase Cost */ + SetDParam(0, e->GetCost()); + DrawString(left, right, y, STR_PURCHASE_INFO_COST); + y += FONT_HEIGHT_NORMAL; + + /* Road vehicle weight - (including cargo) */ + int16 weight = e->GetDisplayWeight(); + SetDParam(0, weight); + uint cargo_weight = CargoSpec::Get(e->GetDefaultCargoType())->weight * GetTotalCapacityOfArticulatedParts(engine_number) / 16; + SetDParam(1, cargo_weight + weight); + DrawString(left, right, y, STR_PURCHASE_INFO_WEIGHT_CWEIGHT); + y += FONT_HEIGHT_NORMAL; + + /* Max speed - Engine power */ + SetDParam(0, e->GetDisplayMaxSpeed()); + SetDParam(1, e->GetPower()); + DrawString(left, right, y, STR_PURCHASE_INFO_SPEED_POWER); + y += FONT_HEIGHT_NORMAL; + + /* Max tractive effort */ + SetDParam(0, e->GetDisplayMaxTractiveEffort()); + DrawString(left, right, y, STR_PURCHASE_INFO_MAX_TE); + y += FONT_HEIGHT_NORMAL; + } else { + /* Purchase cost - Max speed */ + SetDParam(0, e->GetCost()); + SetDParam(1, e->GetDisplayMaxSpeed()); + DrawString(left, right, y, STR_PURCHASE_INFO_COST_SPEED); + y += FONT_HEIGHT_NORMAL; + } /* Running cost */ SetDParam(0, e->GetRunningCost()); |