(svn r8464) -Revert (r4322): Change back to converting to mph in the GUI code, as 1 mph == 1.6 km/h is too far out for some people.

This commit is contained in:
peter1138 2007-01-30 21:10:04 +00:00
parent 5ebd7391a1
commit 4438b99ae4
6 changed files with 23 additions and 23 deletions

View File

@ -261,14 +261,14 @@ static void AircraftViewWndProc(Window *w, WindowEvent *e)
switch (v->current_order.type) {
case OT_GOTO_STATION: {
SetDParam(0, v->current_order.dest);
SetDParam(1, v->cur_speed * 128 / 10);
SetDParam(1, v->cur_speed * 8);
str = STR_HEADING_FOR_STATION + _patches.vehicle_speed;
} break;
case OT_GOTO_DEPOT: {
/* Aircrafts always go to a station, even if you say depot */
SetDParam(0, v->current_order.dest);
SetDParam(1, v->cur_speed * 128 / 10);
SetDParam(1, v->cur_speed * 8);
if (HASBIT(v->current_order.flags, OFB_HALT_IN_DEPOT) && !HASBIT(v->current_order.flags, OFB_PART_OF_ORDERS)) {
str = STR_HEADING_FOR_HANGAR + _patches.vehicle_speed;
} else {
@ -283,7 +283,7 @@ static void AircraftViewWndProc(Window *w, WindowEvent *e)
default:
if (v->num_orders == 0) {
str = STR_NO_ORDERS + _patches.vehicle_speed;
SetDParam(0, v->cur_speed * 128 / 10);
SetDParam(0, v->cur_speed * 8);
} else {
str = STR_EMPTY;
}

View File

@ -378,7 +378,7 @@ static int DrawRailWagonPurchaseInfo(int x, int y, EngineID engine_number, const
/* Wagon speed limit, displayed if above zero */
if (rvi->max_speed > 0 && _patches.wagon_speed_limits) {
SetDParam(0, rvi->max_speed);
SetDParam(0, rvi->max_speed * 10 / 16);
DrawString(x,y, STR_PURCHASE_INFO_SPEED, 0);
y += 10;
}
@ -397,7 +397,7 @@ static int DrawRailEnginePurchaseInfo(int x, int y, EngineID engine_number, cons
y += 10;
/* Max speed - Engine power */
SetDParam(0, rvi->max_speed);
SetDParam(0, rvi->max_speed * 10 / 16);
SetDParam(1, rvi->power << multihead);
DrawString(x,y, STR_PURCHASE_INFO_SPEED_POWER, 0);
y += 10;
@ -432,7 +432,7 @@ static int DrawRoadVehPurchaseInfo(int x, int y, EngineID engine_number, const R
/* Purchase cost - Max speed */
SetDParam(0, rvi->base_cost * (_price.roadveh_base>>3)>>5);
SetDParam(1, rvi->max_speed / 2);
SetDParam(1, rvi->max_speed * 10 / 32);
DrawString(x, y, STR_PURCHASE_INFO_COST_SPEED, 0);
y += 10;
@ -456,7 +456,7 @@ static int DrawShipPurchaseInfo(int x, int y, EngineID engine_number, const Ship
{
/* Purchase cost - Max speed */
SetDParam(0, svi->base_cost * (_price.ship_base>>3)>>5);
SetDParam(1, svi->max_speed / 2);
SetDParam(1, svi->max_speed * 10 / 32);
DrawString(x,y, STR_PURCHASE_INFO_COST_SPEED, 0);
y += 10;
@ -482,7 +482,7 @@ static int DrawAircraftPurchaseInfo(int x, int y, EngineID engine_number, const
/* Purchase cost - Max speed */
SetDParam(0, avi->base_cost * (_price.aircraft_base>>3)>>5);
SetDParam(1, avi->max_speed * 128 / 10);
SetDParam(1, avi->max_speed * 8);
DrawString(x, y, STR_PURCHASE_INFO_COST_SPEED, 0);
y += 10;

View File

@ -206,14 +206,14 @@ static void RoadVehViewWndProc(Window *w, WindowEvent *e)
switch (v->current_order.type) {
case OT_GOTO_STATION: {
SetDParam(0, v->current_order.dest);
SetDParam(1, v->cur_speed / 2);
SetDParam(1, v->cur_speed * 10 / 32);
str = STR_HEADING_FOR_STATION + _patches.vehicle_speed;
} break;
case OT_GOTO_DEPOT: {
Depot *depot = GetDepot(v->current_order.dest);
SetDParam(0, depot->town_index);
SetDParam(1, v->cur_speed / 2);
SetDParam(1, v->cur_speed * 10 / 32);
if (HASBIT(v->current_order.flags, OFB_HALT_IN_DEPOT) && !HASBIT(v->current_order.flags, OFB_PART_OF_ORDERS)) {
str = STR_HEADING_FOR_ROAD_DEPOT + _patches.vehicle_speed;
} else {
@ -229,7 +229,7 @@ static void RoadVehViewWndProc(Window *w, WindowEvent *e)
default:
if (v->num_orders == 0) {
str = STR_NO_ORDERS + _patches.vehicle_speed;
SetDParam(0, v->cur_speed / 2);
SetDParam(0, v->cur_speed * 10 / 32);
} else {
str = STR_EMPTY;
}

View File

@ -213,14 +213,14 @@ static void ShipViewWndProc(Window *w, WindowEvent *e)
switch (v->current_order.type) {
case OT_GOTO_STATION: {
SetDParam(0, v->current_order.dest);
SetDParam(1, v->cur_speed / 2);
SetDParam(1, v->cur_speed * 10 / 32);
str = STR_HEADING_FOR_STATION + _patches.vehicle_speed;
} break;
case OT_GOTO_DEPOT: {
Depot *depot = GetDepot(v->current_order.dest);
SetDParam(0, depot->town_index);
SetDParam(1, v->cur_speed / 2);
SetDParam(1, v->cur_speed * 10 / 32);
if (HASBIT(v->current_order.flags, OFB_HALT_IN_DEPOT) && !HASBIT(v->current_order.flags, OFB_PART_OF_ORDERS)) {
str = STR_HEADING_FOR_SHIP_DEPOT + _patches.vehicle_speed;
} else {
@ -236,7 +236,7 @@ static void ShipViewWndProc(Window *w, WindowEvent *e)
default:
if (v->num_orders == 0) {
str = STR_NO_ORDERS + _patches.vehicle_speed;
SetDParam(0, v->cur_speed / 2);
SetDParam(0, v->cur_speed * 10 / 32);
} else {
str = STR_EMPTY;
}

View File

@ -487,21 +487,21 @@ typedef struct Units {
/* Unit conversions */
static const Units units[] = {
{ // Imperial (Original, mph, hp, metric ton, litre, kN)
10, 4, STR_UNITS_VELOCITY_IMPERIAL,
1, 0, STR_UNITS_VELOCITY_IMPERIAL,
1, 0, STR_UNITS_POWER_IMPERIAL,
1, 0, STR_UNITS_WEIGHT_SHORT_METRIC, STR_UNITS_WEIGHT_LONG_METRIC,
1000, 0, STR_UNITS_VOLUME_SHORT_METRIC, STR_UNITS_VOLUME_LONG_METRIC,
1, 0, STR_UNITS_FORCE_SI,
},
{ // Metric (km/h, hp, metric ton, litre, kN)
1, 0, STR_UNITS_VELOCITY_METRIC,
103, 6, STR_UNITS_VELOCITY_METRIC,
1, 0, STR_UNITS_POWER_METRIC,
1, 0, STR_UNITS_WEIGHT_SHORT_METRIC, STR_UNITS_WEIGHT_LONG_METRIC,
1000, 0, STR_UNITS_VOLUME_SHORT_METRIC, STR_UNITS_VOLUME_LONG_METRIC,
1, 0, STR_UNITS_FORCE_SI,
},
{ // SI (m/s, kilowatt, kilogram, cubic metres, kilonewton)
284, 10, STR_UNITS_VELOCITY_SI,
1831, 12, STR_UNITS_VELOCITY_SI,
764, 10, STR_UNITS_POWER_SI,
1000, 0, STR_UNITS_WEIGHT_SHORT_SI, STR_UNITS_WEIGHT_LONG_SI,
1, 0, STR_UNITS_VOLUME_SHORT_SI, STR_UNITS_VOLUME_LONG_SI,

View File

@ -183,7 +183,7 @@ static void TrainViewWndProc(Window *w, WindowEvent *e)
str = STR_8861_STOPPED;
}
} else {
SetDParam(0, v->u.rail.last_speed);
SetDParam(0, v->u.rail.last_speed * 10 / 16);
str = STR_TRAIN_STOPPING + _patches.vehicle_speed;
}
} else {
@ -191,7 +191,7 @@ static void TrainViewWndProc(Window *w, WindowEvent *e)
case OT_GOTO_STATION: {
str = STR_HEADING_FOR_STATION + _patches.vehicle_speed;
SetDParam(0, v->current_order.dest);
SetDParam(1, v->u.rail.last_speed);
SetDParam(1, v->u.rail.last_speed * 10 / 16);
} break;
case OT_GOTO_DEPOT: {
@ -202,7 +202,7 @@ static void TrainViewWndProc(Window *w, WindowEvent *e)
} else {
str = STR_HEADING_FOR_TRAIN_DEPOT_SERVICE + _patches.vehicle_speed;
}
SetDParam(1, v->u.rail.last_speed);
SetDParam(1, v->u.rail.last_speed * 10 / 16);
} break;
case OT_LOADING:
@ -213,14 +213,14 @@ static void TrainViewWndProc(Window *w, WindowEvent *e)
case OT_GOTO_WAYPOINT: {
SetDParam(0, v->current_order.dest);
str = STR_HEADING_FOR_WAYPOINT + _patches.vehicle_speed;
SetDParam(1, v->u.rail.last_speed);
SetDParam(1, v->u.rail.last_speed * 10 / 16);
break;
}
default:
if (v->num_orders == 0) {
str = STR_NO_ORDERS + _patches.vehicle_speed;
SetDParam(0, v->u.rail.last_speed);
SetDParam(0, v->u.rail.last_speed * 10 / 16);
} else {
str = STR_EMPTY;
}
@ -425,7 +425,7 @@ static void DrawTrainDetailsWindow(Window *w)
SetDParam(3, GetTrainRunningCost(v) >> 8);
DrawString(x, 15, STR_885D_AGE_RUNNING_COST_YR, 0);
SetDParam(2, v->u.rail.cached_max_speed);
SetDParam(2, v->u.rail.cached_max_speed * 10 / 16);
SetDParam(1, v->u.rail.cached_power);
SetDParam(0, v->u.rail.cached_weight);
SetDParam(3, v->u.rail.cached_max_te / 1000);