summaryrefslogtreecommitdiff
path: root/src/news.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-01-02 19:19:48 +0000
committerrubidium <rubidium@openttd.org>2007-01-02 19:19:48 +0000
commit66bbf336c6af7353ef0aeed58002c46543b30635 (patch)
treead4a63860df2626b22f77e7dac712e958bea54cb /src/news.h
parentccc0a3f4dbf58c005b22341ac8874252924690cd (diff)
downloadopenttd-66bbf336c6af7353ef0aeed58002c46543b30635.tar.xz
(svn r7759) -Merge: makefile rewrite. This merge features:
- A proper ./configure, so everything needs to be configured only once, not for every make. - Usage of makedepend when available. This greatly reduces the time needed for generating the dependencies. - A generator for all project files. There is a single file with sources, which is used to generate Makefiles and the project files for MSVC. - Proper support for OSX universal binaries. - Object files for non-MSVC compiles are also placed in separate directories, making is faster to switch between debug and release compiles and it does not touch the directory with the source files. - Functionality to make a bundle of all needed files for for example a nightly or distribution of a binary with all needed GRFs and language files. Note: as this merge moves almost all files, it is recommended to make a backup of your working copy before updating your working copy.
Diffstat (limited to 'src/news.h')
-rw-r--r--src/news.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/src/news.h b/src/news.h
new file mode 100644
index 000000000..72f7e842a
--- /dev/null
+++ b/src/news.h
@@ -0,0 +1,83 @@
+/* $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 NewsType {
+ 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, ///< 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
+};
+
+enum NewsFlags {
+ 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)
+ NF_INCOLOR = (1 << 5), ///< Show the newsmessage in colour, otherwise it defaults to black & white
+};
+
+enum NewsCallback {
+ DNC_TRAINAVAIL = 0, ///< Show new train available message. StringID is EngineID
+ DNC_ROADAVAIL = 1, ///< Show new road vehicle available message. StringID is EngineID
+ DNC_SHIPAVAIL = 2, ///< Show new ship available message. StringID is EngineID
+ DNC_AIRCRAFTAVAIL = 3, ///< Show new aircraft available message. StringID is EngineID
+ DNC_BANKRUPCY = 4, ///< Show bankrupcy message. StringID is PlayerID (0-3) and NewsBankrupcy (4-7)
+};
+
+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
+};
+
+/**
+ * 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 */