diff options
author | rubidium <rubidium@openttd.org> | 2008-04-12 13:07:25 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-04-12 13:07:25 +0000 |
commit | ed250cc7b581595ed57a518ce6dfd4b00551a022 (patch) | |
tree | cb10294f4483a7fa3996d88041453988e023385f /src/order_gui.cpp | |
parent | 8c89250f58116309341c04ff4fc5d31887e8b180 (diff) | |
download | openttd-ed250cc7b581595ed57a518ce6dfd4b00551a022.tar.xz |
(svn r12670) -Add: unconditional/always order 'jump/skip' variable.
Diffstat (limited to 'src/order_gui.cpp')
-rw-r--r-- | src/order_gui.cpp | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/src/order_gui.cpp b/src/order_gui.cpp index 4fc7a6b47..77b593907 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -191,6 +191,7 @@ static const StringID _order_conditional_variable[] = { STR_ORDER_CONDITIONAL_MAX_SPEED, STR_ORDER_CONDITIONAL_AGE, STR_ORDER_CONDITIONAL_REQUIRES_SERVICE, + STR_ORDER_CONDITIONAL_UNCONDITIONALLY, INVALID_STRING_ID, }; @@ -285,7 +286,8 @@ static void DrawOrdersWindow(Window *w) w->ShowWidget(ORDER_WIDGET_COND_VALUE); OrderConditionVariable ocv = order->GetConditionVariable(); - w->SetWidgetDisabledState(ORDER_WIDGET_COND_VALUE, ocv == OCV_REQUIRES_SERVICE); + w->SetWidgetDisabledState(ORDER_WIDGET_COND_COMPARATOR, ocv == OCV_UNCONDITIONALLY); + w->SetWidgetDisabledState(ORDER_WIDGET_COND_VALUE, ocv == OCV_REQUIRES_SERVICE || ocv == OCV_UNCONDITIONALLY); uint value = order->GetConditionValue(); if (order->GetConditionVariable() == OCV_MAX_SPEED) value = ConvertSpeedToDisplaySpeed(value); @@ -372,17 +374,21 @@ static void DrawOrdersWindow(Window *w) SetDParam(2, order->GetDestination()); break; - case OT_CONDITIONAL: { - OrderConditionComparator occ = order->GetConditionComparator(); - SetDParam(1, (occ == OCC_IS_TRUE || occ == OCC_IS_FALSE) ? STR_CONDITIONAL_TRUE_FALSE : STR_CONDITIONAL_NUM); + case OT_CONDITIONAL: SetDParam(2, order->GetConditionSkipToOrder() + 1); - SetDParam(3, STR_ORDER_CONDITIONAL_LOAD_PERCENTAGE + order->GetConditionVariable()); - SetDParam(4, STR_ORDER_CONDITIONAL_COMPARATOR_EQUALS + occ); - - uint value = order->GetConditionValue(); - if (order->GetConditionVariable() == OCV_MAX_SPEED) value = ConvertSpeedToDisplaySpeed(value); - SetDParam(5, value); - } break; + if (order->GetConditionVariable() == OCV_UNCONDITIONALLY) { + SetDParam(1, STR_CONDITIONAL_UNCONDITIONAL); + } else { + OrderConditionComparator occ = order->GetConditionComparator(); + SetDParam(1, (occ == OCC_IS_TRUE || occ == OCC_IS_FALSE) ? STR_CONDITIONAL_TRUE_FALSE : STR_CONDITIONAL_NUM); + SetDParam(3, STR_ORDER_CONDITIONAL_LOAD_PERCENTAGE + order->GetConditionVariable()); + SetDParam(4, STR_ORDER_CONDITIONAL_COMPARATOR_EQUALS + occ); + + uint value = order->GetConditionValue(); + if (order->GetConditionVariable() == OCV_MAX_SPEED) value = ConvertSpeedToDisplaySpeed(value); + SetDParam(5, value); + } + break; default: NOT_REACHED(); } |