|
@@ -152,13 +152,13 @@ static void DrawOrdersWindow(Window *w)
|
|
|
|
|
|
w->ShowWidget(ORDER_WIDGET_UNLOAD); // Unload
|
|
|
|
|
|
if (order != NULL) {
|
|
|
switch (order->GetType()) {
|
|
|
case OT_GOTO_STATION:
|
|
|
if (!GetStation(order->dest)->IsBuoy()) break;
|
|
|
if (!GetStation(order->GetDestination())->IsBuoy()) break;
|
|
|
/* Fall-through */
|
|
|
|
|
|
case OT_GOTO_WAYPOINT:
|
|
|
w->DisableWidget(ORDER_WIDGET_FULL_LOAD);
|
|
|
w->DisableWidget(ORDER_WIDGET_UNLOAD);
|
|
|
w->DisableWidget(ORDER_WIDGET_TRANSFER);
|
|
@@ -194,28 +194,28 @@ static void DrawOrdersWindow(Window *w)
|
|
|
if (i - w->vscroll.pos < w->vscroll.cap) {
|
|
|
SetDParam(1, 6);
|
|
|
|
|
|
switch (order->GetType()) {
|
|
|
case OT_DUMMY:
|
|
|
SetDParam(1, STR_INVALID_ORDER);
|
|
|
SetDParam(2, order->dest);
|
|
|
SetDParam(2, order->GetDestination());
|
|
|
break;
|
|
|
|
|
|
case OT_GOTO_STATION:
|
|
|
SetDParam(1, StationOrderStrings[order->flags]);
|
|
|
SetDParam(2, order->dest);
|
|
|
SetDParam(2, order->GetDestination());
|
|
|
break;
|
|
|
|
|
|
case OT_GOTO_DEPOT: {
|
|
|
StringID s = STR_NULL;
|
|
|
|
|
|
if (v->type == VEH_AIRCRAFT) {
|
|
|
s = STR_GO_TO_AIRPORT_HANGAR;
|
|
|
SetDParam(2, order->dest);
|
|
|
SetDParam(2, order->GetDestination());
|
|
|
} else {
|
|
|
SetDParam(2, GetDepot(order->dest)->town_index);
|
|
|
SetDParam(2, GetDepot(order->GetDestination())->town_index);
|
|
|
|
|
|
switch (v->type) {
|
|
|
case VEH_TRAIN: s = (order->flags & OFB_NON_STOP) ? 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;
|
|
@@ -233,13 +233,13 @@ static void DrawOrdersWindow(Window *w)
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
case OT_GOTO_WAYPOINT:
|
|
|
SetDParam(1, (order->flags & OFB_NON_STOP) ? STR_GO_NON_STOP_TO_WAYPOINT : STR_GO_TO_WAYPOINT);
|
|
|
SetDParam(2, order->dest);
|
|
|
SetDParam(2, order->GetDestination());
|
|
|
break;
|
|
|
|
|
|
default: break;
|
|
|
}
|
|
|
|
|
|
SetDParam(0, i + 1);
|
|
@@ -332,13 +332,12 @@ static Order GetOrderCmdFromTile(const V
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// not found
|
|
|
order.Free();
|
|
|
order.dest = INVALID_STATION;
|
|
|
return order;
|
|
|
}
|
|
|
|
|
|
static bool HandleOrderVehClick(const Vehicle *v, const Vehicle *u, Window *w)
|
|
|
{
|
|
|
if (u->type != v->type) return false;
|
|
@@ -560,15 +559,15 @@ static void OrdersWndProc(Window *w, Win
|
|
|
|
|
|
if (_ctrl_pressed && sel < v->num_orders) {
|
|
|
const Order *ord = GetVehicleOrder(v, sel);
|
|
|
TileIndex xy;
|
|
|
|
|
|
switch (ord->GetType()) {
|
|
|
case OT_GOTO_STATION: xy = GetStation(ord->dest)->xy ; break;
|
|
|
case OT_GOTO_DEPOT: xy = (v->type == VEH_AIRCRAFT) ? GetStation(ord->dest)->xy : GetDepot(ord->dest)->xy; break;
|
|
|
case OT_GOTO_WAYPOINT: xy = GetWaypoint(ord->dest)->xy; break;
|
|
|
case OT_GOTO_STATION: xy = GetStation(ord->GetDestination())->xy ; break;
|
|
|
case OT_GOTO_DEPOT: xy = (v->type == VEH_AIRCRAFT) ? GetStation(ord->GetDestination())->xy : GetDepot(ord->GetDestination())->xy; break;
|
|
|
case OT_GOTO_WAYPOINT: xy = GetWaypoint(ord->GetDestination())->xy; break;
|
|
|
default: xy = 0; break;
|
|
|
}
|
|
|
|
|
|
if (xy != 0) ScrollMainWindowToTile(xy);
|
|
|
return;
|
|
|
} else {
|