|
@@ -110,55 +110,63 @@ enum NewsDisplay {
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* Per-NewsType data
|
|
|
*/
|
|
|
struct NewsTypeData {
|
|
|
const char * const name; ///< Name
|
|
|
const byte age; ///< Maximum age of news items (in days)
|
|
|
const SoundFx sound; ///< Sound
|
|
|
NewsDisplay display; ///< Display mode (off, summary, full)
|
|
|
const StringID description; ///< Description of the news type in news settings window
|
|
|
|
|
|
/**
|
|
|
* Construct this entry.
|
|
|
* @param name The name of the type.
|
|
|
* @param age The maximum age for these messages.
|
|
|
* @param sound The sound to play.
|
|
|
* @param description The description for this type of messages.
|
|
|
*/
|
|
|
NewsTypeData(const char *name, byte age, SoundFx sound, StringID description) :
|
|
|
name(name),
|
|
|
age(age),
|
|
|
sound(sound),
|
|
|
display(ND_FULL),
|
|
|
description(description)
|
|
|
{
|
|
|
}
|
|
|
};
|
|
|
|
|
|
/** Information about a single item of news. */
|
|
|
struct NewsItem {
|
|
|
NewsItem *prev; ///< Previous news item
|
|
|
NewsItem *next; ///< Next news item
|
|
|
StringID string_id; ///< Message text
|
|
|
Date date; ///< Date of the news
|
|
|
NewsSubtype subtype; ///< News subtype @see NewsSubtype
|
|
|
NewsFlag flags; ///< NewsFlags bits @see NewsFlag
|
|
|
|
|
|
NewsReferenceType reftype1; ///< Type of ref1
|
|
|
NewsReferenceType reftype2; ///< Type of ref2
|
|
|
uint32 ref1; ///< Reference 1 to some object: Used for a possible viewport, scrolling after clicking on the news, and for deleteing the news when the object is deleted.
|
|
|
uint32 ref2; ///< Reference 2 to some object: Used for scrolling after clicking on the news, and for deleteing the news when the object is deleted.
|
|
|
|
|
|
void *free_data; ///< Data to be freed when the news item has reached its end.
|
|
|
|
|
|
~NewsItem()
|
|
|
{
|
|
|
free(this->free_data);
|
|
|
}
|
|
|
|
|
|
uint64 params[10];
|
|
|
uint64 params[10]; ///< Parameters for string resolving.
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* Data that needs to be stored for company news messages.
|
|
|
* The problem with company news messages are the custom name
|
|
|
* of the companies and the fact that the company data is reset,
|
|
|
* resulting in wrong names and such.
|
|
|
*/
|
|
|
struct CompanyNewsInformation {
|
|
|
char company_name[64]; ///< The name of the company
|
|
|
char president_name[64]; ///< The name of the president
|
|
|
char other_company_name[64]; ///< The name of the company taking over this one
|