2005-07-24 14:12:37 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
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
|
|
|
|
|
|
|
#define NEWS_FLAGS(mode,flag,type,cb) ((cb)<<24 | (type)<<16 | (flag)<<8 | (mode))
|
|
|
|
void AddNewsItem(StringID string, uint32 flags, uint data_a, uint data_b);
|
2004-11-15 12:05:01 +00:00
|
|
|
void NewsLoop(void);
|
|
|
|
void DrawNewsBorder(const Window *w);
|
|
|
|
void InitNewsItemStructs(void);
|
2004-08-09 17:04:08 +00:00
|
|
|
|
|
|
|
VARDEF NewsItem _statusbar_news_item;
|
|
|
|
|
|
|
|
enum {
|
|
|
|
NT_ARRIVAL_PLAYER = 0,
|
2006-08-22 14:38:37 +00:00
|
|
|
NT_ARRIVAL_OTHER = 1,
|
|
|
|
NT_ACCIDENT = 2,
|
|
|
|
NT_COMPANY_INFO = 3,
|
|
|
|
NT_ECONOMY = 4,
|
|
|
|
NT_ADVICE = 5,
|
|
|
|
NT_NEW_VEHICLES = 6,
|
|
|
|
NT_ACCEPTANCE = 7,
|
|
|
|
NT_SUBSIDIES = 8,
|
|
|
|
NT_GENERAL = 9,
|
2004-08-09 17:04:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum NewsMode {
|
2006-08-22 14:38:37 +00:00
|
|
|
NM_SMALL = 0,
|
|
|
|
NM_NORMAL = 1,
|
|
|
|
NM_THIN = 2,
|
2004-08-09 17:04:08 +00:00
|
|
|
NM_CALLBACK = 3,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum NewsFlags {
|
2006-08-22 14:38:37 +00:00
|
|
|
NF_VIEWPORT = 0x01,
|
|
|
|
NF_TILE = 0x04,
|
|
|
|
NF_VEHICLE = 0x08,
|
2004-08-09 17:04:08 +00:00
|
|
|
NF_FORCE_BIG = 0x10,
|
2006-08-22 14:38:37 +00:00
|
|
|
NF_NOEXPIRE = 0x20,
|
|
|
|
NF_INCOLOR = 0x40,
|
2004-08-09 17:04:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
2006-08-22 14:38:37 +00:00
|
|
|
DNC_TRAINAVAIL = 0,
|
|
|
|
DNC_ROADAVAIL = 1,
|
|
|
|
DNC_SHIPAVAIL = 2,
|
2004-08-09 17:04:08 +00:00
|
|
|
DNC_AIRCRAFTAVAIL = 3,
|
2006-08-22 14:38:37 +00:00
|
|
|
DNC_BANKRUPCY = 4,
|
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 */
|