4 * This file is part of OpenTTD.
5 * 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.
6 * 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.
7 * 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/>.
10 /** @file news_func.h Functions related to news. */
15 #include "news_type.h"
16 #include "vehicle_type.h"
17 #include "station_type.h"
18 #include "industry_type.h"
20 void InsertNewsItem (NewsItem
*ni
);
22 template <class T
, typename T1
>
23 void AddNewsItem (T1 t1
)
25 if (_game_mode
== GM_MENU
) return;
26 InsertNewsItem (new T (t1
));
29 template <class T
, typename T1
, typename T2
>
30 void AddNewsItem (T1 t1
, T2 t2
)
32 if (_game_mode
== GM_MENU
) return;
33 InsertNewsItem (new T (t1
, t2
));
36 template <class T
, typename T1
, typename T2
, typename T3
>
37 void AddNewsItem (T1 t1
, T2 t2
, T3 t3
)
39 if (_game_mode
== GM_MENU
) return;
40 InsertNewsItem (new T (t1
, t2
, t3
));
43 template <class T
, typename T1
, typename T2
, typename T3
, typename T4
>
44 void AddNewsItem (T1 t1
, T2 t2
, T3 t3
, T4 t4
)
46 if (_game_mode
== GM_MENU
) return;
47 InsertNewsItem (new T (t1
, t2
, t3
, t4
));
50 template <class T
, typename T1
, typename T2
, typename T3
, typename T4
, typename T5
>
51 void AddNewsItem (T1 t1
, T2 t2
, T3 t3
, T4 t4
, T5 t5
)
53 if (_game_mode
== GM_MENU
) return;
54 InsertNewsItem (new T (t1
, t2
, t3
, t4
, t5
));
57 template <class T
, typename T1
, typename T2
, typename T3
, typename T4
, typename T5
, typename T6
>
58 void AddNewsItem (T1 t1
, T2 t2
, T3 t3
, T4 t4
, T5 t5
, T6 t6
)
60 if (_game_mode
== GM_MENU
) return;
61 InsertNewsItem (new T (t1
, t2
, t3
, t4
, t5
, t6
));
65 void InitNewsItemStructs();
67 extern const NewsItem
*_statusbar_news_item
;
69 void DeleteInvalidEngineNews();
70 void DeleteVehicleNews(VehicleID vid
, StringID news
);
71 void DeleteStationNews(StationID sid
);
72 void DeleteIndustryNews(IndustryID iid
);
74 #endif /* NEWS_FUNC_H */