Go to the documentation of this file.
1 /* $Id: news_type.h 24843 2012-12-23 21:07:12Z frosch $ */
3 /*
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 <>.
8  */
12 #ifndef NEWS_TYPE_H
13 #define NEWS_TYPE_H
15 #include "core/enum_type.hpp"
16 #include "date_type.h"
17 #include "strings_type.h"
18 #include "sound_type.h"
31 };
36 enum NewsType {
53 };
72 };
78 enum NewsFlag {
81  NFB_SHADE = 2,
96 };
107 };
112 struct NewsTypeData {
113  const char * const name;
114  const byte age;
115  const SoundFx sound;
123  NewsTypeData(const char *name, byte age, SoundFx sound) :
124  name(name),
125  age(age),
126  sound(sound)
127  {
128  }
130  NewsDisplay GetDisplay() const;
131 };
134 struct NewsItem {
144  uint32 ref1;
145  uint32 ref2;
147  void *free_data;
149  ~NewsItem()
150  {
151  free(this->free_data);
152  }
154  uint64 params[10];
155 };
164  char company_name[64];
165  char president_name[64];
166  char other_company_name[64];
168  uint32 face;
169  byte colour;
171  void FillData(const struct Company *c, const struct Company *other = NULL);
172 };
174 #endif /* NEWS_TYPE_H */
Closing of industries.
Definition: news_type.h:42
DECLARE_ENUM_AS_BIT_SET(GenderEthnicity) enum CompanyManagerFaceVariable
Bitgroups of the CompanyManagerFace variable.
First vehicle arrived for competitor.
Definition: news_type.h:38
News about subsidies (announcements, expirations, acceptance)
Definition: news_type.h:50
Thin news item. (Newspaper with headline and viewport)
Definition: news_type.h:91
Show newspaper.
Definition: news_type.h:106
Reference station. Scroll to station when clicking on the news. Delete news when station is deleted...
Definition: news_type.h:68
end-of-array marker
Definition: news_type.h:52
Additional space in the button with the option value (for better looks).
Definition: news_type.h:27
Number of pixels between the buttons and the description columns.
Definition: news_type.h:25
NewsReferenceType reftype2
Type of ref2.
Definition: news_type.h:143
const char *const name
Definition: news_type.h:113
Bits of news about vehicles of the company.
Definition: news_type.h:47
Number of pixels between right edge of the window and the options descriptions column.
Definition: news_type.h:26
Other industry production changes.
Definition: news_type.h:46
NewsTypeData(const char *name, byte age, SoundFx sound)
Construct this entry.
Definition: news_type.h:123
First bit for window layout.
Definition: news_type.h:82
New vehicle has become available.
Definition: news_type.h:48
Opening of industries.
Definition: news_type.h:41
Data that needs to be stored for company news messages.
Definition: news_type.h:163
NewsReferenceType reftype1
Type of ref1.
Definition: news_type.h:142
Per-NewsType data.
Definition: news_type.h:112
Type (helpers) for enums.
Bit value for specifying that string param 0 contains a vehicle ID. (special autoreplace behaviour) ...
Definition: news_type.h:89
void * free_data
Data to be freed when the news item has reached its end.
Definition: news_type.h:147
Date date
Date of the news.
Definition: news_type.h:138
Only show a reminder in the status bar.
Definition: news_type.h:104
StringID string_id
Message text.
Definition: news_type.h:137
uint32 ref1
Reference 1 to some object: Used for a possible viewport, scrolling after clicking on the news...
Definition: news_type.h:144
Number of pixels between left edge of the window and the options buttons column.
Definition: news_type.h:24
News display options.
Definition: news_type.h:103
General news (from towns)
Definition: news_type.h:51
Bit value for disabling transparency.
Definition: news_type.h:87
Various OR-able news-item flags.
Definition: news_type.h:78
Reference tile. Scroll to tile when clicking on the news.
Definition: news_type.h:66
Empty reference.
Definition: news_type.h:65
Normal news item. (Newspaper with text only)
Definition: news_type.h:93
NewsItem * prev
Previous news item.
Definition: news_type.h:135
uint32 ref2
Reference 2 to some object: Used for scrolling after clicking on the news, and for deleteing the news...
Definition: news_type.h:145
Bit value for coloured news.
Definition: news_type.h:86
News item is shown in colour (otherwise it is shown in black & white).
Definition: news_type.h:79
Number of vertical pixels between the categories and the global options.
Definition: news_type.h:29
uint32 StringID
Numeric value that represents a string, independent of the selected language.
Definition: strings_type.h:18
NewsDisplay GetDisplay() const
Return the news display option.
Definition: news_gui.cpp:249
Company news item. (Newspaper with face)
Definition: news_type.h:95
Number of bits for window layout.
Definition: news_type.h:83
uint32 face
The face of the president.
Definition: news_type.h:168
Show ticker.
Definition: news_type.h:105
NewsItem * next
Next news item.
Definition: news_type.h:136
Number of pixels between bottom edge of the window and bottom of the global options.
Definition: news_type.h:30
Reference town. Scroll to town when clicking on the news.
Definition: news_type.h:70
Production changes of industry serviced by local company.
Definition: news_type.h:44
Company info (new companies, bankruptcy messages)
Definition: news_type.h:40
First vehicle arrived for company.
Definition: news_type.h:37
const SoundFx sound
Definition: news_type.h:115
A type of cargo is (no longer) accepted.
Definition: news_type.h:49
Number of widgets needed for each news category, starting at widget #WID_MO_START_OPTION.
Definition: news_type.h:22
NewsFlag flags
NewsFlags bits.
Definition: news_type.h:140
An accident or disaster has occurred.
Definition: news_type.h:39
Types related to sounds.
News item disables transparency in the viewport.
Definition: news_type.h:80
Types related to strings.
Types related to the dates in OpenTTD.
Reference engine.
Definition: news_type.h:71
References to objects in news.
Definition: news_type.h:64
String param 0 contains a vehicle ID. (special autoreplace behaviour)
Definition: news_type.h:84
int32 Date
The type to store our dates in.
Definition: date_type.h:16
static void free(const void *ptr)
Version of the standard free that accepts const pointers.
Definition: depend.cpp:114
Reference industry. Scroll to industry when clicking on the news. Delete news when industry is delete...
Definition: news_type.h:69
NewsType type
Type of the news.
Definition: news_type.h:139
Small news item. (Information window with text and viewport)
Definition: news_type.h:92
Constants in the message options window.
Definition: news_type.h:21
Production changes of industry serviced by competitor(s)
Definition: news_type.h:45
Type of news.
Definition: news_type.h:36
News item uses shaded colours.
Definition: news_type.h:81
Vehicle news item. (new engine available)
Definition: news_type.h:94
const byte age
Maximum age of news items (in days)
Definition: news_type.h:114
Reference vehicle. Scroll to vehicle when clicking on the news. Delete news when vehicle is deleted...
Definition: news_type.h:67
Bit value for enabling shading.
Definition: news_type.h:88
Sound effects from baseset.
Definition: sound_type.h:39
Information about a single item of news.
Definition: news_type.h:134
Economic changes (recession, industry up/dowm)
Definition: news_type.h:43
byte colour
The colour related to the company.
Definition: news_type.h:169