OpenTTD Source: src/news_gui.cpp File Reference

OpenTTD Source 13.1

Data Structures | Functions | Variables
news_gui.cpp File Reference
`#include "stdafx.h"`
`#include "gui.h"`
`#include "viewport_func.h"`
`#include "strings_func.h"`
`#include "window_func.h"`
`#include "date_func.h"`
`#include "vehicle_base.h"`
`#include "vehicle_func.h"`
`#include "vehicle_gui.h"`
`#include "roadveh.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_base.h"`
`#include "engine_gui.h"`
`#include "core/geometry_func.hpp"`
`#include "command_func.h"`
`#include "company_base.h"`
`#include "settings_internal.h"`
`#include "guitimer_func.h"`
`#include "group_gui.h"`
`#include "zoom_func.h"`
`#include "news_cmd.h"`
`#include "widgets/news_widget.h"`
`#include "table/strings.h"`
`#include "safeguards.h"`

Go to the source code of this file.

## Data Structures
struct | NewsWindow
| Window class displaying a news item. More...
struct | MessageHistoryWindow

## Functions
static TileIndex | GetReferenceTile (NewsReferenceType reftype, uint32 ref)
| Get the position a news-reference is referencing. More...
WindowDesc * | GetNewsWindowLayout (NewsFlag flags)
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 | ReadyForNextTickerItem ()
| Are we ready to show another ticker item? Only if nothing is in the newsticker is displayed.
static bool | ReadyForNextNewsItem ()
| Are we ready to show another news item? Only if no newspaper is displayed.
static void | MoveToNextTickerItem ()
| Move to the next ticker item.
static void | MoveToNextNewsItem ()
| Move to the next news item.
static void | DeleteNewsItem (NewsItem *ni)
| Delete a news item from the queue.
void | AddNewsItem (StringID string, NewsType type, NewsFlag flags, NewsReferenceType reftype1, uint32 ref1, NewsReferenceType reftype2, uint32 ref2, const NewsAllocatedData *data)
| Add a new newsitem to be shown. More...
CommandCost | CmdCustomNewsItem (DoCommandFlag flags, NewsType type, NewsReferenceType reftype1, CompanyID company, uint32 reference, const std::string &text)
| Create a new custom news item. More...
void | DeleteVehicleNews (VehicleID vid, StringID news)
| Delete a news item type about a vehicle. More...
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. More...
void | DeleteIndustryNews (IndustryID iid)
| Remove news regarding given industry. More...
void | DeleteInvalidEngineNews ()
| Remove engine announcements for invalid engines.
static void | RemoveOldNewsItems ()
void | ChangeVehicleNews (VehicleID from_index, VehicleID to_index)
| Report a change in vehicle IDs (due to autoreplace) to affected vehicle news. More...
void | NewsLoop ()
static void | ShowNewsMessage (const NewsItem *ni)
| Do a forced show of a specific message.
bool | HideActiveNewsMessage ()
| Close active news message window. More...
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. More...
void | ShowMessageHistory ()
| Display window with news messages history.

