# news_func.h File Reference

Functions related to news. More...

`#include "news_type.h"`
`#include "vehicle_type.h"`
`#include "station_type.h"`

Go to the source code of this file.

## Functions
void | AddNewsItem (StringID string, NewsSubtype subtype, uint data_a, uint data_b, void *free_data=NULL)
| Add a new newsitem to be shown.
void | NewsLoop ()
void | InitNewsItemStructs ()
| Initialize the news-items data structures.
void | DeleteVehicleNews (VehicleID, StringID news)
| Delete a news item type about a vehicle if the news item type is INVALID_STRING_ID all news about the vehicle get deleted.
void | DeleteStationNews (StationID)
| Delete news associated with given station.
## Variables
NewsItem | _statusbar_news_item
bool | _news_ticker_sound
NewsTypeData | _news_type_data [NT_END]
| Per-NewsType data.

## Detailed Description

Functions related to news.

Definition in file news_func.h.

## Function Documentation

void AddNewsItem | ( | StringID | string,
|  | NewsSubtype | subtype,
|  | uint | data_a,
|  | uint | data_b,
|  | void * | free_data |
| ) |  |  |

Add a new newsitem to be shown.

Parameters:

  | string | String to display
  | subtype | news category, any of the NewsSubtype enums (NS_)
  | data_a | news-specific value based on news type
  | data_b | news-specific value based on news type

See also:
  NewsSubype

Definition at line 489 of file news_gui.cpp.

References _cur_year, _date, _latest_news, _oldest_news, _settings_client, _total_news, GUISettings::coloured_news_year, NewsSubtypeData::flags, ClientSettings::gui, InvalidateWindow(), lengthof, and NF_INCOLOUR.

Referenced by AircraftEntersTerminal(), ChangeIndustryProduction(), CheckOrders(), CheckSwitchToEuro(), CheckTrainCollision(), CmdBuildIndustry(), CmdCompanyCtrl(), DeliverGoodsToIndustry(), Disaster_CoalMine_Init(), DisasterTick_Airplane(), DisasterTick_Big_Ufo(), DisasterTick_Helicopter(), DisasterTick_Ufo(), DisasterTick_Zeppeliner(), MaybeNewIndustry(), ReportNewsProductionChangeIndustry(), and ShowRejectOrAcceptNews().

void DeleteStationNews | ( | StationID | sid | ) |

Delete news associated with given station.

Delete news associated with given station.

Parameters:

  | sid | station to remove news about

Definition at line 581 of file news_gui.cpp.

References _oldest_news, DeleteNewsItem(), NS_ACCEPTANCE, NS_ARRIVAL_COMPANY, and NS_ARRIVAL_OTHER.

Referenced by Station::~Station().