src/news_type.h
author smatz
Wed, 24 Sep 2008 16:40:06 +0000
changeset 10184 bf4e3ff4cf16
parent 9909 e6d643caa7da
child 10207 c291a21b304e
permissions -rw-r--r--
(svn r14395) -Fix [FS#2285]: crashes and GUI desyncs when order is deleted/modified while the timetable window is open
-Fix: close any dropdown and child windows in the Order and Timetable windows when selected order is deselected, deleted, ...
2186
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 2101
diff changeset
     1
/* $Id$ */
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 2101
diff changeset
     2
8763
81fadd257f67 (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8270
diff changeset
     3
/** @file news_type.h Types related to news. */
6348
6dd01da7a02b (svn r9385) -Cleanup: doxygen changes. Today, we are exploring the letter N.
belugas
parents: 6283
diff changeset
     4
8763
81fadd257f67 (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8270
diff changeset
     5
#ifndef NEWS_TYPE_H
81fadd257f67 (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8270
diff changeset
     6
#define NEWS_TYPE_H
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     7
8140
0d0d8c94f84b (svn r11702) -Codechange: move all date related stuff to date*.
rubidium
parents: 8138
diff changeset
     8
#include "date_type.h"
8264
b1e85998c7d3 (svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h.
rubidium
parents: 8140
diff changeset
     9
#include "strings_type.h"
8990
0d5bb1c2a4a6 (svn r12785) -Codechange: put all news-type related constants in the same array. Patch by cirdan.
rubidium
parents: 8921
diff changeset
    10
#include "sound_type.h"
8106
e6790dd9e750 (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: 7891
diff changeset
    11
7598
626c6a804e6d (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7006
diff changeset
    12
/**
8763
81fadd257f67 (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8270
diff changeset
    13
 * Type of news.
7598
626c6a804e6d (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7006
diff changeset
    14
 */
4873
11880cbbc9f6 (svn r6803) -Codechange: Substitute magic numbers by an enum for the news windows
Darkvater
parents: 4344
diff changeset
    15
enum NewsType {
7598
626c6a804e6d (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7006
diff changeset
    16
	NT_ARRIVAL_PLAYER,  ///< Cargo arrived for player
626c6a804e6d (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7006
diff changeset
    17
	NT_ARRIVAL_OTHER,   ///< Cargo arrived for competitor
626c6a804e6d (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7006
diff changeset
    18
	NT_ACCIDENT,        ///< An accident or disaster has occurred
626c6a804e6d (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7006
diff changeset
    19
	NT_COMPANY_INFO,    ///< Company info (new companies, bankrupcy messages)
9739
9cf125da8789 (svn r13872) -Feature: Split the news message announcing opening and closure of industries into two news of their own
belugas
parents: 9658
diff changeset
    20
	NT_INDUSTRY_OPEN,   ///< Opening of industries
9cf125da8789 (svn r13872) -Feature: Split the news message announcing opening and closure of industries into two news of their own
belugas
parents: 9658
diff changeset
    21
	NT_INDUSTRY_CLOSE,  ///< Closing of industries
7598
626c6a804e6d (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7006
diff changeset
    22
	NT_ECONOMY,         ///< Economic changes (recession, industry up/dowm)
7891
aef0c16244d7 (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: 7598
diff changeset
    23
	NT_INDUSTRY_PLAYER, ///< Production changes of industry serviced by local player
aef0c16244d7 (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: 7598
diff changeset
    24
	NT_INDUSTRY_OTHER,  ///< Production changes of industry serviced by competitor(s)
aef0c16244d7 (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: 7598
diff changeset
    25
	NT_INDUSTRY_NOBODY, ///< Other industry production changes
7598
626c6a804e6d (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7006
diff changeset
    26
	NT_ADVICE,          ///< Bits of news about vehicles of the player
626c6a804e6d (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7006
diff changeset
    27
	NT_NEW_VEHICLES,    ///< New vehicle has become available
626c6a804e6d (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7006
diff changeset
    28
	NT_ACCEPTANCE,      ///< A type of cargo is (no longer) accepted
626c6a804e6d (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7006
diff changeset
    29
	NT_SUBSIDIES,       ///< News about subsidies (announcements, expirations, acceptance)
626c6a804e6d (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7006
diff changeset
    30
	NT_GENERAL,         ///< General news (from towns)
626c6a804e6d (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7006
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
7598
626c6a804e6d (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7006
diff changeset
    34
/**
9234
bfc9d27d3d0d (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: 9199
diff changeset
    35
 * News subtypes.
bfc9d27d3d0d (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: 9199
diff changeset
    36
 */
bfc9d27d3d0d (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: 9199
diff changeset
    37
enum NewsSubtype {
bfc9d27d3d0d (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: 9199
diff changeset
    38
	NS_ARRIVAL_PLAYER,   ///< NT_ARRIVAL_PLAYER
bfc9d27d3d0d (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: 9199
diff changeset
    39
	NS_ARRIVAL_OTHER,    ///< NT_ARRIVAL_OTHER
bfc9d27d3d0d (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: 9199
diff changeset
    40
	NS_ACCIDENT_TILE,    ///< NT_ACCIDENT (tile)
bfc9d27d3d0d (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: 9199
diff changeset
    41
	NS_ACCIDENT_VEHICLE, ///< NT_ACCIDENT (vehicle)
bfc9d27d3d0d (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: 9199
diff changeset
    42
	NS_COMPANY_TROUBLE,  ///< NT_COMPANY_INFO (trouble)
bfc9d27d3d0d (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: 9199
diff changeset
    43
	NS_COMPANY_MERGER,   ///< NT_COMPANY_INFO (merger)
bfc9d27d3d0d (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: 9199
diff changeset
    44
	NS_COMPANY_BANKRUPT, ///< NT_COMPANY_INFO (bankrupt)
bfc9d27d3d0d (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: 9199
diff changeset
    45
	NS_COMPANY_NEW,      ///< NT_COMPANY_INFO (new company)
9909
e6d643caa7da (svn r14059) -Fix(r13872): Wrong comments in enum. Dear old copy/paste...
belugas
parents: 9739
diff changeset
    46
	NS_INDUSTRY_OPEN,    ///< NT_INDUSTRY_OPEN
e6d643caa7da (svn r14059) -Fix(r13872): Wrong comments in enum. Dear old copy/paste...
belugas
parents: 9739
diff changeset
    47
	NS_INDUSTRY_CLOSE,   ///< NT_INDUSTRY_CLOSE
9234
bfc9d27d3d0d (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: 9199
diff changeset
    48
	NS_ECONOMY,          ///< NT_ECONOMY
bfc9d27d3d0d (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: 9199
diff changeset
    49
	NS_INDUSTRY_PLAYER,  ///< NT_INDUSTRY_PLAYER
bfc9d27d3d0d (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: 9199
diff changeset
    50
	NS_INDUSTRY_OTHER,   ///< NT_INDUSTRY_OTHER
bfc9d27d3d0d (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: 9199
diff changeset
    51
	NS_INDUSTRY_NOBODY,  ///< NT_INDUSTRY_NOBODY
bfc9d27d3d0d (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: 9199
diff changeset
    52
	NS_ADVICE,           ///< NT_ADVICE
bfc9d27d3d0d (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: 9199
diff changeset
    53
	NS_NEW_VEHICLES,     ///< NT_NEW_VEHICLES
bfc9d27d3d0d (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: 9199
diff changeset
    54
	NS_ACCEPTANCE,       ///< NT_ACCEPTANCE
bfc9d27d3d0d (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: 9199
diff changeset
    55
	NS_SUBSIDIES,        ///< NT_SUBSIDIES
bfc9d27d3d0d (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: 9199
diff changeset
    56
	NS_GENERAL,          ///< NT_GENERAL
bfc9d27d3d0d (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: 9199
diff changeset
    57
	NS_END,              ///< end-of-array marker
bfc9d27d3d0d (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: 9199
diff changeset
    58
};
bfc9d27d3d0d (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: 9199
diff changeset
    59
bfc9d27d3d0d (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: 9199
diff changeset
    60
/**
7598
626c6a804e6d (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7006
diff changeset
    61
 * News mode.
626c6a804e6d (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7006
diff changeset
    62
 */
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    63
enum NewsMode {
4873
11880cbbc9f6 (svn r6803) -Codechange: Substitute magic numbers by an enum for the news windows
Darkvater
parents: 4344
diff changeset
    64
	NM_SMALL    = 0, ///< Show only a small popup informing us about vehicle age for example
11880cbbc9f6 (svn r6803) -Codechange: Substitute magic numbers by an enum for the news windows
Darkvater
parents: 4344
diff changeset
    65
	NM_NORMAL   = 1, ///< Show a simple news message (height 170 pixels)
11880cbbc9f6 (svn r6803) -Codechange: Substitute magic numbers by an enum for the news windows
Darkvater
parents: 4344
diff changeset
    66
	NM_THIN     = 2, ///< Show a simple news message (height 130 pixels)
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
7598
626c6a804e6d (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7006
diff changeset
    69
/**
626c6a804e6d (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7006
diff changeset
    70
 * Various OR-able news-item flags.
626c6a804e6d (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7006
diff changeset
    71
 * note: NF_INCOLOR is set automatically if needed
626c6a804e6d (svn r11125) -Documentation: add/update the documentation of news*. Based on a patch by Progman.
rubidium
parents: 7006
diff changeset
    72
 */
8763
81fadd257f67 (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8270
diff changeset
    73
enum NewsFlag {
81fadd257f67 (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8270
diff changeset
    74
	NF_NONE      = 0,        ///< No flag is set.
4873
11880cbbc9f6 (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)
9158
b2de54b781eb (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: 9010
diff changeset
    76
	NF_TILE      = (1 << 2), ///< When clicked on the news message scroll to a given tile? Tile is in data_a
4873
11880cbbc9f6 (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
4874
afafed841c6d (svn r6804) -Codechange: Remove the unused NF_NOEXPIRE flag.
Darkvater
parents: 4873
diff changeset
    78
	NF_INCOLOR   = (1 << 5), ///< Show the newsmessage in colour, otherwise it defaults to black & white
9158
b2de54b781eb (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: 9010
diff changeset
    79
	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
    80
};
8763
81fadd257f67 (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8270
diff changeset
    81
DECLARE_ENUM_AS_BIT_SET(NewsFlag);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    82
8763
81fadd257f67 (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8270
diff changeset
    83
81fadd257f67 (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8270
diff changeset
    84
/**
9010
fa1aa6008a59 (svn r12805) -Codechange: remove some bit magic related to the news display states. Patch by cirdan.
rubidium
parents: 8990
diff changeset
    85
 * News display options
fa1aa6008a59 (svn r12805) -Codechange: remove some bit magic related to the news display states. Patch by cirdan.
rubidium
parents: 8990
diff changeset
    86
 */
fa1aa6008a59 (svn r12805) -Codechange: remove some bit magic related to the news display states. Patch by cirdan.
rubidium
parents: 8990
diff changeset
    87
enum NewsDisplay {
fa1aa6008a59 (svn r12805) -Codechange: remove some bit magic related to the news display states. Patch by cirdan.
rubidium
parents: 8990
diff changeset
    88
	ND_OFF,        ///< Only show a reminder in the status bar
fa1aa6008a59 (svn r12805) -Codechange: remove some bit magic related to the news display states. Patch by cirdan.
rubidium
parents: 8990
diff changeset
    89
	ND_SUMMARY,    ///< Show ticker
fa1aa6008a59 (svn r12805) -Codechange: remove some bit magic related to the news display states. Patch by cirdan.
rubidium
parents: 8990
diff changeset
    90
	ND_FULL,       ///< Show newspaper
fa1aa6008a59 (svn r12805) -Codechange: remove some bit magic related to the news display states. Patch by cirdan.
rubidium
parents: 8990
diff changeset
    91
};
fa1aa6008a59 (svn r12805) -Codechange: remove some bit magic related to the news display states. Patch by cirdan.
rubidium
parents: 8990
diff changeset
    92
fa1aa6008a59 (svn r12805) -Codechange: remove some bit magic related to the news display states. Patch by cirdan.
rubidium
parents: 8990
diff changeset
    93
/**
8990
0d5bb1c2a4a6 (svn r12785) -Codechange: put all news-type related constants in the same array. Patch by cirdan.
rubidium
parents: 8921
diff changeset
    94
 * Per-NewsType data
0d5bb1c2a4a6 (svn r12785) -Codechange: put all news-type related constants in the same array. Patch by cirdan.
rubidium
parents: 8921
diff changeset
    95
 */
0d5bb1c2a4a6 (svn r12785) -Codechange: put all news-type related constants in the same array. Patch by cirdan.
rubidium
parents: 8921
diff changeset
    96
struct NewsTypeData {
0d5bb1c2a4a6 (svn r12785) -Codechange: put all news-type related constants in the same array. Patch by cirdan.
rubidium
parents: 8921
diff changeset
    97
	const char *const name; ///< Name
0d5bb1c2a4a6 (svn r12785) -Codechange: put all news-type related constants in the same array. Patch by cirdan.
rubidium
parents: 8921
diff changeset
    98
	const byte age;         ///< Maximum age of news items (in days)
0d5bb1c2a4a6 (svn r12785) -Codechange: put all news-type related constants in the same array. Patch by cirdan.
rubidium
parents: 8921
diff changeset
    99
	const SoundFx sound;    ///< Sound
9010
fa1aa6008a59 (svn r12805) -Codechange: remove some bit magic related to the news display states. Patch by cirdan.
rubidium
parents: 8990
diff changeset
   100
	NewsDisplay display;    ///< Display mode (off, summary, full)
8990
0d5bb1c2a4a6 (svn r12785) -Codechange: put all news-type related constants in the same array. Patch by cirdan.
rubidium
parents: 8921
diff changeset
   101
};
0d5bb1c2a4a6 (svn r12785) -Codechange: put all news-type related constants in the same array. Patch by cirdan.
rubidium
parents: 8921
diff changeset
   102
8763
81fadd257f67 (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8270
diff changeset
   103
struct NewsItem {
9406
f85d149506a9 (svn r13317) -Codechange: make news messages use a linked list instead of a moving circular buffer. This makes it possible to store more news messages in the history. Based on a patch by Cirdan.
rubidium
parents: 9313
diff changeset
   104
	NewsItem *prev;        ///< Previous news item
f85d149506a9 (svn r13317) -Codechange: make news messages use a linked list instead of a moving circular buffer. This makes it possible to store more news messages in the history. Based on a patch by Cirdan.
rubidium
parents: 9313
diff changeset
   105
	NewsItem *next;        ///< Next news item
9199
ce9fbdff6581 (svn r13065) -Codechange: remove the need for the news string callbacks. Patch by Cirdan.
rubidium
parents: 9158
diff changeset
   106
	StringID string_id;    ///< Message text
8763
81fadd257f67 (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8270
diff changeset
   107
	Date date;             ///< Date of the news
9234
bfc9d27d3d0d (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: 9199
diff changeset
   108
	NewsSubtype subtype;   ///< News subtype @see NewsSubtype
8763
81fadd257f67 (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8270
diff changeset
   109
	NewsFlag flags;        ///< NewsFlags bits @see NewsFlag
81fadd257f67 (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8270
diff changeset
   110
9199
ce9fbdff6581 (svn r13065) -Codechange: remove the need for the news string callbacks. Patch by Cirdan.
rubidium
parents: 9158
diff changeset
   111
	uint data_a;           ///< Custom data 1 (usually tile or vehicle)
ce9fbdff6581 (svn r13065) -Codechange: remove the need for the news string callbacks. Patch by Cirdan.
rubidium
parents: 9158
diff changeset
   112
	uint data_b;           ///< Custom data 2
8763
81fadd257f67 (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8270
diff changeset
   113
9658
f5c4d3c04b5d (svn r13730) -Fix: make a copy of the names for news messages about the deletion of companies as the removal of a company could lead to wrong names in the news messages.
rubidium
parents: 9469
diff changeset
   114
	void *free_data;       ///< Data to be freed when the news item has reached it's end.
f5c4d3c04b5d (svn r13730) -Fix: make a copy of the names for news messages about the deletion of companies as the removal of a company could lead to wrong names in the news messages.
rubidium
parents: 9469
diff changeset
   115
8763
81fadd257f67 (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8270
diff changeset
   116
	uint64 params[10];
81fadd257f67 (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8270
diff changeset
   117
};
81fadd257f67 (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8270
diff changeset
   118
9658
f5c4d3c04b5d (svn r13730) -Fix: make a copy of the names for news messages about the deletion of companies as the removal of a company could lead to wrong names in the news messages.
rubidium
parents: 9469
diff changeset
   119
/**
f5c4d3c04b5d (svn r13730) -Fix: make a copy of the names for news messages about the deletion of companies as the removal of a company could lead to wrong names in the news messages.
rubidium
parents: 9469
diff changeset
   120
 * Data that needs to be stored for company news messages.
f5c4d3c04b5d (svn r13730) -Fix: make a copy of the names for news messages about the deletion of companies as the removal of a company could lead to wrong names in the news messages.
rubidium
parents: 9469
diff changeset
   121
 * The problem with company news messages are the custom name
f5c4d3c04b5d (svn r13730) -Fix: make a copy of the names for news messages about the deletion of companies as the removal of a company could lead to wrong names in the news messages.
rubidium
parents: 9469
diff changeset
   122
 * of the companies and the fact that the company data is reset,
f5c4d3c04b5d (svn r13730) -Fix: make a copy of the names for news messages about the deletion of companies as the removal of a company could lead to wrong names in the news messages.
rubidium
parents: 9469
diff changeset
   123
 * resulting in wrong names and such.
f5c4d3c04b5d (svn r13730) -Fix: make a copy of the names for news messages about the deletion of companies as the removal of a company could lead to wrong names in the news messages.
rubidium
parents: 9469
diff changeset
   124
 */
f5c4d3c04b5d (svn r13730) -Fix: make a copy of the names for news messages about the deletion of companies as the removal of a company could lead to wrong names in the news messages.
rubidium
parents: 9469
diff changeset
   125
struct CompanyNewsInformation {
f5c4d3c04b5d (svn r13730) -Fix: make a copy of the names for news messages about the deletion of companies as the removal of a company could lead to wrong names in the news messages.
rubidium
parents: 9469
diff changeset
   126
	char company_name[64];       ///< The name of the company
f5c4d3c04b5d (svn r13730) -Fix: make a copy of the names for news messages about the deletion of companies as the removal of a company could lead to wrong names in the news messages.
rubidium
parents: 9469
diff changeset
   127
	char president_name[64];     ///< The name of the president
f5c4d3c04b5d (svn r13730) -Fix: make a copy of the names for news messages about the deletion of companies as the removal of a company could lead to wrong names in the news messages.
rubidium
parents: 9469
diff changeset
   128
	char other_company_name[64]; ///< The name of the company taking over this one
f5c4d3c04b5d (svn r13730) -Fix: make a copy of the names for news messages about the deletion of companies as the removal of a company could lead to wrong names in the news messages.
rubidium
parents: 9469
diff changeset
   129
f5c4d3c04b5d (svn r13730) -Fix: make a copy of the names for news messages about the deletion of companies as the removal of a company could lead to wrong names in the news messages.
rubidium
parents: 9469
diff changeset
   130
	uint32 face; ///< The face of the president
f5c4d3c04b5d (svn r13730) -Fix: make a copy of the names for news messages about the deletion of companies as the removal of a company could lead to wrong names in the news messages.
rubidium
parents: 9469
diff changeset
   131
	byte colour; ///< The colour related to the company
f5c4d3c04b5d (svn r13730) -Fix: make a copy of the names for news messages about the deletion of companies as the removal of a company could lead to wrong names in the news messages.
rubidium
parents: 9469
diff changeset
   132
f5c4d3c04b5d (svn r13730) -Fix: make a copy of the names for news messages about the deletion of companies as the removal of a company could lead to wrong names in the news messages.
rubidium
parents: 9469
diff changeset
   133
	void FillData(const struct Player *p, const struct Player *other = NULL);
f5c4d3c04b5d (svn r13730) -Fix: make a copy of the names for news messages about the deletion of companies as the removal of a company could lead to wrong names in the news messages.
rubidium
parents: 9469
diff changeset
   134
};
f5c4d3c04b5d (svn r13730) -Fix: make a copy of the names for news messages about the deletion of companies as the removal of a company could lead to wrong names in the news messages.
rubidium
parents: 9469
diff changeset
   135
8763
81fadd257f67 (svn r12459) -Codechange: split news.h into news_type.h and news_func.h.
rubidium
parents: 8270
diff changeset
   136
#endif /* NEWS_TYPE_H */