OpenTTD
Data Structures | Enumerations
news_type.h File Reference

Types related to news. More...

#include "core/enum_type.hpp"
#include "date_type.h"
#include "strings_type.h"
#include "sound_type.h"

Go to the source code of this file.

Data Structures

struct  NewsTypeData
 Per-NewsType data. More...
 
struct  NewsItem
 Information about a single item of news. More...
 
struct  CompanyNewsInformation
 Data that needs to be stored for company news messages. More...
 

Enumerations

enum  MessageOptionsSpace {
  MOS_WIDG_PER_SETTING = 4, MOS_LEFT_EDGE = 6, MOS_COLUMN_SPACING = 4, MOS_RIGHT_EDGE = 6,
  MOS_BUTTON_SPACE = 10, MOS_ABOVE_GLOBAL_SETTINGS = 6, MOS_BOTTOM_EDGE = 6
}
 Constants in the message options window. More...
 
enum  NewsType {
  NT_ARRIVAL_COMPANY, NT_ARRIVAL_OTHER, NT_ACCIDENT, NT_COMPANY_INFO,
  NT_INDUSTRY_OPEN, NT_INDUSTRY_CLOSE, NT_ECONOMY, NT_INDUSTRY_COMPANY,
  NT_INDUSTRY_OTHER, NT_INDUSTRY_NOBODY, NT_ADVICE, NT_NEW_VEHICLES,
  NT_ACCEPTANCE, NT_SUBSIDIES, NT_GENERAL, NT_END
}
 Type of news. More...
 
enum  NewsReferenceType {
  NR_NONE, NR_TILE, NR_VEHICLE, NR_STATION,
  NR_INDUSTRY, NR_TOWN, NR_ENGINE
}
 References to objects in news. More...
 
enum  NewsFlag {
  NFB_INCOLOUR = 0, NFB_NO_TRANSPARENT = 1, NFB_SHADE = 2, NFB_WINDOW_LAYOUT = 3,
  NFB_WINDOW_LAYOUT_COUNT = 3, NFB_VEHICLE_PARAM0 = 6, NF_INCOLOUR = 1 << NFB_INCOLOUR, NF_NO_TRANSPARENT = 1 << NFB_NO_TRANSPARENT,
  NF_SHADE = 1 << NFB_SHADE, NF_VEHICLE_PARAM0 = 1 << NFB_VEHICLE_PARAM0, NF_THIN = 0 << NFB_WINDOW_LAYOUT, NF_SMALL = 1 << NFB_WINDOW_LAYOUT,
  NF_NORMAL = 2 << NFB_WINDOW_LAYOUT, NF_VEHICLE = 3 << NFB_WINDOW_LAYOUT, NF_COMPANY = 4 << NFB_WINDOW_LAYOUT
}
 Various OR-able news-item flags. More...
 
enum  NewsDisplay { ND_OFF, ND_SUMMARY, ND_FULL }
 News display options. More...
 

Detailed Description

Types related to news.

Definition in file news_type.h.

Enumeration Type Documentation

◆ MessageOptionsSpace

Constants in the message options window.

Enumerator
MOS_WIDG_PER_SETTING 

Number of widgets needed for each news category, starting at widget #WID_MO_START_OPTION.

MOS_LEFT_EDGE 

Number of pixels between left edge of the window and the options buttons column.

MOS_COLUMN_SPACING 

Number of pixels between the buttons and the description columns.

MOS_RIGHT_EDGE 

Number of pixels between right edge of the window and the options descriptions column.

MOS_BUTTON_SPACE 

Additional space in the button with the option value (for better looks).

MOS_ABOVE_GLOBAL_SETTINGS 

Number of vertical pixels between the categories and the global options.

MOS_BOTTOM_EDGE 

Number of pixels between bottom edge of the window and bottom of the global options.

Definition at line 21 of file news_type.h.

◆ NewsDisplay

News display options.

Enumerator
ND_OFF 

Only show a reminder in the status bar.

ND_SUMMARY 

Show ticker.

ND_FULL 

Show newspaper.

Definition at line 103 of file news_type.h.

◆ NewsFlag

enum NewsFlag

Various OR-able news-item flags.

Note
NF_INCOLOUR is set automatically if needed.
Enumerator
NFB_INCOLOUR 

News item is shown in colour (otherwise it is shown in black & white).

NFB_NO_TRANSPARENT 

News item disables transparency in the viewport.

NFB_SHADE 

News item uses shaded colours.

NFB_WINDOW_LAYOUT 

First bit for window layout.

NFB_WINDOW_LAYOUT_COUNT 

Number of bits for window layout.

NFB_VEHICLE_PARAM0 

String param 0 contains a vehicle ID. (special autoreplace behaviour)

NF_INCOLOUR 

Bit value for coloured news.

NF_NO_TRANSPARENT 

Bit value for disabling transparency.

NF_SHADE 

Bit value for enabling shading.

NF_VEHICLE_PARAM0 

Bit value for specifying that string param 0 contains a vehicle ID. (special autoreplace behaviour)

NF_THIN 

Thin news item. (Newspaper with headline and viewport)

NF_SMALL 

Small news item. (Information window with text and viewport)

NF_NORMAL 

Normal news item. (Newspaper with text only)

NF_VEHICLE 

Vehicle news item. (new engine available)

NF_COMPANY 

Company news item. (Newspaper with face)

Definition at line 78 of file news_type.h.

◆ NewsReferenceType

References to objects in news.

Warning
Be careful! Vehicles are a special case, as news are kept when vehicles are autoreplaced/renewed. You have to make sure, ChangeVehicleNews catches the DParams of your message. This is NOT ensured by the references.
Enumerator
NR_NONE 

Empty reference.

NR_TILE 

Reference tile. Scroll to tile when clicking on the news.

NR_VEHICLE 

Reference vehicle. Scroll to vehicle when clicking on the news. Delete news when vehicle is deleted.

NR_STATION 

Reference station. Scroll to station when clicking on the news. Delete news when station is deleted.

NR_INDUSTRY 

Reference industry. Scroll to industry when clicking on the news. Delete news when industry is deleted.

NR_TOWN 

Reference town. Scroll to town when clicking on the news.

NR_ENGINE 

Reference engine.

Definition at line 64 of file news_type.h.

◆ NewsType

enum NewsType

Type of news.

Enumerator
NT_ARRIVAL_COMPANY 

First vehicle arrived for company.

NT_ARRIVAL_OTHER 

First vehicle arrived for competitor.

NT_ACCIDENT 

An accident or disaster has occurred.

NT_COMPANY_INFO 

Company info (new companies, bankruptcy messages)

NT_INDUSTRY_OPEN 

Opening of industries.

NT_INDUSTRY_CLOSE 

Closing of industries.

NT_ECONOMY 

Economic changes (recession, industry up/dowm)

NT_INDUSTRY_COMPANY 

Production changes of industry serviced by local company.

NT_INDUSTRY_OTHER 

Production changes of industry serviced by competitor(s)

NT_INDUSTRY_NOBODY 

Other industry production changes.

NT_ADVICE 

Bits of news about vehicles of the company.

NT_NEW_VEHICLES 

New vehicle has become available.

NT_ACCEPTANCE 

A type of cargo is (no longer) accepted.

NT_SUBSIDIES 

News about subsidies (announcements, expirations, acceptance)

NT_GENERAL 

General news (from towns)

NT_END 

end-of-array marker

Definition at line 36 of file news_type.h.