Scheduled dispatch: Caveat text for number of vehicles required

tmp-jgrpp
Jonathan G Rennison 3 weeks ago
parent a14f850f33
commit adc7840f01

@ -2168,7 +2168,7 @@ STR_SCHDISPATCH_SLOT_TOOLTIP_TAG :{}Tag {NUM}
STR_SCHDISPATCH_SUMMARY_NO_LAST_DEPARTURE :{BLACK}No previous departures.
STR_SCHDISPATCH_SUMMARY_LAST_DEPARTURE_PAST :{BLACK}Last departure at {TT_TIME}.
STR_SCHDISPATCH_SUMMARY_LAST_DEPARTURE_FUTURE :{BLACK}Last departure has not left yet, it will depart at {TT_TIME}.
STR_SCHDISPATCH_SUMMARY_L1 :{BLACK}This schedule requires {COMMA} vehicle{P "" s}.
STR_SCHDISPATCH_SUMMARY_L1 :{BLACK}This schedule is estimated to require at least {COMMA} vehicle{P "" s}.
STR_SCHDISPATCH_SUMMARY_L2 :{BLACK}This schedule repeats every {STRING1}.
STR_SCHDISPATCH_SUMMARY_L3 :{BLACK}This schedule began at {TT_TIME}, and ends at {TT_TIME}.
STR_SCHDISPATCH_SUMMARY_L4 :{BLACK}Maximum delay of {STRING1} is allowed before the slot is skipped.

@ -850,14 +850,6 @@ struct SchdispatchWindow : GeneralVehicleWindow {
DrawString(ir.left, ir.right, y, STR_SCHDISPATCH_SUMMARY_REUSE_SLOTS_ENABLED);
extra_lines++;
y += GetCharacterHeight(FS_NORMAL);
} else if (!have_conditional) {
const int required_vehicle = CalculateMaxRequiredVehicle(v->orders->GetTimetableTotalDuration(), ds.GetScheduledDispatchDuration(), ds.GetScheduledDispatch());
if (required_vehicle > 0) {
SetDParam(0, required_vehicle);
DrawString(ir.left, ir.right, y, STR_SCHDISPATCH_SUMMARY_L1);
extra_lines++;
y += GetCharacterHeight(FS_NORMAL);
}
}
SetTimetableParams(0, ds.GetScheduledDispatchDuration(), true);
@ -873,6 +865,16 @@ struct SchdispatchWindow : GeneralVehicleWindow {
DrawString(ir.left, ir.right, y, STR_SCHDISPATCH_SUMMARY_L4);
y += GetCharacterHeight(FS_NORMAL);
if (!ds.GetScheduledDispatchReuseSlots() && !have_conditional) {
const int required_vehicle = CalculateMaxRequiredVehicle(v->orders->GetTimetableTotalDuration(), ds.GetScheduledDispatchDuration(), ds.GetScheduledDispatch());
if (required_vehicle > 0) {
SetDParam(0, required_vehicle);
DrawString(ir.left, ir.right, y, STR_SCHDISPATCH_SUMMARY_L1);
extra_lines++;
y += GetCharacterHeight(FS_NORMAL);
}
}
uint32_t duration = ds.GetScheduledDispatchDuration();
for (const DispatchSlot &slot : ds.GetScheduledDispatch()) {
if (slot.offset >= duration) {

Loading…
Cancel
Save