# news_gui.cpp File Reference

GUI functions related to news messages. More...

`#include "stdafx.h"`
`#include "gui.h"`
`#include "viewport_func.h"`
`#include "news_type.h"`
`#include "strings_func.h"`
`#include "window_func.h"`
`#include "date_func.h"`
`#include "vehicle_base.h"`
`#include "vehicle_func.h"`
`#include "station_base.h"`
`#include "industry.h"`
`#include "town.h"`
`#include "sound_func.h"`
`#include "string_func.h"`
`#include "widgets/dropdown_func.h"`
`#include "statusbar_gui.h"`
`#include "company_manager_face.h"`
`#include "company_func.h"`
`#include "engine_gui.h"`
`#include "core/geometry_func.hpp"`
`#include "table/strings.h"`

Go to the source code of this file.

## Data Structures
struct | NewsSubtypeData
| Data common to all news items of a given subtype (structure). More...
struct | NewsWindow
| Window class displaying a news item. More...
struct | MessageHistoryWindow
struct | MessageOptionsWindow
## Enumerations
enum | NewsTypeWidgets { NTW_PANEL, NTW_TITLE, NTW_HEADLINE, NTW_CLOSEBOX, NTW_DATE, NTW_CAPTION, NTW_INSET, NTW_VIEWPORT, NTW_COMPANY_MSG, NTW_MESSAGE, NTW_MGR_FACE, NTW_MGR_NAME, NTW_VEH_TITLE, NTW_VEH_BKGND, NTW_VEH_NAME, NTW_VEH_SPR, NTW_VEH_INFO }
| Widget numbers of the news display windows. More...
enum | MessageHistoryWidgets { MHW_STICKYBOX, MHW_BACKGROUND, MHW_SCROLLBAR }
| Widget numbers of the message history window. More...
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 | MessageOptionWidgets { WIDGET_NEWSOPT_BACKGROUND, WIDGET_NEWSOPT_LABEL, WIDGET_NEWSOPT_DROP_SUMMARY, WIDGET_NEWSOPT_LABEL_SUMMARY, WIDGET_NEWSOPT_SOUNDTICKER, WIDGET_NEWSOPT_SOUNDTICKER_LABEL, WIDGET_NEWSOPT_START_OPTION, WIDGET_NEWSOPT_END_OPTION = WIDGET_NEWSOPT_START_OPTION + NT_END * MOS_WIDG_PER_SETTING }
| Message options widget numbers. More...
## Functions
static TileIndex | GetReferenceTile (NewsReferenceType reftype, uint32 ref)
| Get the position a news-reference is referencing.
| assert_compile (lengthof(_news_subtype_data)==NS_END)
| assert_compile (lengthof(_news_type_data)==NT_END)
static void | ShowNewspaper (const NewsItem *ni)
| Open up an own newspaper window for the news item.
static void | ShowTicker (const NewsItem *ni)
| Show news item in the ticker.
void | InitNewsItemStructs ()
| Initialize the news-items data structures.
static bool | ReadyForNextItem ()
| Are we ready to show another news item? Only if nothing is in the newsticker and no newspaper is displayed.
static void | MoveToNextItem ()
| Move to the next news item.
void | AddNewsItem (StringID string, NewsSubtype subtype, NewsReferenceType reftype1, uint32 ref1, NewsReferenceType reftype2, uint32 ref2, void *free_data)
| Add a new newsitem to be shown.
static void | DeleteNewsItem (NewsItem *ni)
| Delete a news item from the queue.
void | DeleteVehicleNews (VehicleID vid, StringID news)
| Delete a news item type about a vehicle if the news item type is INVALID_STRING_ID all news about the vehicle get deleted.
void | DeleteStationNews (StationID sid)
| Remove news regarding given station so there are no 'unknown station now accepts Mail' or 'First train arrived at unknown station' news items.
void | DeleteIndustryNews (IndustryID iid)
| Remove news regarding given industry.
static void | RemoveOldNewsItems ()
void | ChangeVehicleNews (VehicleID from_index, VehicleID to_index)
| Report a change in vehicle IDs (due to autoreplace) to affected vehicle news.
void | NewsLoop ()
static void | ShowNewsMessage (const NewsItem *ni)
| Do a forced show of a specific message.
void | ShowLastNewsMessage ()
| Show previous news item.
static void | DrawNewsString (uint left, uint right, int y, TextColour colour, const NewsItem *ni)
| Draw an unformatted news message truncated to a maximum length.
void | ShowMessageHistory ()
| Display window with news messages history.
static NWidgetBase * | MakeButtonsColumn (int *biggest_index)
| Make a column with the buttons for changing each news category setting, and the global settings.
static NWidgetBase * | MakeDescriptionColumn (int *biggest_index)
| Make a column with descriptions for each news category and the global settings.
void | ShowMessageOptions ()
## Variables
const NewsItem * | _statusbar_news_item = NULL
bool | _news_ticker_sound
| Make a ticker sound when a news item is published.
static uint | MIN_NEWS_AMOUNT = 30
| prefered minimum amount of news messages
static uint | _total_news = 0
| current number of news items
static NewsItem * | _oldest_news = NULL
| head of news items queue
static NewsItem * | _latest_news = NULL
| tail of news items queue
static const NewsItem * | _forced_news = NULL
| Forced news item.
static const NewsItem * | _current_news = NULL
| Current news item (last item shown regularly).
static const NWidgetPart | _nested_normal_news_widgets []
static const WindowDesc | _normal_news_desc (WDP_MANUAL, 0, 0, WC_NEWS_WINDOW, WC_NONE, 0, _nested_normal_news_widgets, lengthof(_nested_normal_news_widgets))
static const NWidgetPart | _nested_vehicle_news_widgets []
static const WindowDesc | _vehicle_news_desc (WDP_MANUAL, 0, 0, WC_NEWS_WINDOW, WC_NONE, 0, _nested_vehicle_news_widgets, lengthof(_nested_vehicle_news_widgets))
static const NWidgetPart | _nested_company_news_widgets []
static const WindowDesc | _company_news_desc (WDP_MANUAL, 0, 0, WC_NEWS_WINDOW, WC_NONE, 0, _nested_company_news_widgets, lengthof(_nested_company_news_widgets))
static const NWidgetPart | _nested_thin_news_widgets []
static const WindowDesc | _thin_news_desc (WDP_MANUAL, 0, 0, WC_NEWS_WINDOW, WC_NONE, 0, _nested_thin_news_widgets, lengthof(_nested_thin_news_widgets))
static const NWidgetPart | _nested_small_news_widgets []
static const WindowDesc | _small_news_desc (WDP_MANUAL, 0, 0, WC_NEWS_WINDOW, WC_NONE, 0, _nested_small_news_widgets, lengthof(_nested_small_news_widgets))
static const NewsSubtypeData | _news_subtype_data []
| Data common to all news items of a given subtype (actual data).
NewsTypeData | _news_type_data []
| Per-NewsType data.
static const NWidgetPart | _nested_message_history []
static const WindowDesc | _message_history_desc (WDP_AUTO, 400, 140, WC_MESSAGE_HISTORY, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_message_history, lengthof(_nested_message_history))
static const NWidgetPart | _nested_message_options_widgets []
static const WindowDesc | _message_options_desc (WDP_AUTO, 0, 0, WC_GAME_OPTIONS, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_message_options_widgets, lengthof(_nested_message_options_widgets))

