* Add station strings to a viewport. * @param dpi Current viewport area. * @param stations List of stations to add. * @param small Add small versions of strings. */
| 1423 | * @param small Add small versions of strings. |
| 1424 | */ |
| 1425 | static void ViewportAddStationStrings(DrawPixelInfo *dpi, const std::vector<const BaseStation *> &stations, bool small) |
| 1426 | { |
| 1427 | /* Transparent station signs have colour text instead of a colour panel. */ |
| 1428 | ViewportStringFlags flags{IsTransparencySet(TO_SIGNS) ? ViewportStringFlag::TextColour : ViewportStringFlag::ColourRect}; |
| 1429 | if (small) flags.Set(ViewportStringFlag::Small); |
| 1430 | |
| 1431 | for (const BaseStation *st : stations) { |
| 1432 | std::string *str = ViewportAddString(dpi, &st->sign, flags, (st->owner == OWNER_NONE || !st->IsInUse()) ? COLOUR_GREY : _company_colours[st->owner]); |
| 1433 | if (str == nullptr) continue; |
| 1434 | |
| 1435 | if (Station::IsExpected(st)) { /* Station */ |
| 1436 | *str = GetString(small ? STR_STATION_NAME : STR_VIEWPORT_STATION, st->index, st->facilities); |
| 1437 | } else { /* Waypoint */ |
| 1438 | *str = GetString(STR_WAYPOINT_NAME, st->index); |
| 1439 | } |
| 1440 | } |
| 1441 | } |
| 1442 | |
| 1443 | static void ViewportAddKdtreeSigns(DrawPixelInfo *dpi) |
| 1444 | { |
no test coverage detected