Rename DateTicksScaled to StateTicks

Rename various other related/derived types and variables
This commit is contained in:
Jonathan G Rennison
2024-02-07 18:36:47 +00:00
parent 39b4772a34
commit 0ea57528c9
39 changed files with 270 additions and 270 deletions

View File

@@ -424,7 +424,7 @@ public:
d = (*(this->departures))[departure];
const Departure *a = (*(this->arrivals))[arrival];
if (a->scheduled_date < d->scheduled_date) {
if (a->scheduled_tick < d->scheduled_tick) {
d = a;
arrival++;
} else {
@@ -745,8 +745,8 @@ void DeparturesWindow<Twaypoint>::DrawDeparturesListItems(const Rect &r) const
uint departure = 0;
uint arrival = 0;
DateTicksScaled now_date = _scaled_date_ticks;
DateTicksScaled max_date = now_date + GetDeparturesMaxTicksAhead();
StateTicks now_date = _state_ticks;
StateTicks max_date = now_date + GetDeparturesMaxTicksAhead();
/* Draw each departure. */
for (uint i = 0; i < max_departures; ++i) {
@@ -760,7 +760,7 @@ void DeparturesWindow<Twaypoint>::DrawDeparturesListItems(const Rect &r) const
d = (*(this->departures))[departure];
const Departure *a = (*(this->arrivals))[arrival];
if (a->scheduled_date < d->scheduled_date) {
if (a->scheduled_tick < d->scheduled_tick) {
d = a;
arrival++;
} else {
@@ -773,7 +773,7 @@ void DeparturesWindow<Twaypoint>::DrawDeparturesListItems(const Rect &r) const
}
/* If for some reason the departure is too far in the future or is at a negative time, skip it. */
if (d->scheduled_date > max_date || d->scheduled_date < 0) {
if (d->scheduled_tick > max_date || d->scheduled_tick < 0) {
continue;
}
@@ -784,8 +784,8 @@ void DeparturesWindow<Twaypoint>::DrawDeparturesListItems(const Rect &r) const
if (_settings_client.gui.departure_show_both) time_str = STR_DEPARTURES_TIME_BOTH;
/* Time */
SetDParam(0, d->scheduled_date);
SetDParam(1, d->scheduled_date - (d->scheduled_waiting_time > 0 ? d->scheduled_waiting_time : d->order->GetWaitTime()));
SetDParam(0, d->scheduled_tick);
SetDParam(1, d->scheduled_tick - (d->scheduled_waiting_time > 0 ? d->scheduled_waiting_time : d->order->GetWaitTime()));
ltr ? DrawString( text_left, text_left + time_width, y + 1, time_str)
: DrawString(text_right - time_width, text_right, y + 1, time_str);
@@ -928,17 +928,17 @@ void DeparturesWindow<Twaypoint>::DrawDeparturesListItems(const Rect &r) const
/* The vehicle has been cancelled. */
DrawString(status_left, status_right, y + 1, STR_DEPARTURES_CANCELLED);
} else{
if (d->lateness <= DATE_UNIT_SIZE && d->scheduled_date > now_date) {
if (d->lateness <= DATE_UNIT_SIZE && d->scheduled_tick > now_date) {
/* We have no evidence that the vehicle is late, so assume it is on time. */
DrawString(status_left, status_right, y + 1, STR_DEPARTURES_ON_TIME);
} else {
if ((d->scheduled_date + d->lateness) < now_date) {
if ((d->scheduled_tick + d->lateness) < now_date) {
/* The vehicle was expected to have arrived by now, even if we knew it was going to be late. */
/* We assume that the train stays at least a day at a station so it won't accidentally be marked as delayed for a fraction of a day. */
DrawString(status_left, status_right, y + 1, STR_DEPARTURES_DELAYED);
} else {
/* The vehicle is expected to be late and is not yet due to arrive. */
SetDParam(0, d->scheduled_date + d->lateness);
SetDParam(0, d->scheduled_tick + d->lateness);
DrawString(status_left, status_right, y + 1, STR_DEPARTURES_EXPECTED);
}
}