Scheduled dispatch: Caveat text for number of vehicles required

This commit is contained in:
Jonathan G Rennison
2024-04-29 18:31:37 +01:00
parent a14f850f33
commit adc7840f01
2 changed files with 11 additions and 9 deletions

View File

@@ -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) {