Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00012 #ifndef NEWS_FUNC_H
00013 #define NEWS_FUNC_H
00014
00015 #include "news_type.h"
00016 #include "vehicle_type.h"
00017 #include "station_type.h"
00018 #include "industry_type.h"
00019
00020 void AddNewsItem(StringID string, NewsSubtype subtype, NewsReferenceType reftype1 = NR_NONE, uint32 ref1 = UINT32_MAX, NewsReferenceType reftype2 = NR_NONE, uint32 ref2 = UINT32_MAX, void *free_data = NULL);
00021
00022 static inline void AddCompanyNewsItem(StringID string, NewsSubtype subtype, CompanyNewsInformation *cni)
00023 {
00024 AddNewsItem(string, subtype, NR_NONE, UINT32_MAX, NR_NONE, UINT32_MAX, cni);
00025 }
00026
00036 static inline void AddVehicleNewsItem(StringID string, NewsSubtype subtype, VehicleID vehicle, StationID station = INVALID_STATION)
00037 {
00038 AddNewsItem(string, subtype, NR_VEHICLE, vehicle, station == INVALID_STATION ? NR_NONE : NR_STATION, station);
00039 }
00040
00041 static inline void AddIndustryNewsItem(StringID string, NewsSubtype subtype, IndustryID industry)
00042 {
00043 AddNewsItem(string, subtype, NR_INDUSTRY, industry);
00044 }
00045
00046 void NewsLoop();
00047 void InitNewsItemStructs();
00048
00049 extern const NewsItem *_statusbar_news_item;
00050 extern bool _news_ticker_sound;
00051
00052 extern NewsTypeData _news_type_data[];
00053
00054 void DeleteInvalidEngineNews();
00055 void DeleteVehicleNews(VehicleID vid, StringID news);
00056 void DeleteStationNews(StationID sid);
00057 void DeleteIndustryNews(IndustryID iid);
00058
00059 #endif