diff options
author | peter1138 <peter1138@openttd.org> | 2006-12-28 13:18:07 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2006-12-28 13:18:07 +0000 |
commit | e9e4ba822215abdcd5403dfd1517c52a631acb3a (patch) | |
tree | 8b5dc4c32db6c462ecc95765f9e84dbdc2b09526 /train_gui.c | |
parent | 02c07d2a86f6f585324f775a72f0706afe8e3569 (diff) | |
download | openttd-e9e4ba822215abdcd5403dfd1517c52a631acb3a.tar.xz |
(svn r7592) -Feature: Add support for tractive effort to 'realistic' acceleration.
Diffstat (limited to 'train_gui.c')
-rw-r--r-- | train_gui.c | 12 |
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); |