src/news_type.h
author rubidium
Thu, 15 May 2008 13:39:36 +0000
changeset 10556 ec733f5899fa
parent 10521 79e3bb000aed
child 10558 208bd6477a79
permissions -rw-r--r--
(svn r13100) -Codechange: reduce the amount of parameters passed via AddNewsMessage as there is (for each news message type) a tuple of 4 parameters that is the same for all calls.
2186
461a2aff3486 (svn r2701) Insert Id tags into all source files
tron
parents: 2101
diff changeset
     1
/* $Id$ */
461a2aff3486 (svn r2701) Insert Id tags into all source files
tron
parents: 2101
diff changeset
     2
9259
088d3649dd4f (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8766
diff changeset
     3
/** @file news_type.h Types related to news. */
6674
64f4781b4653 (svn r9385) -Cleanup: doxygen changes. Today, we are exploring the letter N.
belugas
parents: 6609
diff changeset
     4
9259
088d3649dd4f (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8766
diff changeset
     5
#ifndef NEWS_TYPE_H
088d3649dd4f (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8766
diff changeset
     6
#define NEWS_TYPE_H
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     7
8602
9e75e594a068 (svn r11667) -Codechange: split window.h into a header that defines some 'global' window related types, on that defined 'global' window functions and one that defines functions and types only used by *_gui.cpps.
rubidium
parents: 8387
diff changeset
     8
#include "window_type.h"
8636
2b158acb649c (svn r11702) -Codechange: move all date related stuff to date*.
rubidium
parents: 8634
diff changeset
     9
#include "date_type.h"
8760
ce0891c412ce (svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h.
rubidium
parents: 8636
diff changeset
    10
#include "strings_type.h"
10253
1627c1fef7c8 (svn r12785) -Codechange: put all news-type related constants in the same array. Patch by cirdan.
rubidium
parents: 10160
diff changeset
    11
#include "sound_type.h"
8602
9e75e594a068 (svn r11667) -Codechange: split window.h into a header that defines some 'global' window related types, on that defined 'global' window functions and one that defines functions and types only used by *_gui.cpps.
rubidium
parents: 8387
diff changeset
    12
8094
58a8fe00746a (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7502
diff changeset
    13
/**
9259
088d3649dd4f (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8766
diff changeset
    14
 * Type of news.
8094
58a8fe00746a (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7502
diff changeset
    15
 */
4873
7cb19235cf60 (svn r6803) -Codechange: Substitute magic numbers by an enum for the news windows
Darkvater
parents: 4344
diff changeset
    16
enum NewsType {
8094
58a8fe00746a (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7502
diff changeset
    17
	NT_ARRIVAL_PLAYER,  ///< Cargo arrived for player
58a8fe00746a (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7502
diff changeset
    18
	NT_ARRIVAL_OTHER,   ///< Cargo arrived for competitor
58a8fe00746a (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7502
diff changeset
    19
	NT_ACCIDENT,        ///< An accident or disaster has occurred
58a8fe00746a (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7502
diff changeset
    20
	NT_COMPANY_INFO,    ///< Company info (new companies, bankrupcy messages)
58a8fe00746a (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7502
diff changeset
    21
	NT_OPENCLOSE,       ///< Opening and closing of industries
58a8fe00746a (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7502
diff changeset
    22
	NT_ECONOMY,         ///< Economic changes (recession, industry up/dowm)
8387
30f519812d62 (svn r11442) -Feature: make news messages related to the industry (production) changes better configurable; you can now disable news messages popping up for industries you are not servicing. Patch by Alberth.
rubidium
parents: 8094
diff changeset
    23
	NT_INDUSTRY_PLAYER, ///< Production changes of industry serviced by local player
30f519812d62 (svn r11442) -Feature: make news messages related to the industry (production) changes better configurable; you can now disable news messages popping up for industries you are not servicing. Patch by Alberth.
rubidium
parents: 8094
diff changeset
    24
	NT_INDUSTRY_OTHER,  ///< Production changes of industry serviced by competitor(s)
30f519812d62 (svn r11442) -Feature: make news messages related to the industry (production) changes better configurable; you can now disable news messages popping up for industries you are not servicing. Patch by Alberth.
rubidium
parents: 8094
diff changeset
    25
	NT_INDUSTRY_NOBODY, ///< Other industry production changes
8094
58a8fe00746a (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7502
diff changeset
    26
	NT_ADVICE,          ///< Bits of news about vehicles of the player
58a8fe00746a (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7502
diff changeset
    27
	NT_NEW_VEHICLES,    ///< New vehicle has become available
58a8fe00746a (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7502
diff changeset
    28
	NT_ACCEPTANCE,      ///< A type of cargo is (no longer) accepted
58a8fe00746a (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7502
diff changeset
    29
	NT_SUBSIDIES,       ///< News about subsidies (announcements, expirations, acceptance)
58a8fe00746a (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7502
diff changeset
    30
	NT_GENERAL,         ///< General news (from towns)
58a8fe00746a (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7502
diff changeset
    31
	NT_END,             ///< end-of-array marker
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    32
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    33
8094
58a8fe00746a (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7502
diff changeset
    34
/**
10556
ec733f5899fa (svn r13100) -Codechange: reduce the amount of parameters passed via AddNewsMessage as there is (for each news message type) a tuple of 4 parameters that is the same for all calls.
rubidium
parents: 10521
diff changeset
    35
 * News subtypes.
ec733f5899fa (svn r13100) -Codechange: reduce the amount of parameters passed via AddNewsMessage as there is (for each news message type) a tuple of 4 parameters that is the same for all calls.
rubidium
parents: 10521
diff changeset
    36
 */
ec733f5899fa (svn r13100) -Codechange: reduce the amount of parameters passed via AddNewsMessage as there is (for each news message type) a tuple of 4 parameters that is the same for all calls.
rubidium
parents: 10521
diff changeset
    37
enum NewsSubtype {
ec733f5899fa (svn r13100) -Codechange: reduce the amount of parameters passed via AddNewsMessage as there is (for each news message type) a tuple of 4 parameters that is the same for all calls.
rubidium
parents: 10521
diff changeset
    38
	NS_ARRIVAL_PLAYER,   ///< NT_ARRIVAL_PLAYER
ec733f5899fa (svn r13100) -Codechange: reduce the amount of parameters passed via AddNewsMessage as there is (for each news message type) a tuple of 4 parameters that is the same for all calls.
rubidium
parents: 10521
diff changeset
    39
	NS_ARRIVAL_OTHER,    ///< NT_ARRIVAL_OTHER
ec733f5899fa (svn r13100) -Codechange: reduce the amount of parameters passed via AddNewsMessage as there is (for each news message type) a tuple of 4 parameters that is the same for all calls.
rubidium
parents: 10521
diff changeset
    40
	NS_ACCIDENT_TILE,    ///< NT_ACCIDENT (tile)
ec733f5899fa (svn r13100) -Codechange: reduce the amount of parameters passed via AddNewsMessage as there is (for each news message type) a tuple of 4 parameters that is the same for all calls.
rubidium
parents: 10521
diff changeset
    41
	NS_ACCIDENT_VEHICLE, ///< NT_ACCIDENT (vehicle)
ec733f5899fa (svn r13100) -Codechange: reduce the amount of parameters passed via AddNewsMessage as there is (for each news message type) a tuple of 4 parameters that is the same for all calls.
rubidium
parents: 10521
diff changeset
    42
	NS_COMPANY_TROUBLE,  ///< NT_COMPANY_INFO (trouble)
ec733f5899fa (svn r13100) -Codechange: reduce the amount of parameters passed via AddNewsMessage as there is (for each news message type) a tuple of 4 parameters that is the same for all calls.
rubidium
parents: 10521
diff changeset
    43
	NS_COMPANY_MERGER,   ///< NT_COMPANY_INFO (merger)
ec733f5899fa (svn r13100) -Codechange: reduce the amount of parameters passed via AddNewsMessage as there is (for each news message type) a tuple of 4 parameters that is the same for all calls.
rubidium
parents: 10521
diff changeset
    44
	NS_COMPANY_BANKRUPT, ///< NT_COMPANY_INFO (bankrupt)
ec733f5899fa (svn r13100) -Codechange: reduce the amount of parameters passed via AddNewsMessage as there is (for each news message type) a tuple of 4 parameters that is the same for all calls.
rubidium
parents: 10521
diff changeset
    45
	NS_COMPANY_NEW,      ///< NT_COMPANY_INFO (new company)
ec733f5899fa (svn r13100) -Codechange: reduce the amount of parameters passed via AddNewsMessage as there is (for each news message type) a tuple of 4 parameters that is the same for all calls.
rubidium
parents: 10521
diff changeset
    46
	NS_OPENCLOSE,        ///< NT_OPENCLOSE
ec733f5899fa (svn r13100) -Codechange: reduce the amount of parameters passed via AddNewsMessage as there is (for each news message type) a tuple of 4 parameters that is the same for all calls.
rubidium
parents: 10521
diff changeset
    47
	NS_ECONOMY,          ///< NT_ECONOMY
ec733f5899fa (svn r13100) -Codechange: reduce the amount of parameters passed via AddNewsMessage as there is (for each news message type) a tuple of 4 parameters that is the same for all calls.
rubidium
parents: 10521
diff changeset
    48
	NS_INDUSTRY_PLAYER,  ///< NT_INDUSTRY_PLAYER
ec733f5899fa (svn r13100) -Codechange: reduce the amount of parameters passed via AddNewsMessage as there is (for each news message type) a tuple of 4 parameters that is the same for all calls.
rubidium
parents: 10521
diff changeset
    49
	NS_INDUSTRY_OTHER,   ///< NT_INDUSTRY_OTHER
ec733f5899fa (svn r13100) -Codechange: reduce the amount of parameters passed via AddNewsMessage as there is (for each news message type) a tuple of 4 parameters that is the same for all calls.
rubidium
parents: 10521
diff changeset
    50
	NS_INDUSTRY_NOBODY,  ///< NT_INDUSTRY_NOBODY
ec733f5899fa (svn r13100) -Codechange: reduce the amount of parameters passed via AddNewsMessage as there is (for each news message type) a tuple of 4 parameters that is the same for all calls.
rubidium
parents: 10521
diff changeset
    51
	NS_ADVICE,           ///< NT_ADVICE
ec733f5899fa (svn r13100) -Codechange: reduce the amount of parameters passed via AddNewsMessage as there is (for each news message type) a tuple of 4 parameters that is the same for all calls.
rubidium
parents: 10521
diff changeset
    52
	NS_NEW_VEHICLES,     ///< NT_NEW_VEHICLES
ec733f5899fa (svn r13100) -Codechange: reduce the amount of parameters passed via AddNewsMessage as there is (for each news message type) a tuple of 4 parameters that is the same for all calls.
rubidium
parents: 10521
diff changeset
    53
	NS_ACCEPTANCE,       ///< NT_ACCEPTANCE
ec733f5899fa (svn r13100) -Codechange: reduce the amount of parameters passed via AddNewsMessage as there is (for each news message type) a tuple of 4 parameters that is the same for all calls.
rubidium
parents: 10521
diff changeset
    54
	NS_SUBSIDIES,        ///< NT_SUBSIDIES
ec733f5899fa (svn r13100) -Codechange: reduce the amount of parameters passed via AddNewsMessage as there is (for each news message type) a tuple of 4 parameters that is the same for all calls.
rubidium
parents: 10521
diff changeset
    55
	NS_GENERAL,          ///< NT_GENERAL
ec733f5899fa (svn r13100) -Codechange: reduce the amount of parameters passed via AddNewsMessage as there is (for each news message type) a tuple of 4 parameters that is the same for all calls.
rubidium
parents: 10521
diff changeset
    56
	NS_END,              ///< end-of-array marker
ec733f5899fa (svn r13100) -Codechange: reduce the amount of parameters passed via AddNewsMessage as there is (for each news message type) a tuple of 4 parameters that is the same for all calls.
rubidium
parents: 10521
diff changeset
    57
};
ec733f5899fa (svn r13100) -Codechange: reduce the amount of parameters passed via AddNewsMessage as there is (for each news message type) a tuple of 4 parameters that is the same for all calls.
rubidium
parents: 10521
diff changeset
    58
ec733f5899fa (svn r13100) -Codechange: reduce the amount of parameters passed via AddNewsMessage as there is (for each news message type) a tuple of 4 parameters that is the same for all calls.
rubidium
parents: 10521
diff changeset
    59
/**
8094
58a8fe00746a (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7502
diff changeset
    60
 * News mode.
58a8fe00746a (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7502
diff changeset
    61
 */
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    62
enum NewsMode {
4873
7cb19235cf60 (svn r6803) -Codechange: Substitute magic numbers by an enum for the news windows
Darkvater
parents: 4344
diff changeset
    63
	NM_SMALL    = 0, ///< Show only a small popup informing us about vehicle age for example
7cb19235cf60 (svn r6803) -Codechange: Substitute magic numbers by an enum for the news windows
Darkvater
parents: 4344
diff changeset
    64
	NM_NORMAL   = 1, ///< Show a simple news message (height 170 pixels)
7cb19235cf60 (svn r6803) -Codechange: Substitute magic numbers by an enum for the news windows
Darkvater
parents: 4344
diff changeset
    65
	NM_THIN     = 2, ///< Show a simple news message (height 130 pixels)
7cb19235cf60 (svn r6803) -Codechange: Substitute magic numbers by an enum for the news windows
Darkvater
parents: 4344
diff changeset
    66
	NM_CALLBACK = 3, ///< Do some special processing before displaying news message. Which callback to call is in NewsCallback
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    67
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    68
8094
58a8fe00746a (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7502
diff changeset
    69
/**
58a8fe00746a (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7502
diff changeset
    70
 * Various OR-able news-item flags.
58a8fe00746a (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7502
diff changeset
    71
 * note: NF_INCOLOR is set automatically if needed
58a8fe00746a (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7502
diff changeset
    72
 */
9259
088d3649dd4f (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8766
diff changeset
    73
enum NewsFlag {
088d3649dd4f (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8766
diff changeset
    74
	NF_NONE      = 0,        ///< No flag is set.
4873
7cb19235cf60 (svn r6803) -Codechange: Substitute magic numbers by an enum for the news windows
Darkvater
parents: 4344
diff changeset
    75
	NF_VIEWPORT  = (1 << 1), ///< Does the news message have a viewport? (ingame picture of happening)
10478
f7761642d9b6 (svn r13021) -Codechange: free data_b for other uses when it is not used to store a second tile to skip to (in news messages). Patch by cirdan.
rubidium
parents: 10273
diff changeset
    76
	NF_TILE      = (1 << 2), ///< When clicked on the news message scroll to a given tile? Tile is in data_a
4873
7cb19235cf60 (svn r6803) -Codechange: Substitute magic numbers by an enum for the news windows
Darkvater
parents: 4344
diff changeset
    77
	NF_VEHICLE   = (1 << 3), ///< When clicked on the message scroll to the vehicle? VehicleID is in data_a
7cb19235cf60 (svn r6803) -Codechange: Substitute magic numbers by an enum for the news windows
Darkvater
parents: 4344
diff changeset
    78
	NF_FORCE_BIG = (1 << 4), ///< Force the appearance of a news message if it has already been shown (internal)
4874
b95cdd66085f (svn r6804) -Codechange: Remove the unused NF_NOEXPIRE flag.
Darkvater
parents: 4873
diff changeset
    79
	NF_INCOLOR   = (1 << 5), ///< Show the newsmessage in colour, otherwise it defaults to black & white
10478
f7761642d9b6 (svn r13021) -Codechange: free data_b for other uses when it is not used to store a second tile to skip to (in news messages). Patch by cirdan.
rubidium
parents: 10273
diff changeset
    80
	NF_TILE2     = (1 << 6), ///< There is a second tile to scroll to; tile is in data_b
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    81
};
9259
088d3649dd4f (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8766
diff changeset
    82
DECLARE_ENUM_AS_BIT_SET(NewsFlag);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    83
9259
088d3649dd4f (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8766
diff changeset
    84
088d3649dd4f (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8766
diff changeset
    85
/**
088d3649dd4f (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8766
diff changeset
    86
 * Special news items
088d3649dd4f (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8766
diff changeset
    87
 */
4873
7cb19235cf60 (svn r6803) -Codechange: Substitute magic numbers by an enum for the news windows
Darkvater
parents: 4344
diff changeset
    88
enum NewsCallback {
9259
088d3649dd4f (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8766
diff changeset
    89
	DNC_VEHICLEAVAIL  = 0,    ///< Show new vehicle available message. StringID is EngineID
088d3649dd4f (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8766
diff changeset
    90
	DNC_BANKRUPCY     = 1,    ///< Show bankrupcy message. StringID is PlayerID (0-3) and NewsBankrupcy (4-7)
088d3649dd4f (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8766
diff changeset
    91
	DNC_NONE          = 0xFF, ///< No news callback.
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    92
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    93
3139
4c950c7ec5c9 (svn r3757) -Feature: Delete news items about vehicles, when they get stale
tron
parents: 2186
diff changeset
    94
/**
9259
088d3649dd4f (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8766
diff changeset
    95
 * Kinds of bankrupcy
10160
11cc0b7750c2 (svn r12691) -Fix (r12459): all company related news displayed the 'company is in trouble' message
glx
parents: 9259
diff changeset
    96
 * @note These flags are or'd with player index
3139
4c950c7ec5c9 (svn r3757) -Feature: Delete news items about vehicles, when they get stale
tron
parents: 2186
diff changeset
    97
 */
9259
088d3649dd4f (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8766
diff changeset
    98
enum NewsBankrupcy {
10160
11cc0b7750c2 (svn r12691) -Fix (r12459): all company related news displayed the 'company is in trouble' message
glx
parents: 9259
diff changeset
    99
	NB_BTROUBLE    = (1 << 4), ///< Company is in trouble (warning)
11cc0b7750c2 (svn r12691) -Fix (r12459): all company related news displayed the 'company is in trouble' message
glx
parents: 9259
diff changeset
   100
	NB_BMERGER     = (2 << 4), ///< Company has been bought by another company
11cc0b7750c2 (svn r12691) -Fix (r12459): all company related news displayed the 'company is in trouble' message
glx
parents: 9259
diff changeset
   101
	NB_BBANKRUPT   = (3 << 4), ///< Company has gone bankrupt
11cc0b7750c2 (svn r12691) -Fix (r12459): all company related news displayed the 'company is in trouble' message
glx
parents: 9259
diff changeset
   102
	NB_BNEWCOMPANY = (4 << 4), ///< A new company has been started
9259
088d3649dd4f (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8766
diff changeset
   103
};
3139
4c950c7ec5c9 (svn r3757) -Feature: Delete news items about vehicles, when they get stale
tron
parents: 2186
diff changeset
   104
10253
1627c1fef7c8 (svn r12785) -Codechange: put all news-type related constants in the same array. Patch by cirdan.
rubidium
parents: 10160
diff changeset
   105
/**
10273
248661824a1e (svn r12805) -Codechange: remove some bit magic related to the news display states. Patch by cirdan.
rubidium
parents: 10253
diff changeset
   106
 * News display options
248661824a1e (svn r12805) -Codechange: remove some bit magic related to the news display states. Patch by cirdan.
rubidium
parents: 10253
diff changeset
   107
 */
248661824a1e (svn r12805) -Codechange: remove some bit magic related to the news display states. Patch by cirdan.
rubidium
parents: 10253
diff changeset
   108
enum NewsDisplay {
248661824a1e (svn r12805) -Codechange: remove some bit magic related to the news display states. Patch by cirdan.
rubidium
parents: 10253
diff changeset
   109
	ND_OFF,        ///< Only show a reminder in the status bar
248661824a1e (svn r12805) -Codechange: remove some bit magic related to the news display states. Patch by cirdan.
rubidium
parents: 10253
diff changeset
   110
	ND_SUMMARY,    ///< Show ticker
248661824a1e (svn r12805) -Codechange: remove some bit magic related to the news display states. Patch by cirdan.
rubidium
parents: 10253
diff changeset
   111
	ND_FULL,       ///< Show newspaper
248661824a1e (svn r12805) -Codechange: remove some bit magic related to the news display states. Patch by cirdan.
rubidium
parents: 10253
diff changeset
   112
};
248661824a1e (svn r12805) -Codechange: remove some bit magic related to the news display states. Patch by cirdan.
rubidium
parents: 10253
diff changeset
   113
248661824a1e (svn r12805) -Codechange: remove some bit magic related to the news display states. Patch by cirdan.
rubidium
parents: 10253
diff changeset
   114
/**
10253
1627c1fef7c8 (svn r12785) -Codechange: put all news-type related constants in the same array. Patch by cirdan.
rubidium
parents: 10160
diff changeset
   115
 * Per-NewsType data
1627c1fef7c8 (svn r12785) -Codechange: put all news-type related constants in the same array. Patch by cirdan.
rubidium
parents: 10160
diff changeset
   116
 */
1627c1fef7c8 (svn r12785) -Codechange: put all news-type related constants in the same array. Patch by cirdan.
rubidium
parents: 10160
diff changeset
   117
struct NewsTypeData {
1627c1fef7c8 (svn r12785) -Codechange: put all news-type related constants in the same array. Patch by cirdan.
rubidium
parents: 10160
diff changeset
   118
	const char *const name; ///< Name
1627c1fef7c8 (svn r12785) -Codechange: put all news-type related constants in the same array. Patch by cirdan.
rubidium
parents: 10160
diff changeset
   119
	const byte age;         ///< Maximum age of news items (in days)
1627c1fef7c8 (svn r12785) -Codechange: put all news-type related constants in the same array. Patch by cirdan.
rubidium
parents: 10160
diff changeset
   120
	const SoundFx sound;    ///< Sound
10273
248661824a1e (svn r12805) -Codechange: remove some bit magic related to the news display states. Patch by cirdan.
rubidium
parents: 10253
diff changeset
   121
	NewsDisplay display;    ///< Display mode (off, summary, full)
10253
1627c1fef7c8 (svn r12785) -Codechange: put all news-type related constants in the same array. Patch by cirdan.
rubidium
parents: 10160
diff changeset
   122
};
1627c1fef7c8 (svn r12785) -Codechange: put all news-type related constants in the same array. Patch by cirdan.
rubidium
parents: 10160
diff changeset
   123
9259
088d3649dd4f (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8766
diff changeset
   124
struct NewsItem {
10521
79e3bb000aed (svn r13065) -Codechange: remove the need for the news string callbacks. Patch by Cirdan.
rubidium
parents: 10478
diff changeset
   125
	StringID string_id;    ///< Message text
9259
088d3649dd4f (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8766
diff changeset
   126
	uint16 duration;       ///< Remaining time for showing this news message
088d3649dd4f (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8766
diff changeset
   127
	Date date;             ///< Date of the news
10556
ec733f5899fa (svn r13100) -Codechange: reduce the amount of parameters passed via AddNewsMessage as there is (for each news message type) a tuple of 4 parameters that is the same for all calls.
rubidium
parents: 10521
diff changeset
   128
	NewsSubtype subtype;   ///< News subtype @see NewsSubtype
9259
088d3649dd4f (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8766
diff changeset
   129
	NewsFlag flags;        ///< NewsFlags bits @see NewsFlag
088d3649dd4f (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8766
diff changeset
   130
10521
79e3bb000aed (svn r13065) -Codechange: remove the need for the news string callbacks. Patch by Cirdan.
rubidium
parents: 10478
diff changeset
   131
	uint data_a;           ///< Custom data 1 (usually tile or vehicle)
79e3bb000aed (svn r13065) -Codechange: remove the need for the news string callbacks. Patch by Cirdan.
rubidium
parents: 10478
diff changeset
   132
	uint data_b;           ///< Custom data 2
9259
088d3649dd4f (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8766
diff changeset
   133
088d3649dd4f (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8766
diff changeset
   134
	uint64 params[10];
088d3649dd4f (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8766
diff changeset
   135
};
088d3649dd4f (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8766
diff changeset
   136
088d3649dd4f (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8766
diff changeset
   137
typedef bool ValidationProc(uint data_a, uint data_b);
088d3649dd4f (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8766
diff changeset
   138
typedef void DrawNewsCallbackProc(Window *w, const NewsItem *ni);
088d3649dd4f (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8766
diff changeset
   139
088d3649dd4f (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8766
diff changeset
   140
#endif /* NEWS_TYPE_H */