91 |
91 |
92 order = GetVehicleOrder(v, sel); |
92 order = GetVehicleOrder(v, sel); |
93 |
93 |
94 if (v->owner == _local_player) { |
94 if (v->owner == _local_player) { |
95 /* skip */ |
95 /* skip */ |
96 SetWindowWidgetDisabledState(w, ORDER_WIDGET_SKIP, v->num_orders == 0); |
96 SetWindowWidgetDisabledState(w, ORDER_WIDGET_SKIP, v->num_orders <= 1); |
97 |
97 |
98 /* delete */ |
98 /* delete */ |
99 SetWindowWidgetDisabledState(w, ORDER_WIDGET_DELETE, |
99 SetWindowWidgetDisabledState(w, ORDER_WIDGET_DELETE, |
100 (uint)v->num_orders + ((shared_orders || v->num_orders != 0) ? 1 : 0) <= (uint)WP(w, order_d).sel); |
100 (uint)v->num_orders + ((shared_orders || v->num_orders != 0) ? 1 : 0) <= (uint)WP(w, order_d).sel); |
101 |
101 |
388 DoCommandP(v->tile, v->index + (OrderGetSel(w) << 16), OFB_TRANSFER, NULL, CMD_MODIFY_ORDER | CMD_MSG(STR_8835_CAN_T_MODIFY_THIS_ORDER)); |
388 DoCommandP(v->tile, v->index + (OrderGetSel(w) << 16), OFB_TRANSFER, NULL, CMD_MODIFY_ORDER | CMD_MSG(STR_8835_CAN_T_MODIFY_THIS_ORDER)); |
389 } |
389 } |
390 |
390 |
391 static void OrderClick_Skip(Window *w, const Vehicle *v) |
391 static void OrderClick_Skip(Window *w, const Vehicle *v) |
392 { |
392 { |
393 DoCommandP(v->tile, v->index, 0, NULL, CMD_SKIP_ORDER); |
393 /* Don't skip when there's nothing to skip */ |
|
394 if (_ctrl_pressed && v->cur_order_index == OrderGetSel(w)) return; |
|
395 |
|
396 DoCommandP(v->tile, v->index, _ctrl_pressed ? OrderGetSel(w) : ((v->cur_order_index + 1) % v->num_orders), |
|
397 NULL, CMD_SKIP_TO_ORDER | CMD_MSG(_ctrl_pressed ? STR_CAN_T_SKIP_TO_ORDER : STR_CAN_T_SKIP_ORDER)); |
394 } |
398 } |
395 |
399 |
396 static void OrderClick_Delete(Window *w, const Vehicle *v) |
400 static void OrderClick_Delete(Window *w, const Vehicle *v) |
397 { |
401 { |
398 DoCommandP(v->tile, v->index, OrderGetSel(w), NULL, CMD_DELETE_ORDER | CMD_MSG(STR_8834_CAN_T_DELETE_THIS_ORDER)); |
402 DoCommandP(v->tile, v->index, OrderGetSel(w), NULL, CMD_DELETE_ORDER | CMD_MSG(STR_8834_CAN_T_DELETE_THIS_ORDER)); |