diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index ecf9147a99..fabd03e7d5 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -422,6 +422,7 @@ public: /* strings such as 'Size' and 'Coverage Area' */ top = DrawStationCoverageAreaText(panel_nwi->pos_x + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top, SCT_ALL, rad, false) + WD_PAR_VSEP_NORMAL; top = DrawStationCoverageAreaText(panel_nwi->pos_x + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top, SCT_ALL, rad, true) + WD_PAR_VSEP_NORMAL; + top = DrawStationAuthorityText(panel_nwi->pos_x + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top) + WD_PAR_VSEP_NORMAL; } /* Resize background if the window is too small. diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index 314d576036..b8d571bfcf 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -434,6 +434,7 @@ public: int bottom = back_nwi->pos_y + back_nwi->current_y; top = DrawStationCoverageAreaText(back_nwi->pos_x + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top, SCT_ALL, rad, false) + WD_PAR_VSEP_NORMAL; top = DrawStationCoverageAreaText(back_nwi->pos_x + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top, SCT_ALL, rad, true) + WD_PAR_VSEP_NORMAL; + top = DrawStationAuthorityText(back_nwi->pos_x + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top) + WD_PAR_VSEP_NORMAL; /* Resize background if the window is too small. * Never make the window smaller to avoid oscillating if the size change affects the acceptance. * (This is the case, if making the window bigger moves the mouse into the window.) */ diff --git a/src/lang/english.txt b/src/lang/english.txt index 743706638f..cadaf819a0 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -5489,3 +5489,7 @@ STR_STATION_RATING_TOOLTIP_STATUE_YES :{GREEN}yes, +10 STR_IGNORE_VERSION_CHECK_WARNING : WARNING! You're about to join server running a different version of the game! STR_IGNORE_VERSION_CHECK_WARNING_DETAILS : OpenTTD was never indended to work in such way. If you're lucky you may be able to play it but most likely something is going to break sooner or later. Desyncs or crashes are to be expected. So proceed at your own risk and don't report any errors you encounter there. +STR_CM_STATION_BUILD_TOWN :{BLACK}Town: {GOLD}{TOWN} +STR_CM_STATION_BUILD_TOWN_LARGE :{BLACK}Town: {GOLD}{TOWN} (L) +STR_CM_STATION_BUILD_TOWN_MEDIUM :{BLACK}Town: {GOLD}{TOWN} (M) +STR_CM_STATION_BUILD_TOWN_SMALL :{BLACK}Town: {GOLD}{TOWN} (S) diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 4d9f6ab890..14df22763d 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -1238,6 +1238,7 @@ public: int bottom = cov->pos_y + cov->current_y; top = DrawStationCoverageAreaText(left, right, top, SCT_ALL, rad, false) + WD_PAR_VSEP_NORMAL; top = DrawStationCoverageAreaText(left, right, top, SCT_ALL, rad, true) + WD_PAR_VSEP_NORMAL; + top = DrawStationAuthorityText(left, right, top) + WD_PAR_VSEP_NORMAL; /* Resize background if the window is too small. * Never make the window smaller to avoid oscillating if the size change affects the acceptance. * (This is the case, if making the window bigger moves the mouse into the window.) */ diff --git a/src/road_gui.cpp b/src/road_gui.cpp index fbdd56947d..4f6e07f50c 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -1262,6 +1262,7 @@ struct BuildRoadStationWindow : public PickerWindowBase { int bottom = back_nwi->pos_y + back_nwi->current_y; top = DrawStationCoverageAreaText(back_nwi->pos_x + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top, sct, rad, false) + WD_PAR_VSEP_NORMAL; top = DrawStationCoverageAreaText(back_nwi->pos_x + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top, sct, rad, true) + WD_PAR_VSEP_NORMAL; + top = DrawStationAuthorityText(back_nwi->pos_x + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top) + WD_PAR_VSEP_NORMAL; /* Resize background if the window is too small. * Never make the window smaller to avoid oscillating if the size change affects the acceptance. * (This is the case, if making the window bigger moves the mouse into the window.) */ diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 4101f822a4..ca21f13501 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -80,6 +80,23 @@ int DrawStationCoverageAreaText(int left, int right, int top, StationCoverageTyp return DrawStringMultiLine(left, right, top, INT32_MAX, supplies ? STR_STATION_BUILD_SUPPLIES_CARGO : STR_STATION_BUILD_ACCEPTS_CARGO); } +int DrawStationAuthorityText(int left, int right, int top) { + TileIndex tile = TileVirtXY(_thd.pos.x, _thd.pos.y); + Town *town = ClosestTownFromTile(tile, UINT_MAX); + auto dist = DistanceManhattan(town->xy, tile); + + SetDParam(0, town ? town->index : INVALID_TOWN); + if (dist <= 10) { + return DrawStringMultiLine(left, right, top, INT32_MAX, STR_CM_STATION_BUILD_TOWN_SMALL); + } else if (dist <= 15) { + return DrawStringMultiLine(left, right, top, INT32_MAX, STR_CM_STATION_BUILD_TOWN_MEDIUM); + } else if (dist <= 20) { + return DrawStringMultiLine(left, right, top, INT32_MAX, STR_CM_STATION_BUILD_TOWN_LARGE); + } else { + return DrawStringMultiLine(left, right, top, INT32_MAX, STR_CM_STATION_BUILD_TOWN); + } +} + /** * Find stations adjacent to the current tile highlight area, so that existing coverage * area can be drawn. diff --git a/src/station_gui.h b/src/station_gui.h index 6640856246..d23ae12be0 100644 --- a/src/station_gui.h +++ b/src/station_gui.h @@ -25,6 +25,7 @@ enum StationCoverageType { }; int DrawStationCoverageAreaText(int left, int right, int top, StationCoverageType sct, int rad, bool supplies); +int DrawStationAuthorityText(int left, int right, int top); void CheckRedrawStationCoverage(const Window *w); void ShowSelectStationIfNeeded(const CommandContainer &cmd, TileArea ta);