2005-07-24 14:12:37 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
2007-03-21 03:06:21 +00:00
|
|
|
/** @file news.h */
|
|
|
|
|
2004-08-09 17:04:08 +00:00
|
|
|
#ifndef NEWS_H
|
|
|
|
#define NEWS_H
|
|
|
|
|
|
|
|
struct NewsItem {
|
|
|
|
StringID string_id;
|
|
|
|
uint16 duration;
|
2006-08-15 16:55:40 +00:00
|
|
|
Date date;
|
2004-08-09 17:04:08 +00:00
|
|
|
byte flags;
|
|
|
|
byte display_mode;
|
|
|
|
byte type;
|
|
|
|
byte callback;
|
|
|
|
|
|
|
|
TileIndex data_a;
|
|
|
|
TileIndex data_b;
|
|
|
|
|
|
|
|
uint32 params[10];
|
|
|
|
};
|
|
|
|
|
2004-12-19 09:39:19 +00:00
|
|
|
typedef bool ValidationProc ( uint data_a, uint data_b );
|
|
|
|
typedef void DrawNewsCallbackProc(Window *w);
|
2005-07-17 16:02:17 +00:00
|
|
|
typedef StringID GetNewsStringCallbackProc(const NewsItem *ni);
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2007-04-18 22:10:36 +00:00
|
|
|
#define NEWS_FLAGS(mode, flag, type, cb) ((cb) << 24 | (type) << 16 | (flag) << 8 | (mode))
|
2004-08-09 17:04:08 +00:00
|
|
|
void AddNewsItem(StringID string, uint32 flags, uint data_a, uint data_b);
|
2007-03-07 11:47:46 +00:00
|
|
|
void NewsLoop();
|
2004-11-15 12:05:01 +00:00
|
|
|
void DrawNewsBorder(const Window *w);
|
2007-03-07 11:47:46 +00:00
|
|
|
void InitNewsItemStructs();
|
2004-08-09 17:04:08 +00:00
|
|
|
|
|
|
|
VARDEF NewsItem _statusbar_news_item;
|
|
|
|
|
2006-10-17 17:59:41 +00:00
|
|
|
enum NewsType {
|
2007-03-10 03:33:43 +00:00
|
|
|
NT_ARRIVAL_PLAYER,
|
|
|
|
NT_ARRIVAL_OTHER,
|
|
|
|
NT_ACCIDENT,
|
|
|
|
NT_COMPANY_INFO,
|
2007-03-10 12:10:00 +00:00
|
|
|
NT_OPENCLOSE,
|
2007-03-10 03:33:43 +00:00
|
|
|
NT_ECONOMY,
|
|
|
|
NT_ADVICE,
|
|
|
|
NT_NEW_VEHICLES,
|
|
|
|
NT_ACCEPTANCE,
|
|
|
|
NT_SUBSIDIES,
|
|
|
|
NT_GENERAL,
|
|
|
|
NT_END,
|
2004-08-09 17:04:08 +00:00
|
|
|
};
|
|
|
|
|
2007-03-10 12:10:00 +00:00
|
|
|
extern const char *_news_display_name[NT_END];
|
|
|
|
|
2004-08-09 17:04:08 +00:00
|
|
|
enum NewsMode {
|
2006-10-17 17:59:41 +00:00
|
|
|
NM_SMALL = 0, ///< Show only a small popup informing us about vehicle age for example
|
|
|
|
NM_NORMAL = 1, ///< Show a simple news message (height 170 pixels)
|
|
|
|
NM_THIN = 2, ///< Show a simple news message (height 130 pixels)
|
|
|
|
NM_CALLBACK = 3, ///< Do some special processing before displaying news message. Which callback to call is in NewsCallback
|
2004-08-09 17:04:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum NewsFlags {
|
2006-10-17 17:59:41 +00:00
|
|
|
NF_VIEWPORT = (1 << 1), ///< Does the news message have a viewport? (ingame picture of happening)
|
|
|
|
NF_TILE = (1 << 2), ///< When clicked on the news message scroll to a given tile? Tile is in data_a/data_b
|
|
|
|
NF_VEHICLE = (1 << 3), ///< When clicked on the message scroll to the vehicle? VehicleID is in data_a
|
|
|
|
NF_FORCE_BIG = (1 << 4), ///< Force the appearance of a news message if it has already been shown (internal)
|
2006-10-17 18:15:35 +00:00
|
|
|
NF_INCOLOR = (1 << 5), ///< Show the newsmessage in colour, otherwise it defaults to black & white
|
2004-08-09 17:04:08 +00:00
|
|
|
};
|
|
|
|
|
2006-10-17 17:59:41 +00:00
|
|
|
enum NewsCallback {
|
2007-03-03 22:03:15 +00:00
|
|
|
DNC_VEHICLEAVAIL = 0, ///< Show new vehicle available message. StringID is EngineID
|
|
|
|
DNC_BANKRUPCY = 1, ///< Show bankrupcy message. StringID is PlayerID (0-3) and NewsBankrupcy (4-7)
|
2006-10-17 17:59:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum NewsBankrupcy {
|
|
|
|
NB_BTROUBLE = (1 << 4), ///< Company is in trouble (warning)
|
|
|
|
NB_BMERGER = (2 << 4), ///< Company has been bought by another company
|
|
|
|
NB_BBANKRUPT = (3 << 4), ///< Company has gone bankrupt
|
|
|
|
NB_BNEWCOMPANY = (4 << 4), ///< A new company has been started
|
2004-08-09 17:04:08 +00:00
|
|
|
};
|
|
|
|
|
2006-03-04 11:01:35 +00:00
|
|
|
/**
|
|
|
|
* Delete a news item type about a vehicle
|
|
|
|
* if the news item type is INVALID_STRING_ID all news about the vehicle get
|
|
|
|
* deleted
|
|
|
|
*/
|
|
|
|
void DeleteVehicleNews(VehicleID, StringID news);
|
|
|
|
|
2004-08-09 17:04:08 +00:00
|
|
|
#endif /* NEWS_H */
|