diff options
author | rubidium <rubidium@openttd.org> | 2008-04-12 11:58:19 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-04-12 11:58:19 +0000 |
commit | ac94b6384b518390c7e7791446c06c78cb6ce1d2 (patch) | |
tree | a1bb66a0b0fdffbcfd3789f35b269fc5940731ca /src/timetable_gui.cpp | |
parent | 04b9600920808bcb6195f649c58f905983af9a9b (diff) | |
download | openttd-ac94b6384b518390c7e7791446c06c78cb6ce1d2.tar.xz |
(svn r12667) -Feature: conditional 'skip/jump' orders.
Diffstat (limited to 'src/timetable_gui.cpp')
-rw-r--r-- | src/timetable_gui.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp index 54223f1e3..d77691552 100644 --- a/src/timetable_gui.cpp +++ b/src/timetable_gui.cpp @@ -116,7 +116,7 @@ static void DrawTimetableWindow(Window *w) if (i - w->vscroll.pos >= w->vscroll.cap) break; if (i % 2 == 0) { - SetDParam(2, STR_EMPTY); + SetDParam(5, STR_EMPTY); switch (order->GetType()) { case OT_DUMMY: @@ -130,8 +130,8 @@ static void DrawTimetableWindow(Window *w) SetDParam(3, STR_EMPTY); if (order->wait_time > 0) { - SetDParam(4, STR_TIMETABLE_STAY_FOR); - SetTimetableParams(5, 6, order->wait_time); + SetDParam(5, STR_TIMETABLE_STAY_FOR); + SetTimetableParams(6, 7, order->wait_time); } else { SetDParam(4, STR_EMPTY); } @@ -178,6 +178,20 @@ static void DrawTimetableWindow(Window *w) SetDParam(1, order->GetDestination()); break; + + case OT_CONDITIONAL: { + extern uint ConvertSpeedToDisplaySpeed(uint speed); + OrderConditionComparator occ = order->GetConditionComparator(); + SetDParam(0, (occ == OCC_IS_TRUE || occ == OCC_IS_FALSE) ? STR_CONDITIONAL_TRUE_FALSE : STR_CONDITIONAL_NUM); + SetDParam(1, order->GetConditionSkipToOrder() + 1); + SetDParam(2, STR_ORDER_CONDITIONAL_LOAD_PERCENTAGE + order->GetConditionVariable()); + SetDParam(3, STR_ORDER_CONDITIONAL_COMPARATOR_EQUALS + occ); + + uint value = order->GetConditionValue(); + if (order->GetConditionVariable() == OCV_MAX_SPEED) value = ConvertSpeedToDisplaySpeed(value); + SetDParam(4, value); + } break; + default: break; } |