Debug: Show type of current order in vehicle debug info

This commit is contained in:
Jonathan G Rennison
2022-10-30 14:09:50 +00:00
parent 0f852c32d6
commit 6ac311d71e
3 changed files with 26 additions and 2 deletions

View File

@@ -3567,3 +3567,25 @@ void ShiftOrderDates(int interval)
SetWindowClassesDirty(WC_SCHDISPATCH_SLOTS);
InvalidateWindowClassesData(WC_DEPARTURES_BOARD, 0);
}
const char *GetOrderTypeName(OrderType order_type)
{
static const char *names[] = {
"OT_NOTHING",
"OT_GOTO_STATION",
"OT_GOTO_DEPOT",
"OT_LOADING",
"OT_LEAVESTATION",
"OT_DUMMY",
"OT_GOTO_WAYPOINT",
"OT_CONDITIONAL",
"OT_IMPLICIT",
"OT_WAITING",
"OT_LOADING_ADVANCE",
"OT_RELEASE_SLOT",
"OT_COUNTER",
};
static_assert(lengthof(names) == OT_END);
if (order_type < OT_END) return names[order_type];
return "???";
}