| 388 | } |
| 389 | |
| 390 | std::string GetTimetableTravelString(const Order &order, int i, TextColour &colour) const |
| 391 | { |
| 392 | colour = (i == this->sel_index) ? TC_WHITE : TC_BLACK; |
| 393 | |
| 394 | if (order.IsType(OT_CONDITIONAL)) { |
| 395 | return GetString(STR_TIMETABLE_NO_TRAVEL); |
| 396 | } |
| 397 | |
| 398 | if (order.IsType(OT_IMPLICIT)) { |
| 399 | colour = ((i == this->sel_index) ? TC_SILVER : TC_GREY) | TC_NO_SHADE; |
| 400 | return GetString(STR_TIMETABLE_NOT_TIMETABLEABLE); |
| 401 | } |
| 402 | |
| 403 | if (order.IsTravelTimetabled()) { |
| 404 | auto [str, value] = GetTimetableParameters(order.GetTimetabledTravel()); |
| 405 | return order.GetMaxSpeed() != UINT16_MAX |
| 406 | ? GetString(STR_TIMETABLE_TRAVEL_FOR_SPEED, str, value, PackVelocity(order.GetMaxSpeed(), this->vehicle->type)) |
| 407 | : GetString(STR_TIMETABLE_TRAVEL_FOR, str, value); |
| 408 | } |
| 409 | |
| 410 | if (order.GetTravelTime() > 0) { |
| 411 | auto [str, value] = GetTimetableParameters(order.GetTravelTime()); |
| 412 | return order.GetMaxSpeed() != UINT16_MAX |
| 413 | ? GetString(STR_TIMETABLE_TRAVEL_FOR_SPEED_ESTIMATED, str, value, PackVelocity(order.GetMaxSpeed(), this->vehicle->type)) |
| 414 | : GetString(STR_TIMETABLE_TRAVEL_FOR_ESTIMATED, str, value); |
| 415 | } |
| 416 | |
| 417 | return order.GetMaxSpeed() != UINT16_MAX |
| 418 | ? GetString(STR_TIMETABLE_TRAVEL_NOT_TIMETABLED_SPEED, PackVelocity(order.GetMaxSpeed(), this->vehicle->type)) |
| 419 | : GetString(STR_TIMETABLE_TRAVEL_NOT_TIMETABLED); |
| 420 | } |
| 421 | |
| 422 | /** |
| 423 | * Helper function to draw the timetable panel. |
nothing calls this directly
no test coverage detected