summaryrefslogtreecommitdiff
path: root/news.h
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-10-17 17:59:41 +0000
committerDarkvater <darkvater@openttd.org>2006-10-17 17:59:41 +0000
commitfba7d2f7f32aaef9497abbe8f1d7423b1a9d9220 (patch)
tree78e9f63f8221b7a2f6a4824b9b0d23036795510d /news.h
parentec9e59b4fc1e04823f1637e26e04c8d5e8047fec (diff)
downloadopenttd-fba7d2f7f32aaef9497abbe8f1d7423b1a9d9220.tar.xz
(svn r6803) -Codechange: Substitute magic numbers by an enum for the news windows
Diffstat (limited to 'news.h')
-rw-r--r--news.h41
1 files changed, 24 insertions, 17 deletions
diff --git a/news.h b/news.h
index b820fde27..d2024b844 100644
--- a/news.h
+++ b/news.h
@@ -30,7 +30,7 @@ void InitNewsItemStructs(void);
VARDEF NewsItem _statusbar_news_item;
-enum {
+enum NewsType {
NT_ARRIVAL_PLAYER = 0,
NT_ARRIVAL_OTHER = 1,
NT_ACCIDENT = 2,
@@ -44,27 +44,34 @@ enum {
};
enum NewsMode {
- NM_SMALL = 0,
- NM_NORMAL = 1,
- NM_THIN = 2,
- NM_CALLBACK = 3,
+ 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 = 0x01,
- NF_TILE = 0x04,
- NF_VEHICLE = 0x08,
- NF_FORCE_BIG = 0x10,
- NF_NOEXPIRE = 0x20,
- NF_INCOLOR = 0x40,
+ 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_NOEXPIRE = (1 << 5), ///< Some flag that I think is already deprecated
+ NF_INCOLOR = (1 << 6), ///< Show the newsmessage in colour, otherwise it defaults to black & white
};
-enum {
- DNC_TRAINAVAIL = 0,
- DNC_ROADAVAIL = 1,
- DNC_SHIPAVAIL = 2,
- DNC_AIRCRAFTAVAIL = 3,
- DNC_BANKRUPCY = 4,
+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
};
/**