(svn r18304) -Codechange: don't use SETX for the arrival/departure panel; some languages don't have short abbreviations :(

This commit is contained in:
rubidium 2009-11-27 15:16:58 +00:00
parent efffb1b92c
commit 5dc2e2831d
11 changed files with 23 additions and 80 deletions

View File

@ -3162,15 +3162,9 @@ STR_TIMETABLE_SCHEDULED :{BLACK}Schema
STR_TIMETABLE_EXPECTED_TOOLTIP :{BLACK}Wissel tussen verwacht and schema
### Do not separate or reorder ###
STR_TIMETABLE_ARRIVAL :A:{SETX 30}{STRING}
STR_TIMETABLE_ARRIVAL_EARLY :A:{SETX 30}{GREEN}{STRING}
STR_TIMETABLE_ARRIVAL_LATE :A:{SETX 30}{RED}{STRING}
#####
### Do not separate or reorder ###
STR_TIMETABLE_DEPARTURE :D:{SETX 30}{STRING}
STR_TIMETABLE_DEPARTURE_EARLY :D:{SETX 30}{GREEN}{STRING}
STR_TIMETABLE_DEPARTURE_LATE :D:{SETX 30}{RED}{STRING}
#####

View File

@ -3161,17 +3161,8 @@ STR_TIMETABLE_EXPECTED :{BLACK}Expected
STR_TIMETABLE_SCHEDULED :{BLACK}Scheduled
STR_TIMETABLE_EXPECTED_TOOLTIP :{BLACK}Switch between expected and schedule
### Do not separate or reorder ###
STR_TIMETABLE_ARRIVAL :A:{SETX 30}{STRING1}
STR_TIMETABLE_ARRIVAL_EARLY :A:{SETX 30}{GREEN}{STRING1}
STR_TIMETABLE_ARRIVAL_LATE :A:{SETX 30}{RED}{STRING1}
#####
### Do not separate or reorder ###
STR_TIMETABLE_DEPARTURE :D:{SETX 30}{STRING1}
STR_TIMETABLE_DEPARTURE_EARLY :D:{SETX 30}{GREEN}{STRING1}
STR_TIMETABLE_DEPARTURE_LATE :D:{SETX 30}{RED}{STRING1}
#####
STR_TIMETABLE_ARRIVAL_ABBREVIATION :A:
STR_TIMETABLE_DEPARTURE_ABBREVIATION :D:
# Date window (for timetable)
@ -4047,6 +4038,8 @@ STR_WHITE_SIGN :{WHITE}{SIGN}
STR_TINY_BLACK_STATION :{TINYFONT}{BLACK}{STATION}
STR_BLACK_STRING :{BLACK}{STRING}
STR_BLACK_RAW_STRING :{BLACK}{RAW_STRING}
STR_GREEN_STRING :{GREEN}{STRING}
STR_RED_STRING :{RED}{STRING}
STR_WHITE_STRING :{WHITE}{STRING}
STR_TINY_BLACK_VEHICLE :{TINYFONT}{BLACK}{VEHICLE}
STR_TINY_RIGHT_ARROW :{TINYFONT}{RIGHTARROW}

View File

@ -3162,15 +3162,9 @@ STR_TIMETABLE_SCHEDULED :{BLACK}Aikataul
STR_TIMETABLE_EXPECTED_TOOLTIP :{BLACK}Vaihda odotetun ja aikataulun välillä
### Do not separate or reorder ###
STR_TIMETABLE_ARRIVAL :S:{SETX 30}{STRING}
STR_TIMETABLE_ARRIVAL_EARLY :S:{SETX 30}{GREEN}{STRING}
STR_TIMETABLE_ARRIVAL_LATE :S:{SETX 30}{RED}{STRING}
#####
### Do not separate or reorder ###
STR_TIMETABLE_DEPARTURE :L:{SETX 30}{STRING}
STR_TIMETABLE_DEPARTURE_EARLY :L:{SETX 30}{GREEN}{STRING}
STR_TIMETABLE_DEPARTURE_LATE :L:{SETX 30}{RED}{STRING}
#####

View File

@ -3163,15 +3163,9 @@ STR_TIMETABLE_SCHEDULED :{BLACK}Geplant
STR_TIMETABLE_EXPECTED_TOOLTIP :{BLACK}Umschalten zwischen erwarteter Ankunftszeit und Fahrplan
### Do not separate or reorder ###
STR_TIMETABLE_ARRIVAL :Ankunft:{SETX 30}{STRING}
STR_TIMETABLE_ARRIVAL_EARLY :Ankunft:{SETX 30}{GREEN}{STRING}
STR_TIMETABLE_ARRIVAL_LATE :Ankunft:{SETX 30}{RED}{STRING}
#####
### Do not separate or reorder ###
STR_TIMETABLE_DEPARTURE :Abfahrt:{SETX 30}{STRING}
STR_TIMETABLE_DEPARTURE_EARLY :Abfahrt:{SETX 30}{GREEN}{STRING}
STR_TIMETABLE_DEPARTURE_LATE :Abfahrt:{SETX 30}{RED}{STRING}
#####

View File

@ -3259,15 +3259,9 @@ STR_TIMETABLE_SCHEDULED :{BLACK}Προγ
STR_TIMETABLE_EXPECTED_TOOLTIP :{BLACK}Εναλλάγη μεταξύ αναμένομενης και προγραμματισμένης
### Do not separate or reorder ###
STR_TIMETABLE_ARRIVAL :ΑΦΙΞ:{SETX 30}{STRING}
STR_TIMETABLE_ARRIVAL_EARLY :ΑΦΙΞ:{SETX 30}{GREEN}{STRING}
STR_TIMETABLE_ARRIVAL_LATE :ΑΦΙΞ:{SETX 30}{RED}{STRING}
#####
### Do not separate or reorder ###
STR_TIMETABLE_DEPARTURE :ΑΝΑΧ:{SETX 30}{STRING}
STR_TIMETABLE_DEPARTURE_EARLY :ΑΝΑΧ:{SETX 30}{GREEN}{STRING}
STR_TIMETABLE_DEPARTURE_LATE :ΑΝΑΧ:{SETX 30}{RED}{STRING}
#####

View File

@ -3160,15 +3160,9 @@ STR_TIMETABLE_SCHEDULED :{BLACK}Programm
STR_TIMETABLE_EXPECTED_TOOLTIP :{BLACK}Alterna fra la visualizzazione degli orari attesi e degli orari programmati
### Do not separate or reorder ###
STR_TIMETABLE_ARRIVAL :A:{SETX 30}{STRING}
STR_TIMETABLE_ARRIVAL_EARLY :A:{SETX 30}{GREEN}{STRING}
STR_TIMETABLE_ARRIVAL_LATE :A:{SETX 30}{RED}{STRING}
#####
### Do not separate or reorder ###
STR_TIMETABLE_DEPARTURE :P:{SETX 30}{STRING}
STR_TIMETABLE_DEPARTURE_EARLY :P:{SETX 30}{GREEN}{STRING}
STR_TIMETABLE_DEPARTURE_LATE :P:{SETX 30}{RED}{STRING}
#####

View File

@ -3543,15 +3543,9 @@ STR_TIMETABLE_SCHEDULED :{BLACK}Schedule
STR_TIMETABLE_EXPECTED_TOOLTIP :{BLACK}Switch between expected and schedule
### Do not separate or reorder ###
STR_TIMETABLE_ARRIVAL :A:{SETX 30}{STRING}
STR_TIMETABLE_ARRIVAL_EARLY :A:{SETX 30}{GREEN}{STRING}
STR_TIMETABLE_ARRIVAL_LATE :A:{SETX 30}{RED}{STRING}
#####
### Do not separate or reorder ###
STR_TIMETABLE_DEPARTURE :D:{SETX 30}{STRING}
STR_TIMETABLE_DEPARTURE_EARLY :D:{SETX 30}{GREEN}{STRING}
STR_TIMETABLE_DEPARTURE_LATE :D:{SETX 30}{RED}{STRING}
#####
# AI debug window

View File

@ -3161,15 +3161,9 @@ STR_TIMETABLE_SCHEDULED :{BLACK}Marcado
STR_TIMETABLE_EXPECTED_TOOLTIP :{BLACK}Alterne entre tempo esperado e marcado
### Do not separate or reorder ###
STR_TIMETABLE_ARRIVAL :C:{SETX 30}{STRING}
STR_TIMETABLE_ARRIVAL_EARLY :C:{SETX 30}{GREEN}{STRING}
STR_TIMETABLE_ARRIVAL_LATE :C:{SETX 30}{RED}{STRING}
#####
### Do not separate or reorder ###
STR_TIMETABLE_DEPARTURE :P:{SETX 30}{STRING}
STR_TIMETABLE_DEPARTURE_EARLY :P:{SETX 30}{GREEN}{STRING}
STR_TIMETABLE_DEPARTURE_LATE :P:{SETX 30}{RED}{STRING}
#####

View File

@ -3357,15 +3357,9 @@ STR_TIMETABLE_SCHEDULED :{BLACK}Po planu
STR_TIMETABLE_EXPECTED_TOOLTIP :{BLACK}Prebacivanje između prikaza očekivanog i po planu
### Do not separate or reorder ###
STR_TIMETABLE_ARRIVAL :D:{SETX 30}{STRING}
STR_TIMETABLE_ARRIVAL_EARLY :D:{SETX 30}{GREEN}{STRING}
STR_TIMETABLE_ARRIVAL_LATE :D:{SETX 30}{RED}{STRING}
#####
### Do not separate or reorder ###
STR_TIMETABLE_DEPARTURE :P:{SETX 30}{STRING}
STR_TIMETABLE_DEPARTURE_EARLY :P:{SETX 30}{GREEN}{STRING}
STR_TIMETABLE_DEPARTURE_LATE :P:{SETX 30}{RED}{STRING}
#####

View File

@ -3159,15 +3159,9 @@ STR_TIMETABLE_SCHEDULED :{BLACK}Programa
STR_TIMETABLE_EXPECTED_TOOLTIP :{BLACK}Alternar entre esperado y programado
### Do not separate or reorder ###
STR_TIMETABLE_ARRIVAL :Ll:{SETX 30}{STRING}
STR_TIMETABLE_ARRIVAL_EARLY :Ll:{SETX 30}{GREEN}{STRING}
STR_TIMETABLE_ARRIVAL_LATE :Ll:{SETX 30}{RED}{STRING}
#####
### Do not separate or reorder ###
STR_TIMETABLE_DEPARTURE :S:{SETX 30}{STRING}
STR_TIMETABLE_DEPARTURE_EARLY :S:{SETX 30}{GREEN}{STRING}
STR_TIMETABLE_DEPARTURE_LATE :S:{SETX 30}{RED}{STRING}
#####

View File

@ -170,6 +170,8 @@ struct TimetableWindow : Window {
int sel_index;
const Vehicle *vehicle; ///< Vehicle monitored by the window.
bool show_expected; ///< Whether we show expected arrival or scheduled
uint deparr_time_width; ///< The width of the departure/arrival time
uint deparr_abbr_width; ///< The width of the departure/arrival abbreviation
TimetableWindow(const WindowDesc *desc, WindowNumber window_number) :
Window(),
@ -206,9 +208,10 @@ struct TimetableWindow : Window {
{
switch (widget) {
case TTV_ARRIVAL_DEPARTURE_PANEL:
SetDParam(0, STR_JUST_DATE_TINY);
SetDParam(1, MAX_YEAR * DAYS_IN_YEAR);
size->width = GetStringBoundingBox(STR_TIMETABLE_ARRIVAL).width + WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT;
SetDParam(0, MAX_YEAR * DAYS_IN_YEAR);
this->deparr_time_width = GetStringBoundingBox(STR_JUST_DATE_TINY).width;
this->deparr_abbr_width = max(GetStringBoundingBox(STR_TIMETABLE_ARRIVAL_ABBREVIATION).width, GetStringBoundingBox(STR_TIMETABLE_DEPARTURE_ABBREVIATION).width);
this->width = WD_FRAMERECT_LEFT + this->deparr_abbr_width + 10 + this->deparr_time_width + WD_FRAMERECT_RIGHT;
/* fall through */
case TTV_ARRIVAL_DEPARTURE_SELECTION:
case TTV_TIMETABLE_PANEL:
@ -410,15 +413,14 @@ struct TimetableWindow : Window {
int y = r.top + WD_FRAMERECT_TOP;
Ticks offset;
StringID str_offset;
if (this->show_expected && v->lateness_counter > DAY_TICKS) {
offset = 0;
str_offset = STR_TIMETABLE_ARRIVAL_LATE - STR_TIMETABLE_ARRIVAL;
} else {
offset = -v->lateness_counter;
str_offset = 0;
}
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. */
@ -426,18 +428,20 @@ struct TimetableWindow : Window {
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_TIMETABLE_ARRIVAL_EARLY, i == selected ? TC_WHITE : TC_BLACK);
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_GREEN_STRING, i == selected ? TC_WHITE : TC_BLACK);
} else {
SetArrivalDepartParams(0, 1, arr_dep[i / 2].arrival + offset);
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_TIMETABLE_ARRIVAL + str_offset, i == selected ? TC_WHITE : TC_BLACK);
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(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_TIMETABLE_DEPARTURE + str_offset, i == selected ? TC_WHITE : TC_BLACK);
DrawString(time_left, time_right, y, show_late ? STR_RED_STRING : STR_JUST_STRING, i == selected ? TC_WHITE : TC_BLACK);
}
}
y += FONT_HEIGHT_NORMAL;