From 8ca21a3cb03f3275061676b9d20a7ba18429064e Mon Sep 17 00:00:00 2001 From: peter1138 Date: Thu, 28 Dec 2006 13:18:07 +0000 Subject: (svn r7592) -Feature: Add support for tractive effort to 'realistic' acceleration. --- train_gui.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'train_gui.c') 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); -- cgit v1.2.3-54-g00ecf