## Detailed Description

GUI functions related to news messages.

Definition in file news_gui.cpp.

## Enumeration Type Documentation

enum MessageHistoryWidgets

Widget numbers of the message history window.

Definition at line 930 of file news_gui.cpp.

enum MessageOptionsSpace

Constants in the message options window.

Enumerator:

  MOS_WIDG_PER_SETTING | Number of widgets needed for each news category, starting at widget WIDGET_NEWSOPT_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 1061 of file news_gui.cpp.

enum MessageOptionWidgets

Message options widget numbers.

Enumerator:

  WIDGET_NEWSOPT_BACKGROUND | Background widget.
  WIDGET_NEWSOPT_LABEL | Top label.
  WIDGET_NEWSOPT_DROP_SUMMARY | Dropdown that adjusts at once the level for all settings.
  WIDGET_NEWSOPT_LABEL_SUMMARY | Label of the summary drop down.
  WIDGET_NEWSOPT_SOUNDTICKER | Button for (de)activating sound on events.
  WIDGET_NEWSOPT_SOUNDTICKER_LABEL | Label of the soundticker button,.
  WIDGET_NEWSOPT_START_OPTION | First widget that is part of a group [<][label][>] [description].
  WIDGET_NEWSOPT_END_OPTION | First widget after the groups.

