author | matthijs |
Wed, 22 Mar 2006 22:26:16 +0000 | |
branch | 0.4.5 |
changeset 9958 | bed516c67d61 |
parent 2186 | 461a2aff3486 |
child 3139 | 4c950c7ec5c9 |
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]; |
|
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
|
19 |
|
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
|
20 |
/* The validation functions for news items get called immediately |
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 |
* before the news are supposed to be shown. If this funcion returns |
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 |
* false, the news item won't be displayed. */ |
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
|
23 |
bool (*isValid) ( uint data_a, uint data_b ); |
0 | 24 |
}; |
25 |
||
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
|
26 |
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
|
27 |
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
|
28 |
typedef StringID GetNewsStringCallbackProc(const NewsItem *ni); |
0 | 29 |
|
30 |
#define NEWS_FLAGS(mode,flag,type,cb) ((cb)<<24 | (type)<<16 | (flag)<<8 | (mode)) |
|
31 |
void AddNewsItem(StringID string, uint32 flags, uint data_a, uint data_b); |
|
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
|
32 |
void AddValidatedNewsItem(StringID string, uint32 flags, uint data_a, uint data_b, ValidationProc *validation); |
427 | 33 |
void NewsLoop(void); |
34 |
void DrawNewsBorder(const Window *w); |
|
35 |
void InitNewsItemStructs(void); |
|
0 | 36 |
|
37 |
VARDEF NewsItem _statusbar_news_item; |
|
38 |
||
39 |
enum { |
|
40 |
NT_ARRIVAL_PLAYER = 0, |
|
41 |
NT_ARRIVAL_OTHER = 1, |
|
42 |
NT_ACCIDENT = 2, |
|
43 |
NT_COMPANY_INFO = 3, |
|
44 |
NT_ECONOMY = 4, |
|
45 |
NT_ADVICE = 5, |
|
46 |
NT_NEW_VEHICLES = 6, |
|
47 |
NT_ACCEPTANCE = 7, |
|
48 |
NT_SUBSIDIES = 8, |
|
49 |
NT_GENERAL = 9, |
|
50 |
}; |
|
51 |
||
52 |
enum NewsMode { |
|
53 |
NM_SMALL = 0, |
|
54 |
NM_NORMAL = 1, |
|
55 |
NM_THIN = 2, |
|
56 |
NM_CALLBACK = 3, |
|
57 |
}; |
|
58 |
||
59 |
enum NewsFlags { |
|
60 |
NF_VIEWPORT = 1, |
|
61 |
NF_TILE = 4, |
|
62 |
NF_VEHICLE = 8, |
|
63 |
NF_FORCE_BIG = 0x10, |
|
64 |
NF_NOEXPIRE = 0x20, |
|
65 |
NF_INCOLOR = 0x40, |
|
66 |
}; |
|
67 |
||
68 |
enum { |
|
69 |
DNC_TRAINAVAIL = 0, |
|
70 |
DNC_ROADAVAIL = 1, |
|
71 |
DNC_SHIPAVAIL = 2, |
|
72 |
DNC_AIRCRAFTAVAIL = 3, |
|
73 |
DNC_BANKRUPCY = 4, |
|
74 |
}; |
|
75 |
||
76 |
#endif /* NEWS_H */ |