Files @ r4300:642b2431578b
Branch filter:

Location: cpp/openttd-patchpack/source/news.h

truelight
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
- New optional landscape generator (TerraGenesis Perlin)
- Load heightmaps (either BMP or PNG)
- Progress dialog while generating worlds (no longer a 'hanging' screen)
- New dialogs for NewGame, Create Scenario and Play Heightmap
- Easier to configure your landscape
- More things to configure (tree-placer, ..)
- Speedup of world generation
- New console command 'restart': restart the map EXACTLY as it was when you
first started it (needs a game made after or with this commit)
- New console command 'getseed': get the seed of your map and share it with
others (of course only works with generated maps)
- Many new, world generation related, things
- Many internal cleanups and rewrites
Many tnx to those people who helped making this:
Belugas, DaleStan, glx, KUDr, RichK67, Rubidium, and TrueLight (alfabetic)
Many tnx to those who helped testing:
Arnau, Bjarni, and tokai (alfabetic)
And to all other people who helped testing and sending comments / bugs
Stats: 673 lines changed, 3534 new lines, 79 new strings
/* $Id$ */

#ifndef NEWS_H
#define NEWS_H

struct NewsItem {
	StringID string_id;
	uint16 duration;
	Date date;
	byte flags;
	byte display_mode;
	byte type;
	byte callback;

	TileIndex data_a;
	TileIndex data_b;

	uint32 params[10];
};

typedef bool ValidationProc ( uint data_a, uint data_b );
typedef void DrawNewsCallbackProc(Window *w);
typedef StringID GetNewsStringCallbackProc(const NewsItem *ni);

#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);
void NewsLoop(void);
void DrawNewsBorder(const Window *w);
void InitNewsItemStructs(void);

VARDEF NewsItem _statusbar_news_item;

enum {
	NT_ARRIVAL_PLAYER = 0,
	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,
};

enum NewsMode {
	NM_SMALL = 0,
	NM_NORMAL = 1,
	NM_THIN = 2,
	NM_CALLBACK = 3,
};

enum NewsFlags {
	NF_VIEWPORT = 1,
	NF_TILE = 4,
	NF_VEHICLE = 8,
	NF_FORCE_BIG = 0x10,
	NF_NOEXPIRE = 0x20,
	NF_INCOLOR = 0x40,
};

enum {
	DNC_TRAINAVAIL = 0,
	DNC_ROADAVAIL = 1,
	DNC_SHIPAVAIL = 2,
	DNC_AIRCRAFTAVAIL = 3,
	DNC_BANKRUPCY = 4,
};

/**
 * 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);

#endif /* NEWS_H */