## Variables
const NewsItem * | _statusbar_news_item = nullptr
static uint | MIN_NEWS_AMOUNT = 30
| preferred minimum amount of news messages
static uint | MAX_NEWS_AMOUNT = 1 << 10
| Do not exceed this number of news messages.
static uint | _total_news = 0
| current number of news items
static NewsItem * | _oldest_news = nullptr
| head of news items queue
NewsItem * | _latest_news = nullptr
| tail of news items queue
static const NewsItem * | _forced_news = nullptr
| Forced news item. More...
static const NewsItem * | _current_news = nullptr
| Current news item (last item shown regularly).
static const NWidgetPart | _nested_normal_news_widgets []
static WindowDesc | _normal_news_desc (WDP_MANUAL, nullptr, 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 WindowDesc | _vehicle_news_desc (WDP_MANUAL, nullptr, 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 WindowDesc | _company_news_desc (WDP_MANUAL, nullptr, 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 WindowDesc | _thin_news_desc (WDP_MANUAL, nullptr, 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 WindowDesc | _small_news_desc (WDP_MANUAL, nullptr, 0, 0, WC_NEWS_WINDOW, WC_NONE, 0, _nested_small_news_widgets, lengthof(_nested_small_news_widgets))
static WindowDesc * | _news_window_layout []
| Window layouts for news items. More...
static NewsTypeData | _news_type_data []
| Per-NewsType data. More...
static const NWidgetPart | _nested_message_history []
static WindowDesc | _message_history_desc (WDP_AUTO, "list_news", 400, 140, WC_MESSAGE_HISTORY, WC_NONE, 0, _nested_message_history, lengthof(_nested_message_history))

## Detailed Description

GUI functions related to news messages.

Definition in file news_gui.cpp.

## Function Documentation

## ◆ AddNewsItem()

void AddNewsItem | ( | StringID | string,
|  | NewsType | type,
|  | NewsFlag | flags,
|  | NewsReferenceType | reftype1,
|  | uint32 | ref1,
|  | NewsReferenceType | reftype2,
|  | uint32 | ref2,
|  | const NewsAllocatedData * | data
| ) |  |

Add a new newsitem to be shown.

Parameters

  string | String to display
  type | news category
  flags | display flags for 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.

See also
  NewsSubtype

Definition at line 827 of file news_gui.cpp.

Referenced by AddVehicleAdviceNewsItem(), CheckSwitchToEuro(), CmdCustomNewsItem(), CreateSubsidy(), ShowRejectOrAcceptNews(), and SubsidyMonthlyLoop().

## ◆ ChangeVehicleNews()

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 1000 of file news_gui.cpp.

References _oldest_news, NewsItem::flags, NewsItem::next, NF_VEHICLE_PARAM0, NR_VEHICLE, NewsItem::params, NewsItem::ref1, NewsItem::ref2, NewsItem::reftype1, and NewsItem::reftype2.

## ◆ CmdCustomNewsItem()

CommandCost CmdCustomNewsItem | ( | DoCommandFlag | flags,
|  | NewsType | type,
|  | NewsReferenceType | reftype1,
|  | CompanyID | company,
|  | uint32 | reference,
|  | const std::string & | text
| ) |  |

Create a new custom news item.

Parameters

  flags | type of operation @aram type NewsType of the message.
  reftype1 | NewsReferenceType of first reference.
  company | Company this news message is for.
  reference | First reference of the news message.
  text | The text of the news message.

Returns
  the cost of this operation or an error

Definition at line 865 of file news_gui.cpp.

References _current_company, _local_company, AddNewsItem(), CMD_ERROR, DC_EXEC, INVALID_OWNER, SpecializedStation< Station, false >::IsValidID(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_town_pool >::IsValidID(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_engine_pool >::IsValidID(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::IsValidID(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_vehicle_pool >::IsValidID(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_industry_pool >::IsValidID(), IsValidTile(), NF_NORMAL, NR_ENGINE, NR_INDUSTRY, NR_NONE, NR_STATION, NR_TILE, NR_TOWN, NR_VEHICLE, NT_END, OWNER_DEITY, SetDParamStr(), and NewsStringData::string.

## ◆ DeleteIndustryNews()

void DeleteIndustryNews | ( | IndustryID | iid | ) |

Remove news regarding given industry.

Parameters

  iid | industry to remove news about

Definition at line 955 of file news_gui.cpp.

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

## ◆ DeleteStationNews()

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.

Parameters

  sid | station to remove news about

Definition at line 938 of file news_gui.cpp.

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

## ◆ DeleteVehicleNews()

void DeleteVehicleNews | ( | VehicleID | vid,
|  | StringID | news
| ) |  |

Delete a news item type about a vehicle.

When the news item type is INVALID_STRING_ID all news about the vehicle gets deleted.

Parameters

  vid | The vehicle to remove the news for.
  news | The news type to remove.

Definition at line 919 of file news_gui.cpp.

References _oldest_news, DeleteNewsItem(), INVALID_STRING_ID, NewsItem::next, NR_VEHICLE, NewsItem::ref1, NewsItem::ref2, NewsItem::reftype1, NewsItem::reftype2, and NewsItem::string_id.

Referenced by AircraftHandleDestTooFar(), CmdStartStopVehicle(), DeleteOrderWarnings(), and Vehicle::HandlePathfindingResult().

## ◆ DrawNewsString()

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

Definition at line 1104 of file news_gui.cpp.

## ◆ GetReferenceTile()

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 72 of file news_gui.cpp.

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

Referenced by NewsWindow::OnClick(), and NewsWindow::OnResize().

## ◆ HideActiveNewsMessage()

bool HideActiveNewsMessage | ( |  | ) |

Close active news message window.

Returns
  true if a window was closed.

Definition at line 1046 of file news_gui.cpp.

References Window::Close(), FindWindowById(), and WC_NEWS_WINDOW.

## Variable Documentation

## ◆ _forced_news

const NewsItem* _forced_news = nullptr
| 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 nullptr.

Definition at line 60 of file news_gui.cpp.

Referenced by DeleteNewsItem(), InitNewsItemStructs(), MoveToNextNewsItem(), ReadyForNextNewsItem(), ShowLastNewsMessage(), and ShowNewsMessage().

## ◆ _nested_company_news_widgets

const NWidgetPart _nested_company_news_widgets[]
| static

Initial value:
= {
NWidget(WWT_PANEL, COLOUR_WHITE, WID_N_PANEL),
NWidget(NWID_HORIZONTAL), SetPadding(1, 1, 0, 1),
NWidget(NWID_VERTICAL),
NWidget(WWT_CLOSEBOX, COLOUR_WHITE, WID_N_CLOSEBOX), SetPadding(0, 0, 0, 1),
NWidget(NWID_SPACER), SetFill(0, 1),
EndContainer(),
NWidget(WWT_LABEL, COLOUR_WHITE, WID_N_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, WID_N_MGR_FACE), SetMinimalSize(93, 119), SetPadding(2, 6, 2, 1),
NWidget(WWT_EMPTY, COLOUR_WHITE, WID_N_MGR_NAME), SetMinimalSize(93, 24), SetPadding(0, 0, 0, 1),
NWidget(NWID_SPACER), SetFill(0, 1),
EndContainer(),
NWidget(WWT_EMPTY, COLOUR_WHITE, WID_N_COMPANY_MSG), SetFill(1, 1), SetMinimalSize(328, 150),
EndContainer(),
EndContainer(),
}

Definition at line 133 of file news_gui.cpp.

## ◆ _nested_message_history

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_DEFSIZEBOX, COLOUR_BROWN),
NWidget(WWT_STICKYBOX, COLOUR_BROWN),
EndContainer(),
NWidget(NWID_HORIZONTAL),
NWidget(WWT_PANEL, COLOUR_BROWN, WID_MH_BACKGROUND), SetMinimalSize(200, 125), SetDataTip(0x0, STR_MESSAGE_HISTORY_TOOLTIP), SetResize(1, 12), SetScrollbar(WID_MH_SCROLLBAR),
EndContainer(),
NWidget(NWID_VERTICAL),
NWidget(NWID_VSCROLLBAR, COLOUR_BROWN, WID_MH_SCROLLBAR),
NWidget(WWT_RESIZEBOX, COLOUR_BROWN),
EndContainer(),
EndContainer(),
}

Definition at line 1235 of file news_gui.cpp.

## ◆ _nested_normal_news_widgets

const NWidgetPart _nested_normal_news_widgets[]
| static

Initial value:
= {
NWidget(WWT_PANEL, COLOUR_WHITE, WID_N_PANEL),
NWidget(NWID_HORIZONTAL), SetPadding(1, 1, 0, 1),
NWidget(WWT_CLOSEBOX, COLOUR_WHITE, WID_N_CLOSEBOX), SetPadding(0, 0, 0, 1),
NWidget(NWID_SPACER), SetFill(1, 0),
NWidget(NWID_VERTICAL),
NWidget(WWT_LABEL, COLOUR_WHITE, WID_N_DATE), SetDataTip(STR_DATE_LONG_SMALL, STR_NULL),
NWidget(NWID_SPACER), SetFill(0, 1),
EndContainer(),
EndContainer(),
NWidget(WWT_EMPTY, COLOUR_WHITE, WID_N_MESSAGE), SetMinimalSize(428, 154), SetPadding(0, 5, 1, 5),
EndContainer(),
}

Definition at line 84 of file news_gui.cpp.

## ◆ _nested_small_news_widgets

const NWidgetPart _nested_small_news_widgets[]
| static

Initial value:
= {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE, WID_N_CLOSEBOX),
NWidget(WWT_EMPTY, COLOUR_LIGHT_BLUE, WID_N_CAPTION), SetFill(1, 0),
NWidget(WWT_TEXTBTN, COLOUR_LIGHT_BLUE, WID_N_SHOW_GROUP), SetMinimalSize(14, 11), SetResize(1, 0),
SetDataTip(STR_NULL , STR_NEWS_SHOW_VEHICLE_GROUP_TOOLTIP),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_LIGHT_BLUE, WID_N_HEADLINE),
NWidget(WWT_INSET, COLOUR_LIGHT_BLUE, WID_N_INSET), SetPadding(2, 2, 2, 2),
NWidget(NWID_VIEWPORT, INVALID_COLOUR, WID_N_VIEWPORT), SetMinimalSize(274, 47), SetFill(1, 0),
EndContainer(),
NWidget(WWT_EMPTY, COLOUR_WHITE, WID_N_MESSAGE), SetMinimalSize(275, 20), SetFill(1, 0), SetPadding(0, 5, 0, 5),
EndContainer(),
}

Definition at line 184 of file news_gui.cpp.

## ◆ _nested_thin_news_widgets

const NWidgetPart _nested_thin_news_widgets[]
| static

Initial value:
= {
NWidget(WWT_PANEL, COLOUR_WHITE, WID_N_PANEL),
NWidget(NWID_HORIZONTAL), SetPadding(1, 1, 0, 1),
NWidget(WWT_CLOSEBOX, COLOUR_WHITE, WID_N_CLOSEBOX), SetPadding(0, 0, 0, 1),
NWidget(NWID_SPACER), SetFill(1, 0),
NWidget(NWID_VERTICAL),
NWidget(WWT_LABEL, COLOUR_WHITE, WID_N_DATE), SetDataTip(STR_DATE_LONG_SMALL, STR_NULL),
NWidget(NWID_SPACER), SetFill(0, 1),
EndContainer(),
EndContainer(),
NWidget(WWT_EMPTY, COLOUR_WHITE, WID_N_MESSAGE), SetMinimalSize(428, 48), SetFill(1, 0), SetPadding(0, 5, 0, 5),
NWidget(NWID_VIEWPORT, INVALID_COLOUR, WID_N_VIEWPORT), SetMinimalSize(426, 70), SetPadding(1, 2, 2, 2),
EndContainer(),
}

Definition at line 161 of file news_gui.cpp.

## ◆ _nested_vehicle_news_widgets

const NWidgetPart _nested_vehicle_news_widgets[]
| static

Initial value:
= {
NWidget(WWT_PANEL, COLOUR_WHITE, WID_N_PANEL),
NWidget(NWID_HORIZONTAL), SetPadding(1, 1, 0, 1),
NWidget(NWID_VERTICAL),
NWidget(WWT_CLOSEBOX, COLOUR_WHITE, WID_N_CLOSEBOX), SetPadding(0, 0, 0, 1),
NWidget(NWID_SPACER), SetFill(0, 1),
EndContainer(),
NWidget(WWT_LABEL, COLOUR_WHITE, WID_N_VEH_TITLE), SetFill(1, 1), SetMinimalSize(419, 55), SetDataTip(STR_EMPTY, STR_NULL),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_WHITE, WID_N_VEH_BKGND), SetPadding(0, 25, 1, 25),
NWidget(NWID_VERTICAL),
NWidget(WWT_EMPTY, INVALID_COLOUR, WID_N_VEH_NAME), SetMinimalSize(369, 33), SetFill(1, 0),
NWidget(WWT_EMPTY, INVALID_COLOUR, WID_N_VEH_SPR), SetMinimalSize(369, 32), SetFill(1, 0),
NWidget(WWT_EMPTY, INVALID_COLOUR, WID_N_VEH_INFO), SetMinimalSize(369, 46), SetFill(1, 0),
EndContainer(),
EndContainer(),
EndContainer(),
}

Definition at line 106 of file news_gui.cpp.

## ◆ _news_type_data

NewsTypeData _news_type_data[]
| static

Initial value:
= {
NewsTypeData("news_display.arrival_player", 60, SND_1D_APPLAUSE ),
NewsTypeData("news_display.arrival_other", 60, SND_1D_APPLAUSE ),
NewsTypeData("news_display.accident", 90, SND_BEGIN ),
NewsTypeData("news_display.accident_other", 90, SND_BEGIN ),
NewsTypeData("news_display.company_info", 60, SND_BEGIN ),
NewsTypeData("news_display.open", 90, SND_BEGIN ),
NewsTypeData("news_display.close", 90, SND_BEGIN ),
NewsTypeData("news_display.economy", 30, SND_BEGIN ),
NewsTypeData("news_display.production_player", 30, SND_BEGIN ),
NewsTypeData("news_display.production_other", 30, SND_BEGIN ),
NewsTypeData("news_display.production_nobody", 30, SND_BEGIN ),
NewsTypeData("news_display.advice", 150, SND_BEGIN ),
NewsTypeData("news_display.new_vehicles", 30, SND_1E_NEW_ENGINE),
NewsTypeData("news_display.acceptance", 90, SND_BEGIN ),
NewsTypeData("news_display.subsidies", 180, SND_BEGIN ),
NewsTypeData("news_display.general", 60, SND_BEGIN ),
}

Per-NewsType data.

Definition at line 230 of file news_gui.cpp.

Referenced by MoveToNextNewsItem(), ShowLastNewsMessage(), and ShowNewspaper().

## ◆ _news_window_layout

WindowDesc* _news_window_layout[]
| static

Initial value:
= {
&_thin_news_desc,
&_small_news_desc,
&_normal_news_desc,
&_vehicle_news_desc,
&_company_news_desc,
}

Window layouts for news items.

Definition at line 212 of file news_gui.cpp.

WID_N_PANEL
@ WID_N_PANEL
Panel of the window.
Definition: news_widget.h:17
WID_MH_SCROLLBAR
@ WID_MH_SCROLLBAR
Scrollbar for the list.
Definition: news_widget.h:41
SetScrollbar
static NWidgetPart SetScrollbar(int index)
Attach a scrollbar to a widget.
Definition: widget_type.h:1208
WID_N_MGR_FACE
@ WID_N_MGR_FACE
Face of the manager.
Definition: news_widget.h:27
WWT_STICKYBOX
@ WWT_STICKYBOX
Sticky box (at top-right of a window, after WWT_DEFSIZEBOX)
Definition: widget_type.h:64
SetPadding
static NWidgetPart SetPadding(uint8 top, uint8 right, uint8 bottom, uint8 left)
Widget part function for setting additional space around a widget.
Definition: widget_type.h:1141
WID_N_SHOW_GROUP
@ WID_N_SHOW_GROUP
Show vehicle's group.
Definition: news_widget.h:34
WWT_CAPTION
@ WWT_CAPTION
Window caption (window title between closebox and stickybox)
Definition: widget_type.h:59
NewsTypeData
Per-NewsType data.
Definition: news_type.h:98
WWT_LABEL
@ WWT_LABEL
Centered label.
Definition: widget_type.h:55
WWT_DEFSIZEBOX
@ WWT_DEFSIZEBOX
Default window size box (at top-right of a window, between WWT_SHADEBOX and WWT_STICKYBOX)
Definition: widget_type.h:63
NWID_HORIZONTAL
@ NWID_HORIZONTAL
Horizontal container.
Definition: widget_type.h:73
WID_N_MESSAGE
@ WID_N_MESSAGE
Space for displaying the message. Only used in small news items.
Definition: news_widget.h:26
WID_N_VEH_BKGND
@ WID_N_VEH_BKGND
Dark background of new vehicle news.
Definition: news_widget.h:30
SetResize
static NWidgetPart SetResize(int16 dx, int16 dy)
Widget part function for setting the resize step.
Definition: widget_type.h:995
WID_N_CLOSEBOX
@ WID_N_CLOSEBOX
Close the window.
Definition: news_widget.h:20
WWT_EMPTY
@ WWT_EMPTY
Empty widget, place holder to reserve space in widget array.
Definition: widget_type.h:46
WID_N_INSET
@ WID_N_INSET
Inset around the viewport in the window. Only used in small news items.
Definition: news_widget.h:23
SetDataTip
static NWidgetPart SetDataTip(uint32 data, StringID tip)
Widget part function for setting the data and tooltip.
Definition: widget_type.h:1109
SND_1E_NEW_ENGINE
@ SND_1E_NEW_ENGINE
28 == 0x1C News: new engine available
Definition: sound_type.h:67
WID_N_VEH_SPR
@ WID_N_VEH_SPR
Graphical display of the new vehicle.
Definition: news_widget.h:32
NWID_VIEWPORT
@ NWID_VIEWPORT
Nested widget containing a viewport.
Definition: widget_type.h:79
WID_N_MGR_NAME
@ WID_N_MGR_NAME
Name of the manager.
Definition: news_widget.h:28
WID_N_TITLE
@ WID_N_TITLE
Title of the company news.
Definition: news_widget.h:18
WID_N_VEH_TITLE
@ WID_N_VEH_TITLE
Vehicle new title.
Definition: news_widget.h:29
WID_N_DATE
@ WID_N_DATE
Date of the news item.
Definition: news_widget.h:21
WID_N_HEADLINE
@ WID_N_HEADLINE
The news headline.
Definition: news_widget.h:19
NWID_VERTICAL
@ NWID_VERTICAL
Vertical container.
Definition: widget_type.h:75
WWT_CLOSEBOX
@ WWT_CLOSEBOX
Close box (at top-left of a window)
Definition: widget_type.h:67
WWT_RESIZEBOX
@ WWT_RESIZEBOX
Resize box (normally at bottom-right of a window)
Definition: widget_type.h:66
EndContainer
static NWidgetPart EndContainer()
Widget part function for denoting the end of a container (horizontal, vertical, WWT_FRAME,...
Definition: widget_type.h:1094
NWID_VSCROLLBAR
@ NWID_VSCROLLBAR
Vertical scrollbar.
Definition: widget_type.h:82
WID_N_VEH_INFO
@ WID_N_VEH_INFO
Some technical data of the new vehicle.
Definition: news_widget.h:33
WID_N_CAPTION
@ WID_N_CAPTION
Title bar of the window. Only used in small news items.
Definition: news_widget.h:22
WID_MH_BACKGROUND
@ WID_MH_BACKGROUND
Background of the window.
Definition: news_widget.h:40
NWidget
static NWidgetPart NWidget(WidgetType tp, Colours col, int16 idx=-1)
Widget part function for starting a new 'real' widget.
Definition: widget_type.h:1227
SetMinimalSize
static NWidgetPart SetMinimalSize(int16 x, int16 y)
Widget part function for setting the minimal size.
Definition: widget_type.h:1012
WWT_PANEL
@ WWT_PANEL
Simple depressed panel.
Definition: widget_type.h:48
WID_N_COMPANY_MSG
@ WID_N_COMPANY_MSG
Message in company news items.
Definition: news_widget.h:25
NWID_SPACER
@ NWID_SPACER
Invisible widget that takes some space.
Definition: widget_type.h:77
WWT_INSET
@ WWT_INSET
Pressed (inset) panel, most commonly used as combo box text area.
Definition: widget_type.h:49
WID_N_VEH_NAME
@ WID_N_VEH_NAME
Name of the new vehicle.
Definition: news_widget.h:31
SetFill
static NWidgetPart SetFill(uint fill_x, uint fill_y)
Widget part function for setting filling.
Definition: widget_type.h:1078
WID_N_VIEWPORT
@ WID_N_VIEWPORT
Viewport in the window.
Definition: news_widget.h:24
SND_1D_APPLAUSE
@ SND_1D_APPLAUSE
27 == 0x1B News: first vehicle at station
Definition: sound_type.h:66
WWT_TEXTBTN
@ WWT_TEXTBTN
(Toggle) Button with text
Definition: widget_type.h:53
WWT_SHADEBOX
@ WWT_SHADEBOX
Shade box (at top-right of a window, between WWT_DEBUGBOX and WWT_DEFSIZEBOX)
Definition: widget_type.h:62