| author | Darkvater | 
| Thu, 16 Mar 2006 00:32:25 +0000 | |
| changeset 3224 | fd70771e0d6e | 
| parent 3140 | 69cb681c6d86 | 
| child 4289 | ff1b2b915cab | 
| permissions | -rw-r--r-- | 
| 2186 | 1  | 
/* $Id$ */  | 
2  | 
||
| 0 | 3  | 
#ifndef NEWS_H  | 
4  | 
#define NEWS_H  | 
|
5  | 
||
6  | 
struct NewsItem {
 | 
|
7  | 
StringID string_id;  | 
|
8  | 
uint16 duration;  | 
|
9  | 
uint16 date;  | 
|
10  | 
byte flags;  | 
|
11  | 
byte display_mode;  | 
|
12  | 
byte type;  | 
|
13  | 
byte callback;  | 
|
14  | 
||
15  | 
TileIndex data_a;  | 
|
16  | 
TileIndex data_b;  | 
|
17  | 
||
18  | 
uint32 params[10];  | 
|
19  | 
};  | 
|
20  | 
||
| 
715
 
83805642c830
(svn r1167) Feature: Added the possibility to add validation functions to NewsItems. This is now done for "Train in depot" messages. Before displaying such a message, it checks if the train really still is in the depot. Can be applied to other news items as well.
 
dominik 
parents: 
427 
diff
changeset
 | 
21  | 
typedef bool ValidationProc ( uint data_a, uint data_b );  | 
| 
 
83805642c830
(svn r1167) Feature: Added the possibility to add validation functions to NewsItems. This is now done for "Train in depot" messages. Before displaying such a message, it checks if the train really still is in the depot. Can be applied to other news items as well.
 
dominik 
parents: 
427 
diff
changeset
 | 
22  | 
typedef void DrawNewsCallbackProc(Window *w);  | 
| 
2101
 
763d0d48f39c
(svn r2611) - CodeChange: use standardized truncutation with the newsmessage-history window as well
 
Darkvater 
parents: 
715 
diff
changeset
 | 
23  | 
typedef StringID GetNewsStringCallbackProc(const NewsItem *ni);  | 
| 0 | 24  | 
|
25  | 
#define NEWS_FLAGS(mode,flag,type,cb) ((cb)<<24 | (type)<<16 | (flag)<<8 | (mode))  | 
|
26  | 
void AddNewsItem(StringID string, uint32 flags, uint data_a, uint data_b);  | 
|
| 427 | 27  | 
void NewsLoop(void);  | 
28  | 
void DrawNewsBorder(const Window *w);  | 
|
29  | 
void InitNewsItemStructs(void);  | 
|
| 0 | 30  | 
|
31  | 
VARDEF NewsItem _statusbar_news_item;  | 
|
32  | 
||
33  | 
enum {
 | 
|
34  | 
NT_ARRIVAL_PLAYER = 0,  | 
|
35  | 
NT_ARRIVAL_OTHER = 1,  | 
|
36  | 
NT_ACCIDENT = 2,  | 
|
37  | 
NT_COMPANY_INFO = 3,  | 
|
38  | 
NT_ECONOMY = 4,  | 
|
39  | 
NT_ADVICE = 5,  | 
|
40  | 
NT_NEW_VEHICLES = 6,  | 
|
41  | 
NT_ACCEPTANCE = 7,  | 
|
42  | 
NT_SUBSIDIES = 8,  | 
|
43  | 
NT_GENERAL = 9,  | 
|
44  | 
};  | 
|
45  | 
||
46  | 
enum NewsMode {
 | 
|
47  | 
NM_SMALL = 0,  | 
|
48  | 
NM_NORMAL = 1,  | 
|
49  | 
NM_THIN = 2,  | 
|
50  | 
NM_CALLBACK = 3,  | 
|
51  | 
};  | 
|
52  | 
||
53  | 
enum NewsFlags {
 | 
|
54  | 
NF_VIEWPORT = 1,  | 
|
55  | 
NF_TILE = 4,  | 
|
56  | 
NF_VEHICLE = 8,  | 
|
57  | 
NF_FORCE_BIG = 0x10,  | 
|
58  | 
NF_NOEXPIRE = 0x20,  | 
|
59  | 
NF_INCOLOR = 0x40,  | 
|
60  | 
};  | 
|
61  | 
||
62  | 
enum {
 | 
|
63  | 
DNC_TRAINAVAIL = 0,  | 
|
64  | 
DNC_ROADAVAIL = 1,  | 
|
65  | 
DNC_SHIPAVAIL = 2,  | 
|
66  | 
DNC_AIRCRAFTAVAIL = 3,  | 
|
67  | 
DNC_BANKRUPCY = 4,  | 
|
68  | 
};  | 
|
69  | 
||
| 
3139
 
4c950c7ec5c9
(svn r3757) -Feature: Delete news items about vehicles, when they get stale
 
tron 
parents: 
2186 
diff
changeset
 | 
70  | 
/**  | 
| 
 
4c950c7ec5c9
(svn r3757) -Feature: Delete news items about vehicles, when they get stale
 
tron 
parents: 
2186 
diff
changeset
 | 
71  | 
* Delete a news item type about a vehicle  | 
| 
 
4c950c7ec5c9
(svn r3757) -Feature: Delete news items about vehicles, when they get stale
 
tron 
parents: 
2186 
diff
changeset
 | 
72  | 
* if the news item type is INVALID_STRING_ID all news about the vehicle get  | 
| 
 
4c950c7ec5c9
(svn r3757) -Feature: Delete news items about vehicles, when they get stale
 
tron 
parents: 
2186 
diff
changeset
 | 
73  | 
* deleted  | 
| 
 
4c950c7ec5c9
(svn r3757) -Feature: Delete news items about vehicles, when they get stale
 
tron 
parents: 
2186 
diff
changeset
 | 
74  | 
*/  | 
| 
 
4c950c7ec5c9
(svn r3757) -Feature: Delete news items about vehicles, when they get stale
 
tron 
parents: 
2186 
diff
changeset
 | 
75  | 
void DeleteVehicleNews(VehicleID, StringID news);  | 
| 
 
4c950c7ec5c9
(svn r3757) -Feature: Delete news items about vehicles, when they get stale
 
tron 
parents: 
2186 
diff
changeset
 | 
76  | 
|
| 0 | 77  | 
#endif /* NEWS_H */  |