Changeset - r14361:20612050c4a7
[Not reviewed]
master
0 1 0
frosch - 14 years ago 2010-01-27 19:52:08
frosch@openttd.org
(svn r18928) -Fix (r18304): The date in case of 'early arrival' was misaligned in the timetable GUI.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/timetable_gui.cpp
Show inline comments
 
@@ -418,49 +418,49 @@ struct TimetableWindow : Window {
 
				const VehicleOrderID cur_order = v->cur_order_index % v->GetNumOrders();
 

	
 
				VehicleOrderID earlyID = BuildArrivalDepartureList(v, arr_dep) ? cur_order : (VehicleOrderID)INVALID_VEH_ORDER_ID;
 

	
 
				int y = r.top + WD_FRAMERECT_TOP;
 

	
 
				bool show_late = this->show_expected && v->lateness_counter > DAY_TICKS;
 
				Ticks offset = show_late ? 0 : -v->lateness_counter;
 

	
 
				bool rtl = _dynlang.text_dir == TD_RTL;
 
				int abbr_left  = rtl ? r.right - WD_FRAMERECT_RIGHT - this->deparr_abbr_width : r.left + WD_FRAMERECT_LEFT;
 
				int abbr_right = rtl ? r.right - WD_FRAMERECT_RIGHT : r.left + WD_FRAMERECT_LEFT + this->deparr_abbr_width;
 
				int time_left  = rtl ? r.left + WD_FRAMERECT_LEFT : r.right - WD_FRAMERECT_RIGHT - this->deparr_time_width;
 
				int time_right = rtl ? r.left + WD_FRAMERECT_LEFT + this->deparr_time_width : r.right - WD_FRAMERECT_RIGHT;
 

	
 
				for (int i = this->vscroll.GetPosition(); i / 2 < v->GetNumOrders(); ++i) { // note: i is also incremented in the loop
 
					/* Don't draw anything if it extends past the end of the window. */
 
					if (!this->vscroll.IsVisible(i)) break;
 

	
 
					if (i % 2 == 0) {
 
						if (arr_dep[i / 2].arrival != INVALID_TICKS) {
 
							DrawString(abbr_left, abbr_right, y, STR_TIMETABLE_ARRIVAL_ABBREVIATION, i == selected ? TC_WHITE : TC_BLACK);
 
							if (this->show_expected && i / 2 == earlyID) {
 
								SetArrivalDepartParams(0, 1, arr_dep[i / 2].arrival);
 
								DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_GREEN_STRING, i == selected ? TC_WHITE : TC_BLACK);
 
								DrawString(time_left, time_right, y, STR_GREEN_STRING, i == selected ? TC_WHITE : TC_BLACK);
 
							} else {
 
								SetArrivalDepartParams(0, 1, arr_dep[i / 2].arrival + offset);
 
								DrawString(time_left, time_right, y, show_late ? STR_RED_STRING : STR_JUST_STRING, i == selected ? TC_WHITE : TC_BLACK);
 
							}
 
						}
 
					} else {
 
						if (arr_dep[i / 2].departure != INVALID_TICKS) {
 
							DrawString(abbr_left, abbr_right, y, STR_TIMETABLE_DEPARTURE_ABBREVIATION, i == selected ? TC_WHITE : TC_BLACK);
 
							SetArrivalDepartParams(0, 1, arr_dep[i/2].departure + offset);
 
							DrawString(time_left, time_right, y, show_late ? STR_RED_STRING : STR_JUST_STRING, i == selected ? TC_WHITE : TC_BLACK);
 
						}
 
					}
 
					y += FONT_HEIGHT_NORMAL;
 
				}
 
			} break;
 

	
 
			case TTV_SUMMARY_PANEL: {
 
				int y = r.top + WD_FRAMERECT_TOP;
 

	
 
				Ticks total_time = v->orders.list != NULL ? v->orders.list->GetTimetableDurationIncomplete() : 0;
 
				if (total_time != 0) {
 
					SetTimetableParams(0, 1, total_time);
 
					DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, v->orders.list->IsCompleteTimetable() ? STR_TIMETABLE_TOTAL_TIME : STR_TIMETABLE_TOTAL_TIME_INCOMPLETE);
 
				}
0 comments (0 inline, 0 general)