summaryrefslogtreecommitdiff
path: root/src/order_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-06-04 19:32:45 +0000
committerrubidium <rubidium@openttd.org>2007-06-04 19:32:45 +0000
commitc4806955e5961f0d16d137997b1baa003b81f408 (patch)
tree23a952e411aa1977dbeed8415c8221c18598db03 /src/order_gui.cpp
parentcb340626cafacd29c41580141fb00d137891b6a5 (diff)
downloadopenttd-c4806955e5961f0d16d137997b1baa003b81f408.tar.xz
(svn r10033) -Feature [FS#760]: skip to the selected order in the order list when clicking on the "skip" button while pressing CTRL.
Diffstat (limited to 'src/order_gui.cpp')
-rw-r--r--src/order_gui.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/order_gui.cpp b/src/order_gui.cpp
index 5d69639d8..ead0cdadf 100644
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -93,7 +93,7 @@ static void DrawOrdersWindow(Window *w)
if (v->owner == _local_player) {
/* skip */
- SetWindowWidgetDisabledState(w, ORDER_WIDGET_SKIP, v->num_orders == 0);
+ SetWindowWidgetDisabledState(w, ORDER_WIDGET_SKIP, v->num_orders <= 1);
/* delete */
SetWindowWidgetDisabledState(w, ORDER_WIDGET_DELETE,
@@ -390,7 +390,11 @@ static void OrderClick_Transfer(Window* w, const Vehicle* v)
static void OrderClick_Skip(Window *w, const Vehicle *v)
{
- DoCommandP(v->tile, v->index, 0, NULL, CMD_SKIP_ORDER);
+ /* Don't skip when there's nothing to skip */
+ if (_ctrl_pressed && v->cur_order_index == OrderGetSel(w)) return;
+
+ DoCommandP(v->tile, v->index, _ctrl_pressed ? OrderGetSel(w) : ((v->cur_order_index + 1) % v->num_orders),
+ NULL, CMD_SKIP_TO_ORDER | CMD_MSG(_ctrl_pressed ? STR_CAN_T_SKIP_TO_ORDER : STR_CAN_T_SKIP_ORDER));
}
static void OrderClick_Delete(Window *w, const Vehicle *v)