author | truebrain |
Mon, 30 Jun 2008 13:36:06 +0000 | |
branch | noai |
changeset 11100 | b960288098b9 |
parent 10867 | 5de2923d6e59 |
permissions | -rw-r--r-- |
9826 | 1 |
/* $Id$ */ |
2 |
||
3 |
/** @file news_type.h Types related to news. */ |
|
4 |
||
5 |
#ifndef NEWS_TYPE_H |
|
6 |
#define NEWS_TYPE_H |
|
7 |
||
8 |
#include "date_type.h" |
|
9 |
#include "strings_type.h" |
|
10294 | 10 |
#include "sound_type.h" |
9826 | 11 |
|
12 |
/** |
|
13 |
* Type of news. |
|
14 |
*/ |
|
15 |
enum NewsType { |
|
16 |
NT_ARRIVAL_PLAYER, ///< Cargo arrived for player |
|
17 |
NT_ARRIVAL_OTHER, ///< Cargo arrived for competitor |
|
18 |
NT_ACCIDENT, ///< An accident or disaster has occurred |
|
19 |
NT_COMPANY_INFO, ///< Company info (new companies, bankrupcy messages) |
|
20 |
NT_OPENCLOSE, ///< Opening and closing of industries |
|
21 |
NT_ECONOMY, ///< Economic changes (recession, industry up/dowm) |
|
22 |
NT_INDUSTRY_PLAYER, ///< Production changes of industry serviced by local player |
|
23 |
NT_INDUSTRY_OTHER, ///< Production changes of industry serviced by competitor(s) |
|
24 |
NT_INDUSTRY_NOBODY, ///< Other industry production changes |
|
25 |
NT_ADVICE, ///< Bits of news about vehicles of the player |
|
26 |
NT_NEW_VEHICLES, ///< New vehicle has become available |
|
27 |
NT_ACCEPTANCE, ///< A type of cargo is (no longer) accepted |
|
28 |
NT_SUBSIDIES, ///< News about subsidies (announcements, expirations, acceptance) |
|
29 |
NT_GENERAL, ///< General news (from towns) |
|
30 |
NT_END, ///< end-of-array marker |
|
31 |
}; |
|
32 |
||
33 |
/** |
|
10645 | 34 |
* News subtypes. |
35 |
*/ |
|
36 |
enum NewsSubtype { |
|
37 |
NS_ARRIVAL_PLAYER, ///< NT_ARRIVAL_PLAYER |
|
38 |
NS_ARRIVAL_OTHER, ///< NT_ARRIVAL_OTHER |
|
39 |
NS_ACCIDENT_TILE, ///< NT_ACCIDENT (tile) |
|
40 |
NS_ACCIDENT_VEHICLE, ///< NT_ACCIDENT (vehicle) |
|
41 |
NS_COMPANY_TROUBLE, ///< NT_COMPANY_INFO (trouble) |
|
42 |
NS_COMPANY_MERGER, ///< NT_COMPANY_INFO (merger) |
|
43 |
NS_COMPANY_BANKRUPT, ///< NT_COMPANY_INFO (bankrupt) |
|
44 |
NS_COMPANY_NEW, ///< NT_COMPANY_INFO (new company) |
|
45 |
NS_OPENCLOSE, ///< NT_OPENCLOSE |
|
46 |
NS_ECONOMY, ///< NT_ECONOMY |
|
47 |
NS_INDUSTRY_PLAYER, ///< NT_INDUSTRY_PLAYER |
|
48 |
NS_INDUSTRY_OTHER, ///< NT_INDUSTRY_OTHER |
|
49 |
NS_INDUSTRY_NOBODY, ///< NT_INDUSTRY_NOBODY |
|
50 |
NS_ADVICE, ///< NT_ADVICE |
|
51 |
NS_NEW_VEHICLES, ///< NT_NEW_VEHICLES |
|
52 |
NS_ACCEPTANCE, ///< NT_ACCEPTANCE |
|
53 |
NS_SUBSIDIES, ///< NT_SUBSIDIES |
|
54 |
NS_GENERAL, ///< NT_GENERAL |
|
55 |
NS_END, ///< end-of-array marker |
|
56 |
}; |
|
57 |
||
58 |
/** |
|
9826 | 59 |
* News mode. |
60 |
*/ |
|
61 |
enum NewsMode { |
|
62 |
NM_SMALL = 0, ///< Show only a small popup informing us about vehicle age for example |
|
63 |
NM_NORMAL = 1, ///< Show a simple news message (height 170 pixels) |
|
64 |
NM_THIN = 2, ///< Show a simple news message (height 130 pixels) |
|
65 |
}; |
|
66 |
||
67 |
/** |
|
68 |
* Various OR-able news-item flags. |
|
69 |
* note: NF_INCOLOR is set automatically if needed |
|
70 |
*/ |
|
71 |
enum NewsFlag { |
|
72 |
NF_NONE = 0, ///< No flag is set. |
|
73 |
NF_VIEWPORT = (1 << 1), ///< Does the news message have a viewport? (ingame picture of happening) |
|
10513
33cb70ff2f5d
(svn r13056) [NoAI] -Sync: with trunk r12996:13055.
rubidium
parents:
10294
diff
changeset
|
74 |
NF_TILE = (1 << 2), ///< When clicked on the news message scroll to a given tile? Tile is in data_a |
9826 | 75 |
NF_VEHICLE = (1 << 3), ///< When clicked on the message scroll to the vehicle? VehicleID is in data_a |
76 |
NF_INCOLOR = (1 << 5), ///< Show the newsmessage in colour, otherwise it defaults to black & white |
|
10513
33cb70ff2f5d
(svn r13056) [NoAI] -Sync: with trunk r12996:13055.
rubidium
parents:
10294
diff
changeset
|
77 |
NF_TILE2 = (1 << 6), ///< There is a second tile to scroll to; tile is in data_b |
9826 | 78 |
}; |
79 |
DECLARE_ENUM_AS_BIT_SET(NewsFlag); |
|
80 |
||
81 |
||
82 |
/** |
|
10294 | 83 |
* News display options |
84 |
*/ |
|
85 |
enum NewsDisplay { |
|
86 |
ND_OFF, ///< Only show a reminder in the status bar |
|
87 |
ND_SUMMARY, ///< Show ticker |
|
88 |
ND_FULL, ///< Show newspaper |
|
89 |
}; |
|
90 |
||
91 |
/** |
|
92 |
* Per-NewsType data |
|
93 |
*/ |
|
94 |
struct NewsTypeData { |
|
95 |
const char *const name; ///< Name |
|
96 |
const byte age; ///< Maximum age of news items (in days) |
|
97 |
const SoundFx sound; ///< Sound |
|
98 |
NewsDisplay display; ///< Display mode (off, summary, full) |
|
99 |
}; |
|
100 |
||
9826 | 101 |
struct NewsItem { |
10776 | 102 |
NewsItem *prev; ///< Previous news item |
103 |
NewsItem *next; ///< Next news item |
|
10645 | 104 |
StringID string_id; ///< Message text |
9826 | 105 |
Date date; ///< Date of the news |
10645 | 106 |
NewsSubtype subtype; ///< News subtype @see NewsSubtype |
9826 | 107 |
NewsFlag flags; ///< NewsFlags bits @see NewsFlag |
108 |
||
10645 | 109 |
uint data_a; ///< Custom data 1 (usually tile or vehicle) |
110 |
uint data_b; ///< Custom data 2 |
|
9826 | 111 |
|
112 |
uint64 params[10]; |
|
113 |
}; |
|
114 |
||
115 |
#endif /* NEWS_TYPE_H */ |