summaryrefslogtreecommitdiff
path: root/src/order_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-04-13 16:54:19 +0000
committerrubidium <rubidium@openttd.org>2008-04-13 16:54:19 +0000
commita277d2df86c687b39d53af921df3442d790a9976 (patch)
treec86cfde879096a6a1bcd92d313e174e9a965cc68 /src/order_gui.cpp
parent79f4d763edcda79f13e95cf9f86b9e2782003194 (diff)
downloadopenttd-a277d2df86c687b39d53af921df3442d790a9976.tar.xz
(svn r12689) -Feature: non-stop(or rather no non-stop) and via orders for road vehicles.
Diffstat (limited to 'src/order_gui.cpp')
-rw-r--r--src/order_gui.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/order_gui.cpp b/src/order_gui.cpp
index 02d3e5fcb..56350f5e2 100644
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -237,7 +237,7 @@ static void DrawOrdersWindow(Window *w)
(uint)v->num_orders + ((shared_orders || v->num_orders != 0) ? 1 : 0) <= (uint)WP(w, order_d).sel);
/* non-stop only for trains */
- w->SetWidgetDisabledState(ORDER_WIDGET_NON_STOP, v->type != VEH_TRAIN || order == NULL);
+ w->SetWidgetDisabledState(ORDER_WIDGET_NON_STOP, (v->type != VEH_TRAIN && v->type != VEH_ROAD) || order == NULL);
w->SetWidgetDisabledState(ORDER_WIDGET_FULL_LOAD, order == NULL || (order->GetNonStopType() & ONSF_NO_STOP_AT_DESTINATION_STATION) != 0); // full load
w->SetWidgetDisabledState(ORDER_WIDGET_UNLOAD, order == NULL || (order->GetNonStopType() & ONSF_NO_STOP_AT_DESTINATION_STATION) != 0); // unload
/* Disable list of vehicles with the same shared orders if there is no list */
@@ -325,7 +325,7 @@ static void DrawOrdersWindow(Window *w)
OrderUnloadFlags unload = order->GetUnloadType();
SetDParam(1, STR_GO_TO_STATION);
- SetDParam(2, STR_ORDER_GO_TO + (v->type == VEH_TRAIN ? order->GetNonStopType() : 0));
+ SetDParam(2, STR_ORDER_GO_TO + ((v->type == VEH_TRAIN || v->type == VEH_ROAD) ? order->GetNonStopType() : 0));
SetDParam(3, order->GetDestination());
SetDParam(4, (order->GetNonStopType() & ONSF_NO_STOP_AT_DESTINATION_STATION) ? STR_EMPTY : _station_load_types[unload][load]);
} break;
@@ -431,6 +431,7 @@ static Order GetOrderCmdFromTile(const Vehicle *v, TileIndex tile)
case MP_ROAD:
if (IsRoadDepot(tile) && v->type == VEH_ROAD && IsTileOwner(tile, _local_player)) {
order.MakeGoToDepot(GetDepotByTile(tile)->index, ODTFB_PART_OF_ORDERS);
+ if (_patches.new_nonstop) order.SetNonStopType(ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS);
return order;
}
break;
@@ -481,7 +482,7 @@ static Order GetOrderCmdFromTile(const Vehicle *v, TileIndex tile)
(facil = FACIL_TRUCK_STOP, 1);
if (st->facilities & facil) {
order.MakeGoToStation(st_index);
- if (_patches.new_nonstop && v->type == VEH_TRAIN) order.SetNonStopType(ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS);
+ if (_patches.new_nonstop && (v->type == VEH_TRAIN || v->type == VEH_ROAD)) order.SetNonStopType(ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS);
return order;
}
}
@@ -1169,7 +1170,7 @@ void ShowOrdersWindow(const Vehicle *v)
if (v->owner != _local_player) {
w = AllocateWindowDescFront(&_other_orders_desc, veh);
} else {
- w = AllocateWindowDescFront((v->type == VEH_TRAIN) ? &_orders_train_desc : &_orders_desc, veh);
+ w = AllocateWindowDescFront((v->type == VEH_TRAIN || v->type == VEH_ROAD) ? &_orders_train_desc : &_orders_desc, veh);
}
if (w != NULL) {