summaryrefslogtreecommitdiff
path: root/src/vehicle_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-05-12 18:19:36 +0000
committerrubidium <rubidium@openttd.org>2010-05-12 18:19:36 +0000
commit5051ef80c663e252ed6867b3cd0298d3b1c8717c (patch)
tree92906fbbf435190a120e62033f0d4bb413f9a35f /src/vehicle_gui.cpp
parent007c9641a6706abc3afc84fda542b1915dc21d35 (diff)
downloadopenttd-5051ef80c663e252ed6867b3cd0298d3b1c8717c.tar.xz
(svn r19796) -Codechange: introduce and use a {DEPOT} string command
Diffstat (limited to 'src/vehicle_gui.cpp')
-rw-r--r--src/vehicle_gui.cpp33
1 files changed, 12 insertions, 21 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp
index 89a3f9430..bc286d81b 100644
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -1073,29 +1073,26 @@ public:
case VLW_STANDARD: // Company Name
SetDParam(0, STR_COMPANY_NAME);
SetDParam(1, index);
- SetDParam(2, this->vscroll.GetCount());
+ SetDParam(3, this->vscroll.GetCount());
break;
case VLW_WAYPOINT_LIST:
SetDParam(0, STR_WAYPOINT_NAME);
SetDParam(1, index);
- SetDParam(2, this->vscroll.GetCount());
+ SetDParam(3, this->vscroll.GetCount());
break;
case VLW_STATION_LIST: // Station Name
SetDParam(0, STR_STATION_NAME);
SetDParam(1, index);
- SetDParam(2, this->vscroll.GetCount());
+ SetDParam(3, this->vscroll.GetCount());
break;
case VLW_DEPOT_LIST:
- SetDParam(0, STR_DEPOT_TRAIN_CAPTION + this->vehicle_type);
- if (this->vehicle_type == VEH_AIRCRAFT) {
- SetDParam(1, index); // Airport name
- } else {
- SetDParam(1, Depot::Get(index)->town_index);
- }
- SetDParam(2, this->vscroll.GetCount());
+ SetDParam(0, STR_DEPOT_CAPTION);
+ SetDParam(1, this->vehicle_type);
+ SetDParam(2, index);
+ SetDParam(3, this->vscroll.GetCount());
break;
default: NOT_REACHED();
}
@@ -2086,19 +2083,13 @@ public:
} break;
case OT_GOTO_DEPOT: {
- if (v->type == VEH_AIRCRAFT) {
- /* Aircrafts always go to a station, even if you say depot */
- SetDParam(0, v->current_order.GetDestination());
- SetDParam(1, v->GetDisplaySpeed());
- } else {
- Depot *depot = Depot::Get(v->current_order.GetDestination());
- SetDParam(0, depot->town_index);
- SetDParam(1, v->GetDisplaySpeed());
- }
+ SetDParam(0, v->type);
+ SetDParam(1, v->current_order.GetDestination());
+ SetDParam(2, v->GetDisplaySpeed());
if (v->current_order.GetDepotActionType() & ODATFB_HALT) {
- str = STR_VEHICLE_STATUS_HEADING_FOR_TRAIN_DEPOT + 2 * v->type + _settings_client.gui.vehicle_speed;
+ str = STR_VEHICLE_STATUS_HEADING_FOR_DEPOT + _settings_client.gui.vehicle_speed;
} else {
- str = STR_VEHICLE_STATUS_HEADING_FOR_TRAIN_DEPOT_SERVICE + 2 * v->type + _settings_client.gui.vehicle_speed;
+ str = STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_SERVICE + _settings_client.gui.vehicle_speed;
}
} break;