comparison src/timetable_gui.cpp @ 8903:d15e125c0b6a draft

(svn r12670) -Add: unconditional/always order 'jump/skip' variable.
author rubidium <rubidium@openttd.org>
date Sat, 12 Apr 2008 13:07:25 +0000 (2008-04-12)
parents a12b2ec504da
children 2b6a37a13245
comparison
equal deleted inserted replaced
8902:4b63a1a768fe 8903:d15e125c0b6a
177 SetDParam(0, (order->GetNonStopType() != ONSF_STOP_EVERYWHERE) ? STR_GO_NON_STOP_TO_WAYPOINT : STR_GO_TO_WAYPOINT); 177 SetDParam(0, (order->GetNonStopType() != ONSF_STOP_EVERYWHERE) ? STR_GO_NON_STOP_TO_WAYPOINT : STR_GO_TO_WAYPOINT);
178 SetDParam(1, order->GetDestination()); 178 SetDParam(1, order->GetDestination());
179 break; 179 break;
180 180
181 181
182 case OT_CONDITIONAL: { 182 case OT_CONDITIONAL:
183 extern uint ConvertSpeedToDisplaySpeed(uint speed);
184 OrderConditionComparator occ = order->GetConditionComparator();
185 SetDParam(0, (occ == OCC_IS_TRUE || occ == OCC_IS_FALSE) ? STR_CONDITIONAL_TRUE_FALSE : STR_CONDITIONAL_NUM);
186 SetDParam(1, order->GetConditionSkipToOrder() + 1); 183 SetDParam(1, order->GetConditionSkipToOrder() + 1);
187 SetDParam(2, STR_ORDER_CONDITIONAL_LOAD_PERCENTAGE + order->GetConditionVariable()); 184 if (order->GetConditionVariable() == OCV_UNCONDITIONALLY) {
188 SetDParam(3, STR_ORDER_CONDITIONAL_COMPARATOR_EQUALS + occ); 185 SetDParam(0, STR_CONDITIONAL_UNCONDITIONAL);
189 186 } else {
190 uint value = order->GetConditionValue(); 187 extern uint ConvertSpeedToDisplaySpeed(uint speed);
191 if (order->GetConditionVariable() == OCV_MAX_SPEED) value = ConvertSpeedToDisplaySpeed(value); 188 OrderConditionComparator occ = order->GetConditionComparator();
192 SetDParam(4, value); 189 SetDParam(0, (occ == OCC_IS_TRUE || occ == OCC_IS_FALSE) ? STR_CONDITIONAL_TRUE_FALSE : STR_CONDITIONAL_NUM);
193 } break; 190 SetDParam(2, STR_ORDER_CONDITIONAL_LOAD_PERCENTAGE + order->GetConditionVariable());
191 SetDParam(3, STR_ORDER_CONDITIONAL_COMPARATOR_EQUALS + occ);
192
193 uint value = order->GetConditionValue();
194 if (order->GetConditionVariable() == OCV_MAX_SPEED) value = ConvertSpeedToDisplaySpeed(value);
195 SetDParam(4, value);
196 }
197 break;
194 198
195 default: break; 199 default: break;
196 } 200 }
197 201
198 DrawString(2, y, STR_TIMETABLE_GO_TO, (i == selected) ? TC_WHITE : TC_BLACK); 202 DrawString(2, y, STR_TIMETABLE_GO_TO, (i == selected) ? TC_WHITE : TC_BLACK);