|
OpenTTD Source 15.0-beta1
|
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_t ref1, NewsReferenceType reftype2, uint32_t ref2, std::unique_ptr< NewsAllocatedData > &&data) | |
| Create a new newsitem to be shown. | |
Data Fields | |
| StringID | string_id |
| Message text. | |
| TimerGameCalendar::Date | date |
| Calendar date to show for the news. | |
| TimerGameEconomy::Date | economy_date |
| Economy date of the news item, never shown but used to calculate age. | |
| NewsType | type |
| Type of the news. | |
| NewsFlag | flags |
| NewsFlags bits. | |
| NewsReferenceType | reftype1 |
| Type of ref1. | |
| NewsReferenceType | reftype2 |
| Type of ref2. | |
| uint32_t | 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_t | 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< NewsAllocatedData > | data |
| Custom data for the news item that will be deallocated (deleted) when the news item has reached its end. | |
| std::vector< StringParameterData > | params |
| Parameters for string resolving. | |
Information about a single item of news.
Definition at line 128 of file news_type.h.
| NewsItem::NewsItem | ( | StringID | string_id, |
| NewsType | type, | ||
| NewsFlag | flags, | ||
| NewsReferenceType | reftype1, | ||
| uint32_t | ref1, | ||
| NewsReferenceType | reftype2, | ||
| uint32_t | ref2, | ||
| std::unique_ptr< NewsAllocatedData > && | data | ||
| ) |
Create a new newsitem to be shown.
| string_id | String to display. |
| type | The type of news. |
| flags | Flags related to how to display the news. |
| reftype1 | Type of ref1. |
| 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. |
| reftype2 | Type of ref2. |
| ref2 | Reference 2 to some object: Used for scrolling after clicking on the news, and for deleting the news when the object is deleted. |
| data | Pointer to data that must be released once the news message is cleared. |
Definition at line 876 of file news_gui.cpp.
References _settings_client, GUISettings::coloured_news_year, CopyOutDParam(), ClientSettings::gui, NF_INCOLOUR, params, and TimerGameCalendar::year.
| std::unique_ptr<NewsAllocatedData> NewsItem::data |
Custom data for the news item that will be deallocated (deleted) when the news item has reached its end.
Definition at line 140 of file news_type.h.
Referenced by NewsWindow::DrawWidget(), and NewsWindow::OnResize().
| TimerGameCalendar::Date NewsItem::date |
Calendar date to show for the news.
Definition at line 130 of file news_type.h.
Referenced by MessageHistoryWindow::DrawWidget(), and NewsWindow::SetStringParameters().
| TimerGameEconomy::Date NewsItem::economy_date |
Economy date of the news item, never shown but used to calculate age.
Definition at line 131 of file news_type.h.
| NewsFlag NewsItem::flags |
NewsFlags bits.
Definition at line 133 of file news_type.h.
Referenced by ChangeVehicleNews(), and ShowNewspaper().
| std::vector<StringParameterData> NewsItem::params |
Parameters for string resolving.
Definition at line 142 of file news_type.h.
Referenced by ChangeVehicleNews(), DrawNewsString(), NewsWindow::DrawWidget(), NewsItem(), and NewsWindow::UpdateWidgetSize().
| uint32_t NewsItem::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.
Definition at line 137 of file news_type.h.
Referenced by ChangeVehicleNews(), DeleteIndustryNews(), DeleteInvalidEngineNews(), DeleteStationNews(), DeleteVehicleNews(), NewsWindow::DrawWidget(), NewsWindow::OnClick(), NewsWindow::OnResize(), and NewsWindow::UpdateWidgetSize().
| uint32_t NewsItem::ref2 |
Reference 2 to some object: Used for scrolling after clicking on the news, and for deleting the news when the object is deleted.
Definition at line 138 of file news_type.h.
Referenced by ChangeVehicleNews(), DeleteIndustryNews(), DeleteInvalidEngineNews(), DeleteStationNews(), and DeleteVehicleNews().
| NewsReferenceType NewsItem::reftype1 |
Type of ref1.
Definition at line 135 of file news_type.h.
Referenced by ChangeVehicleNews(), DeleteIndustryNews(), DeleteInvalidEngineNews(), DeleteStationNews(), DeleteVehicleNews(), NewsWindow::DrawWidget(), NewsWindow::OnClick(), NewsWindow::OnResize(), and NewsWindow::UpdateWidgetSize().
| NewsReferenceType NewsItem::reftype2 |
Type of ref2.
Definition at line 136 of file news_type.h.
Referenced by ChangeVehicleNews(), DeleteIndustryNews(), DeleteInvalidEngineNews(), DeleteStationNews(), DeleteVehicleNews(), and NewsWindow::OnClick().
| StringID NewsItem::string_id |
Message text.
Definition at line 129 of file news_type.h.
Referenced by DeleteVehicleNews(), DrawNewsString(), and NewsWindow::UpdateWidgetSize().
| NewsType NewsItem::type |