OpenTTD Source  12.0-beta2
NewsItem Struct Reference

Information about a single item of news. More...

#include <news_type.h>

Public Member Functions

 NewsItem (StringID string_id, NewsType type, NewsFlag flags, NewsReferenceType reftype1, uint32 ref1, NewsReferenceType reftype2, uint32 ref2, const NewsAllocatedData *data)
 Create a new newsitem to be shown. More...
 

Data Fields

NewsItemprev
 Previous news item.
 
NewsItemnext
 Next news item.
 
StringID string_id
 Message text.
 
Date date
 Date of the news.
 
NewsType type
 Type of the news.
 
NewsFlag flags
 NewsFlags bits. More...
 
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 deleting the news when the object is deleted.
 
uint32 ref2
 Reference 2 to some object: Used for scrolling after clicking on the news, and for deleting the news when the object is deleted.
 
std::unique_ptr< const NewsAllocatedDatadata
 Custom data for the news item that will be deallocated (deleted) when the news item has reached its end.
 
uint64 params [10]
 Parameters for string resolving.
 

Detailed Description

Information about a single item of news.

Definition at line 125 of file news_type.h.

Constructor & Destructor Documentation

◆ NewsItem()

NewsItem::NewsItem ( StringID  string_id,
NewsType  type,
NewsFlag  flags,
NewsReferenceType  reftype1,
uint32  ref1,
NewsReferenceType  reftype2,
uint32  ref2,
const NewsAllocatedData data 
)

Create a new newsitem to be shown.

Parameters
string_idString to display.
typeThe type of news.
flagsFlags related to how to display the news.
reftype1Type of ref1.
ref1Reference 1 to some object: Used for a possible viewport, scrolling after clicking on the news, and for deleting the news when the object is deleted.
reftype2Type of ref2.
ref2Reference 2 to some object: Used for scrolling after clicking on the news, and for deleting the news when the object is deleted.
dataPointer to data that must be released once the news message is cleared.
See also
NewsSubtype

Definition at line 786 of file news_gui.cpp.

References _cur_year, _settings_client, GUISettings::coloured_news_year, CopyOutDParam(), ClientSettings::gui, lengthof, NF_INCOLOUR, and params.

Field Documentation

◆ flags

NewsFlag NewsItem::flags

NewsFlags bits.

See also
NewsFlag

Definition at line 131 of file news_type.h.

Referenced by ChangeVehicleNews().


The documentation for this struct was generated from the following files: