summaryrefslogtreecommitdiff
path: root/train_gui.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-12-28 13:18:07 +0000
committerpeter1138 <peter1138@openttd.org>2006-12-28 13:18:07 +0000
commit8ca21a3cb03f3275061676b9d20a7ba18429064e (patch)
tree8b5dc4c32db6c462ecc95765f9e84dbdc2b09526 /train_gui.c
parentb78dd8742db08230fd0b61e55cbb47f50ba304ea (diff)
downloadopenttd-8ca21a3cb03f3275061676b9d20a7ba18429064e.tar.xz
(svn r7592) -Feature: Add support for tractive effort to 'realistic' acceleration.
Diffstat (limited to 'train_gui.c')
-rw-r--r--train_gui.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/train_gui.c b/train_gui.c
index f3e461bbc..479d0a0c4 100644
--- a/train_gui.c
+++ b/train_gui.c
@@ -232,6 +232,13 @@ void DrawTrainEnginePurchaseInfo(int x, int y, uint w, EngineID engine_number)
DrawString(x,y, STR_PURCHASE_INFO_SPEED_POWER, 0);
y += 10;
+ /* Max tractive effort - not applicable if old acceleration or maglev */
+ if (_patches.realistic_acceleration && e->railtype != RAILTYPE_MAGLEV) {
+ SetDParam(0, ((rvi->weight << multihead) * 10 * rvi->tractive_effort) / 256);
+ DrawString(x, y, STR_PURCHASE_INFO_MAX_TE, 0);
+ y += 10;
+ }
+
/* Running cost */
SetDParam(0, (rvi->running_cost_base * _price.running_rail[rvi->running_cost_class] >> 8) << multihead);
DrawString(x,y, STR_PURCHASE_INFO_RUNNINGCOST, 0);
@@ -939,7 +946,10 @@ static void DrawTrainDetailsWindow(Window *w)
SetDParam(2, v->u.rail.cached_max_speed);
SetDParam(1, v->u.rail.cached_power);
SetDParam(0, v->u.rail.cached_weight);
- DrawString(x, 25, STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED, 0);
+ SetDParam(3, v->u.rail.cached_max_te / 1000);
+ DrawString(x, 25, (_patches.realistic_acceleration && v->u.rail.railtype != RAILTYPE_MAGLEV) ?
+ STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE :
+ STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED, 0);
SetDParam(0, v->profit_this_year);
SetDParam(1, v->profit_last_year);