summaryrefslogtreecommitdiff
path: root/src/order_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-04-12 13:07:25 +0000
committerrubidium <rubidium@openttd.org>2008-04-12 13:07:25 +0000
commited250cc7b581595ed57a518ce6dfd4b00551a022 (patch)
treecb10294f4483a7fa3996d88041453988e023385f /src/order_gui.cpp
parent8c89250f58116309341c04ff4fc5d31887e8b180 (diff)
downloadopenttd-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.cpp28
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();
}