MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / ShowRejectOrAcceptNews

Function ShowRejectOrAcceptNews

src/station_cmd.cpp:520–524  ·  view source on GitHub ↗

* Add news item for when a station changes which cargoes it accepts. * @param st Station of cargo change. * @param cargoes Bit mask of cargo types to list. * @param reject True iff the station rejects the cargo types. */

Source from the content-addressed store, hash-verified

518 * @param reject True iff the station rejects the cargo types.
519 */
520static void ShowRejectOrAcceptNews(const Station *st, CargoTypes cargoes, bool reject)
521{
522 StringID msg = reject ? STR_NEWS_STATION_NO_LONGER_ACCEPTS_CARGO_LIST : STR_NEWS_STATION_NOW_ACCEPTS_CARGO_LIST;
523 AddNewsItem(GetEncodedString(msg, st->index, cargoes), NewsType::Acceptance, NewsStyle::Small, NewsFlag::InColour, st->index);
524}
525
526/**
527 * Get the cargo types being produced around the tile (in a rectangle).

Callers 1

UpdateStationAcceptanceFunction · 0.85

Calls 2

AddNewsItemFunction · 0.85
GetEncodedStringFunction · 0.70

Tested by

no test coverage detected