Timetable GUI: Add warnings for conditional order timetabling.

This commit is contained in:
Jonathan G Rennison
2017-12-18 01:47:22 +00:00
parent 218085c535
commit c4897f92df
2 changed files with 6 additions and 0 deletions

View File

@@ -569,12 +569,14 @@ struct TimetableWindow : Window {
bool have_missing_wait = false;
bool have_missing_travel = false;
bool have_bad_full_load = false;
bool have_non_timetabled_conditional_branch = false;
const bool assume_timetabled = HasBit(v->vehicle_flags, VF_AUTOFILL_TIMETABLE) || HasBit(v->vehicle_flags, VF_AUTOMATE_TIMETABLE);
for (int n = 0; n < v->GetNumOrders(); n++) {
const Order *order = v->GetOrder(n);
if (order->IsType(OT_CONDITIONAL)) {
have_conditional = true;
if (!order->IsWaitTimetabled()) have_non_timetabled_conditional_branch = true;
} else {
if (order->GetWaitTime() == 0 && order->IsType(OT_GOTO_STATION)) {
have_missing_wait = true;
@@ -636,6 +638,8 @@ struct TimetableWindow : Window {
}
}
if (have_bad_full_load) draw_info(STR_TIMETABLE_WARNING_FULL_LOAD, true);
if (have_conditional && HasBit(v->vehicle_flags, VF_AUTOFILL_TIMETABLE)) draw_info(STR_TIMETABLE_WARNING_AUTOFILL_CONDITIONAL, true);
if (total_time && have_non_timetabled_conditional_branch) draw_info(STR_TIMETABLE_NON_TIMETABLED_BRANCH, false);
if (warning_count != this->summary_warnings) {
TimetableWindow *mutable_this = const_cast<TimetableWindow *>(this);