# news_func.h

Go to the documentation of this file.

    00001 /* $Id$ */
    00002
    00003 /*
    00004  * This file is part of OpenTTD.
    00005  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
    00006  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    00007  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
    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 /* NEWS_FUNC_H */