|
@@ -322,6 +322,13 @@ protected:
|
|
|
return minr1 > minr2;
|
|
|
}
|
|
|
|
|
|
/** Sort stations by their dilapidation */
|
|
|
static bool StationDilapidationSorter(const Station* const& a, const Station* const& b)
|
|
|
{
|
|
|
if (a->dilapidation == b->dilapidation) return StationNameSorter(a, b); // fallback
|
|
|
return a->dilapidation < b->dilapidation;
|
|
|
}
|
|
|
|
|
|
/** Sort the stations list */
|
|
|
void SortStationsList()
|
|
|
{
|
|
@@ -460,7 +467,17 @@ public:
|
|
|
|
|
|
SetDParam(0, st->index);
|
|
|
SetDParam(1, st->facilities);
|
|
|
int x = DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y + (line_height - FONT_HEIGHT_NORMAL) / 2, STR_STATION_LIST_STATION);
|
|
|
int x;
|
|
|
|
|
|
if (_settings_game.economy.dilapidation_max_amount > 0 && st->dilapidation > 0)
|
|
|
{
|
|
|
SetDParam(2, st->dilapidation);
|
|
|
x = DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y + (line_height - FONT_HEIGHT_NORMAL) / 2, STR_STATION_LIST_STATION_WITH_DILAPIDATION);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
x = DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y + (line_height - FONT_HEIGHT_NORMAL) / 2, STR_STATION_LIST_STATION);
|
|
|
}
|
|
|
x += rtl ? -text_spacing : text_spacing;
|
|
|
|
|
|
/* show cargo waiting and station ratings */
|
|
@@ -699,7 +716,8 @@ GUIStationList::SortFunction * const Com
|
|
|
&StationWaitingTotalSorter,
|
|
|
&StationWaitingAvailableSorter,
|
|
|
&StationRatingMaxSorter,
|
|
|
&StationRatingMinSorter
|
|
|
&StationRatingMinSorter,
|
|
|
&StationDilapidationSorter
|
|
|
};
|
|
|
|
|
|
/* Names of the sorting functions */
|
|
@@ -710,6 +728,7 @@ const StringID CompanyStationsWindow::so
|
|
|
STR_SORT_BY_WAITING_AVAILABLE,
|
|
|
STR_SORT_BY_RATING_MAX,
|
|
|
STR_SORT_BY_RATING_MIN,
|
|
|
STR_SORT_BY_DILAPIDATION,
|
|
|
INVALID_STRING_ID
|
|
|
};
|
|
|
|
|
@@ -1854,6 +1873,13 @@ struct StationViewWindow : public Window
|
|
|
y += WD_PAR_VSEP_WIDE;
|
|
|
}
|
|
|
|
|
|
if (_settings_game.economy.dilapidation_max_amount > 0) {
|
|
|
SetDParam(0, st->dilapidation);
|
|
|
SetDParam(1, _settings_game.economy.dilapidation_max_amount);
|
|
|
y = DrawStringMultiLine(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, r.bottom, STR_STATION_VIEW_DILAPIDATION);
|
|
|
y += WD_PAR_VSEP_WIDE;
|
|
|
}
|
|
|
|
|
|
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_STATION_VIEW_SUPPLY_RATINGS_TITLE);
|
|
|
y += FONT_HEIGHT_NORMAL;
|
|
|
|