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, NewsType type, NewsFlag flags, 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, CompanyNewsInformation *cni)
00023 {
00024 AddNewsItem(string, NT_COMPANY_INFO, NF_COMPANY, NR_NONE, UINT32_MAX, NR_NONE, UINT32_MAX, cni);
00025 }
00026
00032 static inline void AddVehicleNewsItem(StringID string, NewsType type, VehicleID vehicle, StationID station = INVALID_STATION)
00033 {
00034 AddNewsItem(string, type, NF_NO_TRANSPARENT | NF_SHADE | NF_THIN, NR_VEHICLE, vehicle, station == INVALID_STATION ? NR_NONE : NR_STATION, station);
00035 }
00036
00042 static inline void AddVehicleAdviceNewsItem(StringID string, VehicleID vehicle)
00043 {
00044 AddNewsItem(string, NT_ADVICE, NF_INCOLOUR | NF_SMALL | NF_VEHICLE_PARAM0, NR_VEHICLE, vehicle);
00045 }
00046
00047 static inline void AddTileNewsItem(StringID string, NewsType type, TileIndex tile, void *free_data = NULL)
00048 {
00049 AddNewsItem(string, type, NF_NO_TRANSPARENT | NF_SHADE | NF_THIN, NR_TILE, tile, NR_NONE, UINT32_MAX, free_data);
00050 }
00051
00052 static inline void AddIndustryNewsItem(StringID string, NewsType type, IndustryID industry)
00053 {
00054 AddNewsItem(string, type, NF_NO_TRANSPARENT | NF_SHADE | NF_THIN, NR_INDUSTRY, industry);
00055 }
00056
00057 void NewsLoop();
00058 void InitNewsItemStructs();
00059
00060 extern const NewsItem *_statusbar_news_item;
00061 extern bool _news_ticker_sound;
00062
00063 extern NewsTypeData _news_type_data[];
00064
00065 void DeleteInvalidEngineNews();
00066 void DeleteVehicleNews(VehicleID vid, StringID news);
00067 void DeleteStationNews(StationID sid);
00068 void DeleteIndustryNews(IndustryID iid);
00069
00070 #endif