summaryrefslogtreecommitdiff
path: root/src/order_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-04-11 14:27:18 +0000
committerrubidium <rubidium@openttd.org>2008-04-11 14:27:18 +0000
commit48703f69f460633a359f17f3796b42b5583d18c4 (patch)
tree0a56e544fb2b6c38dadb15400102e5005c56e43b /src/order_gui.cpp
parent3c7e23fa8c4ba9d499fc0289173209563bb2eff5 (diff)
downloadopenttd-48703f69f460633a359f17f3796b42b5583d18c4.tar.xz
(svn r12660) -Codechange: make the creation of depot order strings a little more modular (instead of causing a string explosion).
Diffstat (limited to 'src/order_gui.cpp')
-rw-r--r--src/order_gui.cpp31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/order_gui.cpp b/src/order_gui.cpp
index 5eaa0cb91..519457c2d 100644
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -234,8 +234,6 @@ static void DrawOrdersWindow(Window *w)
SetDParam(5, STR_EMPTY);
if (i - w->vscroll.pos < w->vscroll.cap) {
- SetDParam(1, 6);
-
switch (order->GetType()) {
case OT_DUMMY:
SetDParam(1, STR_INVALID_ORDER);
@@ -252,39 +250,40 @@ static void DrawOrdersWindow(Window *w)
SetDParam(4, (order->GetNonStopType() & ONSF_NO_STOP_AT_DESTINATION_STATION) ? STR_EMPTY : _station_load_types[unload][load]);
} break;
- case OT_GOTO_DEPOT: {
- StringID s = STR_NULL;
-
+ case OT_GOTO_DEPOT:
if (v->type == VEH_AIRCRAFT) {
- s = STR_GO_TO_AIRPORT_HANGAR;
- SetDParam(2, order->GetDestination());
+ SetDParam(1, STR_GO_TO_HANGAR);
+ SetDParam(3, order->GetDestination());
} else {
- SetDParam(2, GetDepot(order->GetDestination())->town_index);
+ SetDParam(1, STR_GO_TO_DEPOT);
+ SetDParam(3, GetDepot(order->GetDestination())->town_index);
switch (v->type) {
- case VEH_TRAIN: s = (order->GetNonStopType() & ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS) ? STR_880F_GO_NON_STOP_TO_TRAIN_DEPOT : STR_GO_TO_TRAIN_DEPOT; break;
- case VEH_ROAD: s = STR_GO_TO_ROADVEH_DEPOT; break;
- case VEH_SHIP: s = STR_GO_TO_SHIP_DEPOT; break;
- default: break;
+ case VEH_TRAIN: SetDParam(4, STR_ORDER_TRAIN_DEPOT); break;
+ case VEH_ROAD: SetDParam(4, STR_ORDER_ROAD_DEPOT); break;
+ case VEH_SHIP: SetDParam(4, STR_ORDER_SHIP_DEPOT); break;
+ default: NOT_REACHED();
}
}
- if (order->GetDepotOrderType() & ODTFB_SERVICE) s++; // service at
+ if (order->GetDepotOrderType() & ODTFB_SERVICE) {
+ SetDParam(2, (order->GetNonStopType() & ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS) ? STR_ORDER_SERVICE_NON_STOP_AT : STR_ORDER_SERVICE_AT);
+ } else {
+ SetDParam(2, (order->GetNonStopType() & ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS) ? STR_ORDER_GO_NON_STOP_TO : STR_ORDER_GO_TO);
+ }
- SetDParam(1, s);
if (order->IsRefit()) {
SetDParam(5, STR_REFIT_ORDER);
SetDParam(6, GetCargo(order->GetRefitCargo())->name);
}
break;
- }
case OT_GOTO_WAYPOINT:
SetDParam(1, (order->GetNonStopType() & ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS) ? STR_GO_NON_STOP_TO_WAYPOINT : STR_GO_TO_WAYPOINT);
SetDParam(2, order->GetDestination());
break;
- default: break;
+ default: NOT_REACHED();
}
SetDParam(0, i + 1);