Definition at line 1074 of file news_gui.cpp.

enum NewsTypeWidgets

Widget numbers of the news display windows.

Enumerator:

  NTW_PANEL | The news item background panel.
  NTW_TITLE | Title of the company news.
  NTW_HEADLINE | The news headline.
  NTW_CLOSEBOX | Close the window.
  NTW_DATE | Date of the news item.
  NTW_CAPTION | Title bar of the window. Only used in small news items.
  NTW_INSET | Inset around the viewport in the window. Only used in small news items.
  NTW_VIEWPORT | Viewport in the window.
  NTW_COMPANY_MSG | Message in company news items.
  NTW_MESSAGE | Space for displaying the message. Only used in small news items.
  NTW_MGR_FACE | Face of the manager.
  NTW_MGR_NAME | Name of the manager.
  NTW_VEH_TITLE | Vehicle new title.
  NTW_VEH_BKGND | Dark background of new vehicle news.
  NTW_VEH_NAME | Name of the new vehicle.
  NTW_VEH_SPR | Graphical display of the new vehicle.
  NTW_VEH_INFO | Some technical data of the new vehicle.

Definition at line 71 of file news_gui.cpp.

## Function Documentation

void AddNewsItem | ( | StringID | string,
|  | NewsSubtype | subtype,
|  | NewsReferenceType | reftype1,
|  | uint32 | ref1,
|  | NewsReferenceType | reftype2,
|  | uint32 | ref2,
|  | void * | free_data |
| ) |  |  |

Add a new newsitem to be shown.

Parameters:

  | string | String to display
  | subtype | news category, any of the NewsSubtype enums (NS_)
  | reftype1 | Type of ref1
  | 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.
  | reftype2 | Type of ref2
  | ref2 | Reference 2 to some object: Used for scrolling after clicking on the news, and for deleteing the news when the object is deleted.
  | free_data | Pointer to data that must be freed once the news message is cleared

See also:
  NewsSubtype

Definition at line 678 of file news_gui.cpp.

References _cur_year, _date, _settings_client, _total_news, GUISettings::coloured_news_year, CopyOutDParam(), NewsItem::date, NewsSubtypeData::flags, NewsItem::flags, NewsItem::free_data, ClientSettings::gui, lengthof, NewsItem::next, NF_INCOLOUR, NewsItem::prev, NewsItem::ref1, NewsItem::ref2, NewsItem::reftype1, NewsItem::reftype2, SetWindowDirty(), NewsItem::string_id, and NewsItem::subtype.

Referenced by AddVehicleNewsItem(), Subsidy::AwardTo(), ChangeIndustryProduction(), CheckSwitchToEuro(), CmdFoundTown(), Disaster_CoalMine_Init(), DisasterTick_Big_Ufo(), and ShowRejectOrAcceptNews().

void ChangeVehicleNews | ( | VehicleID | from_index,
|  | VehicleID | to_index |
| ) |  |  |

