MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / GetTimetableTotalTimeString

Method GetTimetableTotalTimeString

src/timetable_gui.cpp:540–546  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

538 }
539
540 std::string GetTimetableTotalTimeString(TimerGameTick::Ticks total_time) const
541 {
542 auto [str, value] = GetTimetableParameters(total_time);
543 if (!this->vehicle->orders->IsCompleteTimetable()) return GetString(STR_TIMETABLE_TOTAL_TIME_INCOMPLETE, str, value);
544 if (total_time % TicksPerTimetableUnit() == 0) return GetString(STR_TIMETABLE_TOTAL_TIME, str, value);
545 return GetString(STR_TIMETABLE_APPROX_TIME, str, value);
546 }
547
548 /**
549 * Helper function to draw the summary panel.

Callers

nothing calls this directly

Calls 4

GetTimetableParametersFunction · 0.85
TicksPerTimetableUnitFunction · 0.85
IsCompleteTimetableMethod · 0.80
GetStringFunction · 0.70

Tested by

no test coverage detected