|
|
@ -508,7 +508,8 @@ struct SchdispatchWindow : GeneralVehicleWindow {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool have_last = false;
|
|
|
|
bool have_last = false;
|
|
|
|
if (ds.GetScheduledDispatchLastDispatch() % ds.GetScheduledDispatchDuration() == slot->offset) {
|
|
|
|
int32_t last_dispatch = ds.GetScheduledDispatchLastDispatch();
|
|
|
|
|
|
|
|
if (last_dispatch != INVALID_SCHEDULED_DISPATCH_OFFSET && (last_dispatch % ds.GetScheduledDispatchDuration() == slot->offset)) {
|
|
|
|
_temp_special_strings[0] += '\n';
|
|
|
|
_temp_special_strings[0] += '\n';
|
|
|
|
_temp_special_strings[0] += GetString(STR_SCHDISPATCH_SLOT_TOOLTIP_LAST);
|
|
|
|
_temp_special_strings[0] += GetString(STR_SCHDISPATCH_SLOT_TOOLTIP_LAST);
|
|
|
|
if (_settings_time.time_in_minutes) {
|
|
|
|
if (_settings_time.time_in_minutes) {
|
|
|
@ -521,7 +522,7 @@ struct SchdispatchWindow : GeneralVehicleWindow {
|
|
|
|
have_last = true;
|
|
|
|
have_last = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
StateTicks next_slot = GetScheduledDispatchTime(ds, _state_ticks);
|
|
|
|
StateTicks next_slot = GetScheduledDispatchTime(ds, _state_ticks);
|
|
|
|
if ((next_slot - ds.GetScheduledDispatchStartTick()).AsTicks() % ds.GetScheduledDispatchDuration() == slot->offset) {
|
|
|
|
if (next_slot != INVALID_STATE_TICKS && ((next_slot - ds.GetScheduledDispatchStartTick()).AsTicks() % ds.GetScheduledDispatchDuration() == slot->offset)) {
|
|
|
|
if (!have_last) _temp_special_strings[0] += '\n';
|
|
|
|
if (!have_last) _temp_special_strings[0] += '\n';
|
|
|
|
_temp_special_strings[0] += GetString(STR_SCHDISPATCH_SLOT_TOOLTIP_NEXT);
|
|
|
|
_temp_special_strings[0] += GetString(STR_SCHDISPATCH_SLOT_TOOLTIP_NEXT);
|
|
|
|
if (_settings_time.time_in_minutes) {
|
|
|
|
if (_settings_time.time_in_minutes) {
|
|
|
@ -631,9 +632,14 @@ struct SchdispatchWindow : GeneralVehicleWindow {
|
|
|
|
const StateTicks end_tick = ds.GetScheduledDispatchStartTick() + ds.GetScheduledDispatchDuration();
|
|
|
|
const StateTicks end_tick = ds.GetScheduledDispatchStartTick() + ds.GetScheduledDispatchDuration();
|
|
|
|
|
|
|
|
|
|
|
|
StateTicks slot = GetScheduledDispatchTime(ds, _state_ticks);
|
|
|
|
StateTicks slot = GetScheduledDispatchTime(ds, _state_ticks);
|
|
|
|
int32_t next_offset = (slot - ds.GetScheduledDispatchStartTick()).AsTicks() % ds.GetScheduledDispatchDuration();
|
|
|
|
int32_t next_offset = (slot != INVALID_STATE_TICKS) ? (slot - ds.GetScheduledDispatchStartTick()).AsTicks() % ds.GetScheduledDispatchDuration() : INT32_MIN;
|
|
|
|
|
|
|
|
|
|
|
|
int32_t last_dispatch = ds.GetScheduledDispatchLastDispatch() % ds.GetScheduledDispatchDuration();
|
|
|
|
int32_t last_dispatch;
|
|
|
|
|
|
|
|
if (ds.GetScheduledDispatchLastDispatch() != INVALID_SCHEDULED_DISPATCH_OFFSET) {
|
|
|
|
|
|
|
|
last_dispatch = ds.GetScheduledDispatchLastDispatch() % ds.GetScheduledDispatchDuration();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
last_dispatch = INT32_MIN;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (int y = r.top + 1; num < maxval; y += this->resize.step_height) { /* Draw the rows */
|
|
|
|
for (int y = r.top + 1; num < maxval; y += this->resize.step_height) { /* Draw the rows */
|
|
|
|
for (uint i = 0; i < this->num_columns && num < maxval; i++, num++) {
|
|
|
|
for (uint i = 0; i < this->num_columns && num < maxval; i++, num++) {
|
|
|
@ -829,9 +835,11 @@ struct SchdispatchWindow : GeneralVehicleWindow {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const StateTicks next_departure = GetScheduledDispatchTime(ds, _state_ticks);
|
|
|
|
const StateTicks next_departure = GetScheduledDispatchTime(ds, _state_ticks);
|
|
|
|
set_next_departure_update(next_departure + ds.GetScheduledDispatchDelay());
|
|
|
|
if (next_departure != INVALID_STATE_TICKS) {
|
|
|
|
SetDParam(0, next_departure);
|
|
|
|
set_next_departure_update(next_departure + ds.GetScheduledDispatchDelay());
|
|
|
|
DrawString(ir.left, ir.right, y, STR_SCHDISPATCH_SUMMARY_NEXT_AVAILABLE_DEPARTURE);
|
|
|
|
SetDParam(0, next_departure);
|
|
|
|
|
|
|
|
DrawString(ir.left, ir.right, y, STR_SCHDISPATCH_SUMMARY_NEXT_AVAILABLE_DEPARTURE);
|
|
|
|
|
|
|
|
}
|
|
|
|
y += GetCharacterHeight(FS_NORMAL);
|
|
|
|
y += GetCharacterHeight(FS_NORMAL);
|
|
|
|
|
|
|
|
|
|
|
|
departure_time_warnings(next_departure);
|
|
|
|
departure_time_warnings(next_departure);
|
|
|
|