Report a change in vehicle IDs (due to autoreplace) to affected vehicle news.

Note:
  Viewports of currently displayed news is changed via ChangeVehicleViewports

Parameters:

  | from_index | the old vehicle ID
  | to_index | the new vehicle ID

Definition at line 810 of file news_gui.cpp.

References NewsItem::next, NR_VEHICLE, and NS_ADVICE.

Referenced by CopyHeadSpecificThings().

void DeleteIndustryNews | ( | IndustryID | iid | ) |

Remove news regarding given industry.

Delete news associated with given station.

Parameters:

  | iid | industry to remove news about

Definition at line 782 of file news_gui.cpp.

References DeleteNewsItem(), NewsItem::next, NR_INDUSTRY, NewsItem::ref1, NewsItem::ref2, NewsItem::reftype1, and NewsItem::reftype2.

void DeleteStationNews | ( | StationID | sid | ) |

Remove news regarding given station so there are no 'unknown station now accepts Mail' or 'First train arrived at unknown station' news items.

Delete news associated with given station.

Parameters:

  | sid | station to remove news about

Definition at line 766 of file news_gui.cpp.

References DeleteNewsItem(), NewsItem::next, NR_STATION, NewsItem::ref1, NewsItem::ref2, NewsItem::reftype1, and NewsItem::reftype2.

Referenced by Station::~Station().

static void DrawNewsString | ( | uint | left,
|  | uint | right,
|  | int | y,
|  | TextColour | colour,
|  | const NewsItem * | ni |
| ) |  |  | `[static]`

Draw an unformatted news message truncated to a maximum length.

If length exceeds maximum length it will be postfixed by '...'

Parameters:

  | left | the left most location for the string
  | right | the right most location for the string
  | y | position of the string
  | colour | the colour the string will be shown in
  | *ni | NewsItem being printed
  | maxw | maximum width of string in pixels

Definition at line 894 of file news_gui.cpp.

References CopyInDParam(), DrawString(), lastof, lengthof, and NewsItem::string_id.

Referenced by MessageHistoryWindow::DrawWidget().

static TileIndex GetReferenceTile | ( | NewsReferenceType | reftype,
|  | uint32 | ref |
| ) |  |  | `[static]`

Get the position a news-reference is referencing.

Parameters:

  | reftype | The type of reference.
  | ref | The reference.

Returns:
  A tile for the referenced object, or INVALID_TILE if none.

Definition at line 59 of file news_gui.cpp.

References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_town_pool >::Get(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_industry_pool >::Get(), SpecializedStation< Station, false >::Get(), INVALID_TILE, NR_INDUSTRY, NR_STATION, NR_TILE, NR_TOWN, TileDiffXY(), and BaseStation::xy.

Referenced by NewsWindow::OnClick().

static NWidgetBase* MakeButtonsColumn | ( | int * | biggest_index | ) | `[static]`

Make a column with the buttons for changing each news category setting, and the global settings.

Definition at line 1221 of file news_gui.cpp.

References NWidgetContainer::Add(), AWV_DECREASE, AWV_INCREASE, max(), MOS_ABOVE_GLOBAL_SETTINGS, MOS_WIDG_PER_SETTING, NT_END, NWID_BUTTON_ARROW, NWidgetResizeBase::SetFill(), WIDGET_NEWSOPT_DROP_SUMMARY, WIDGET_NEWSOPT_SOUNDTICKER, WIDGET_NEWSOPT_START_OPTION, WWT_DROPDOWN, and WWT_TEXTBTN_2.

static NWidgetBase* MakeDescriptionColumn | ( | int * | biggest_index | ) | `[static]`

Make a column with descriptions for each news category and the global settings.

Definition at line 1265 of file news_gui.cpp.

References NWidgetContainer::Add(), max(), MOS_ABOVE_GLOBAL_SETTINGS, MOS_WIDG_PER_SETTING, NT_END, NWidgetResizeBase::SetFill(), WIDGET_NEWSOPT_LABEL_SUMMARY, WIDGET_NEWSOPT_SOUNDTICKER_LABEL, WIDGET_NEWSOPT_START_OPTION, and WWT_TEXT.

## Variable Documentation

const NewsItem* _current_news = NULL`[static]`

Current news item (last item shown regularly).

Definition at line 50 of file news_gui.cpp.

const NewsItem* _forced_news = NULL`[static]`

Forced news item.

Users can force an item by accessing the history or "last message". If the message being shown was forced by the user, a pointer is stored in _forced_news. Otherwise, _forced_news variable is NULL. item the user has asked for

Definition at line 47 of file news_gui.cpp.

const NWidgetPart _nested_company_news_widgets[]`[static]`

Initial value:

     {
      NWidget(WWT_PANEL, COLOUR_WHITE, NTW_PANEL),
        NWidget(NWID_HORIZONTAL), SetPadding(1, 1, 0, 1),
          NWidget(NWID_VERTICAL),
            NWidget(WWT_TEXT, COLOUR_WHITE, NTW_CLOSEBOX), SetDataTip(STR_SILVER_CROSS, STR_NULL), SetPadding(0, 0, 0, 1),
            NWidget(NWID_SPACER), SetFill(0, 1),
          EndContainer(),
          NWidget(WWT_LABEL, COLOUR_WHITE, NTW_TITLE), SetFill(1, 1), SetMinimalSize(410, 20), SetDataTip(STR_EMPTY, STR_NULL),
        EndContainer(),
        NWidget(NWID_HORIZONTAL), SetPadding(0, 1, 1, 1),
          NWidget(NWID_VERTICAL),
            NWidget(WWT_EMPTY, COLOUR_WHITE, NTW_MGR_FACE), SetMinimalSize(93, 119), SetPadding(2, 6, 2, 1),
            NWidget(NWID_HORIZONTAL),
              NWidget(WWT_EMPTY, COLOUR_WHITE, NTW_MGR_NAME), SetMinimalSize(93, 24), SetPadding(0, 0, 0, 1),
              NWidget(NWID_SPACER), SetFill(1, 0),
            EndContainer(),
            NWidget(NWID_SPACER), SetFill(0, 1),
          EndContainer(),
          NWidget(WWT_EMPTY, COLOUR_WHITE, NTW_COMPANY_MSG), SetFill(1, 1), SetMinimalSize(328, 150),
        EndContainer(),
      EndContainer(),
    }

Definition at line 141 of file news_gui.cpp.

const NWidgetPart _nested_message_history[]`[static]`

Initial value:

     {
      NWidget(NWID_HORIZONTAL),
        NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
        NWidget(WWT_CAPTION, COLOUR_BROWN), SetDataTip(STR_MESSAGE_HISTORY, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
        NWidget(WWT_SHADEBOX, COLOUR_BROWN),
        NWidget(WWT_STICKYBOX, COLOUR_BROWN),
      EndContainer(),

      NWidget(NWID_HORIZONTAL),
        NWidget(WWT_PANEL, COLOUR_BROWN, MHW_BACKGROUND), SetMinimalSize(200, 125), SetDataTip(0x0, STR_MESSAGE_HISTORY_TOOLTIP), SetResize(1, 12),
        EndContainer(),
        NWidget(NWID_VERTICAL),
          NWidget(WWT_SCROLLBAR, COLOUR_BROWN, MHW_SCROLLBAR),
          NWidget(WWT_RESIZEBOX, COLOUR_BROWN),
        EndContainer(),
      EndContainer(),
    }

Definition at line 1028 of file news_gui.cpp.

const NWidgetPart _nested_message_options_widgets[]`[static]`

Initial value:

     {
      NWidget(NWID_HORIZONTAL),
        NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
        NWidget(WWT_CAPTION, COLOUR_BROWN), SetDataTip(STR_NEWS_MESSAGE_OPTIONS_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
      EndContainer(),
      NWidget(WWT_PANEL, COLOUR_BROWN, WIDGET_NEWSOPT_BACKGROUND),
        NWidget(NWID_HORIZONTAL),
          NWidget(NWID_SPACER), SetFill(1, 0),
          NWidget(WWT_LABEL, COLOUR_BROWN, WIDGET_NEWSOPT_LABEL), SetMinimalSize(0, 14), SetDataTip(STR_NEWS_MESSAGE_TYPES, STR_NULL),
          NWidget(NWID_SPACER), SetFill(1, 0),
        EndContainer(),
        NWidget(NWID_HORIZONTAL),
          NWidget(NWID_SPACER), SetMinimalSize(MOS_LEFT_EDGE, 0),
          NWidgetFunction(MakeButtonsColumn),
          NWidget(NWID_SPACER), SetMinimalSize(MOS_COLUMN_SPACING, 0),
          NWidgetFunction(MakeDescriptionColumn),
          NWidget(NWID_SPACER), SetMinimalSize(MOS_RIGHT_EDGE, 0),
        EndContainer(),
        NWidget(NWID_SPACER), SetMinimalSize(0, MOS_BOTTOM_EDGE),
      EndContainer(),
    }

Definition at line 1314 of file news_gui.cpp.

const NWidgetPart _nested_normal_news_widgets[]`[static]`

Initial value:

     {
      NWidget(WWT_PANEL, COLOUR_WHITE, NTW_PANEL),
        NWidget(NWID_HORIZONTAL), SetPadding(1, 1, 0, 1),
          NWidget(WWT_TEXT, COLOUR_WHITE, NTW_CLOSEBOX), SetDataTip(STR_SILVER_CROSS, STR_NULL), SetPadding(0, 0, 0, 1),
          NWidget(NWID_SPACER), SetFill(1, 0),
          NWidget(NWID_VERTICAL),
            NWidget(WWT_LABEL, COLOUR_WHITE, NTW_DATE), SetDataTip(STR_DATE_LONG_SMALL, STR_NULL),
            NWidget(NWID_SPACER), SetFill(0, 1),
          EndContainer(),
        EndContainer(),
        NWidget(WWT_EMPTY, COLOUR_WHITE, NTW_MESSAGE), SetMinimalSize(428, 154), SetPadding(0, 1, 1, 1),
      EndContainer(),
    }

Definition at line 92 of file news_gui.cpp.

const NWidgetPart _nested_small_news_widgets[]`[static]`

Initial value:

     {

      NWidget(NWID_HORIZONTAL),
        NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE, NTW_CLOSEBOX),
        NWidget(WWT_EMPTY, COLOUR_LIGHT_BLUE, NTW_CAPTION), SetFill(1, 0),
      EndContainer(),

      NWidget(WWT_PANEL, COLOUR_LIGHT_BLUE, NTW_HEADLINE),
        NWidget(WWT_INSET, COLOUR_LIGHT_BLUE, NTW_INSET), SetPadding(2, 2, 2, 2),
          NWidget(NWID_VIEWPORT, INVALID_COLOUR, NTW_VIEWPORT), SetPadding(1, 1, 1, 1), SetMinimalSize(274, 47), SetFill(1, 0),
        EndContainer(),
        NWidget(WWT_EMPTY, COLOUR_WHITE, NTW_MESSAGE), SetMinimalSize(275, 20), SetFill(1, 0),
      EndContainer(),
    }

Definition at line 195 of file news_gui.cpp.

const NWidgetPart _nested_thin_news_widgets[]`[static]`

Initial value:

     {
      NWidget(WWT_PANEL, COLOUR_WHITE, NTW_PANEL),
        NWidget(NWID_HORIZONTAL), SetPadding(1, 1, 0, 1),
          NWidget(WWT_TEXT, COLOUR_WHITE, NTW_CLOSEBOX), SetDataTip(STR_SILVER_CROSS, STR_NULL), SetPadding(0, 0, 0, 1),
          NWidget(NWID_SPACER), SetFill(1, 0),
          NWidget(NWID_VERTICAL),
            NWidget(WWT_LABEL, COLOUR_WHITE, NTW_DATE), SetDataTip(STR_DATE_LONG_SMALL, STR_NULL),
            NWidget(NWID_SPACER), SetFill(0, 1),
          EndContainer(),
        EndContainer(),
        NWidget(WWT_EMPTY, COLOUR_WHITE, NTW_MESSAGE), SetMinimalSize(428, 48), SetFill(1, 0), SetPadding(0, 1, 0, 1),
        NWidget(NWID_VIEWPORT, INVALID_COLOUR, NTW_VIEWPORT), SetMinimalSize(426, 70), SetPadding(1, 2, 2, 2),
      EndContainer(),
    }

Definition at line 172 of file news_gui.cpp.

const NWidgetPart _nested_vehicle_news_widgets[]`[static]`

Initial value:

     {
      NWidget(WWT_PANEL, COLOUR_WHITE, NTW_PANEL),
        NWidget(NWID_HORIZONTAL), SetPadding(1, 1, 0, 1),
          NWidget(NWID_VERTICAL),
            NWidget(WWT_TEXT, COLOUR_WHITE, NTW_CLOSEBOX), SetDataTip(STR_SILVER_CROSS, STR_NULL), SetPadding(0, 0, 0, 1),
            NWidget(NWID_SPACER), SetFill(0, 1),
          EndContainer(),
          NWidget(WWT_LABEL, COLOUR_WHITE, NTW_VEH_TITLE), SetFill(1, 1), SetMinimalSize(419, 55), SetDataTip(STR_EMPTY, STR_NULL),
        EndContainer(),
        NWidget(WWT_PANEL, COLOUR_WHITE, NTW_VEH_BKGND), SetPadding(0, 25, 1, 25),
          NWidget(NWID_VERTICAL),
            NWidget(WWT_EMPTY, INVALID_COLOUR, NTW_VEH_NAME), SetMinimalSize(369, 33), SetFill(1, 0),
            NWidget(WWT_EMPTY, INVALID_COLOUR, NTW_VEH_SPR),  SetMinimalSize(369, 32), SetFill(1, 0),
            NWidget(WWT_EMPTY, INVALID_COLOUR, NTW_VEH_INFO), SetMinimalSize(369, 46), SetFill(1, 0),
          EndContainer(),
        EndContainer(),
      EndContainer(),
    }

Definition at line 114 of file news_gui.cpp.

const NewsSubtypeData _news_subtype_data[]`[static]`

Initial value:

     {

      { NT_ARRIVAL_COMPANY,  (NF_NO_TRANSPARENT | NF_SHADE), &_thin_news_desc    },
      { NT_ARRIVAL_OTHER,    (NF_NO_TRANSPARENT | NF_SHADE), &_thin_news_desc    },
      { NT_ACCIDENT,         (NF_NO_TRANSPARENT | NF_SHADE), &_thin_news_desc    },
      { NT_COMPANY_INFO,     NF_NONE,                        &_company_news_desc },
      { NT_COMPANY_INFO,     NF_NONE,                        &_company_news_desc },
      { NT_COMPANY_INFO,     NF_NONE,                        &_company_news_desc },
      { NT_COMPANY_INFO,     NF_NONE,                        &_company_news_desc },
      { NT_INDUSTRY_OPEN,    (NF_NO_TRANSPARENT | NF_SHADE), &_thin_news_desc    },
      { NT_INDUSTRY_CLOSE,   (NF_NO_TRANSPARENT | NF_SHADE), &_thin_news_desc    },
      { NT_ECONOMY,          NF_NONE,                        &_normal_news_desc  },
      { NT_INDUSTRY_COMPANY, (NF_NO_TRANSPARENT | NF_SHADE), &_thin_news_desc    },
      { NT_INDUSTRY_OTHER,   (NF_NO_TRANSPARENT | NF_SHADE), &_thin_news_desc    },
      { NT_INDUSTRY_NOBODY,  (NF_NO_TRANSPARENT | NF_SHADE), &_thin_news_desc    },
      { NT_ADVICE,           NF_INCOLOUR,                    &_small_news_desc   },
      { NT_NEW_VEHICLES,     NF_NONE,                        &_vehicle_news_desc },
      { NT_ACCEPTANCE,       NF_INCOLOUR,                    &_small_news_desc   },
      { NT_SUBSIDIES,        NF_NONE,                        &_normal_news_desc  },
      { NT_GENERAL,          NF_NONE,                        &_normal_news_desc  },
    }

Data common to all news items of a given subtype (actual data).

Definition at line 230 of file news_gui.cpp.

NewsTypeData _news_type_data[]

Initial value:

     {

      NewsTypeData("arrival_player",    60, SND_1D_APPLAUSE, STR_NEWS_MESSAGE_TYPE_ARRIVAL_OF_FIRST_VEHICLE_OWN       ),
      NewsTypeData("arrival_other",     60, SND_1D_APPLAUSE, STR_NEWS_MESSAGE_TYPE_ARRIVAL_OF_FIRST_VEHICLE_OTHER     ),
      NewsTypeData("accident",          90, SND_BEGIN,       STR_NEWS_MESSAGE_TYPE_ACCIDENTS_DISASTERS                ),
      NewsTypeData("company_info",      60, SND_BEGIN,       STR_NEWS_MESSAGE_TYPE_COMPANY_INFORMATION                ),
      NewsTypeData("open",              90, SND_BEGIN,       STR_NEWS_MESSAGE_TYPE_INDUSTRY_OPEN                      ),
      NewsTypeData("close",             90, SND_BEGIN,       STR_NEWS_MESSAGE_TYPE_INDUSTRY_CLOSE                     ),
      NewsTypeData("economy",           30, SND_BEGIN,       STR_NEWS_MESSAGE_TYPE_ECONOMY_CHANGES                    ),
      NewsTypeData("production_player", 30, SND_BEGIN,       STR_NEWS_MESSAGE_TYPE_INDUSTRY_CHANGES_SERVED_BY_COMPANY ),
      NewsTypeData("production_other",  30, SND_BEGIN,       STR_NEWS_MESSAGE_TYPE_INDUSTRY_CHANGES_SERVED_BY_OTHER   ),
      NewsTypeData("production_nobody", 30, SND_BEGIN,       STR_NEWS_MESSAGE_TYPE_INDUSTRY_CHANGES_UNSERVED          ),
      NewsTypeData("advice",           150, SND_BEGIN,       STR_NEWS_MESSAGE_TYPE_ADVICE_INFORMATION_ON_COMPANY      ),
      NewsTypeData("new_vehicles",      30, SND_1E_OOOOH,    STR_NEWS_MESSAGE_TYPE_NEW_VEHICLES                       ),
      NewsTypeData("acceptance",        90, SND_BEGIN,       STR_NEWS_MESSAGE_TYPE_CHANGES_OF_CARGO_ACCEPTANCE        ),
      NewsTypeData("subsidies",        180, SND_BEGIN,       STR_NEWS_MESSAGE_TYPE_SUBSIDIES                          ),
      NewsTypeData("general",           60, SND_BEGIN,       STR_NEWS_MESSAGE_TYPE_GENERAL_INFORMATION                ),
    }

Per-NewsType data.

Definition at line 257 of file news_gui.cpp.

Referenced by ConvertOldNewsSetting().