|
OpenTTD Source
14.0-beta3
|
Go to the documentation of this file.
43 #include "table/strings.h"
47 const NewsItem *_statusbar_news_item =
nullptr;
85 static constexpr
NWidgetPart _nested_normal_news_widgets[] = {
99 static WindowDesc _normal_news_desc(__FILE__, __LINE__,
103 std::begin(_nested_normal_news_widgets), std::end(_nested_normal_news_widgets)
107 static constexpr
NWidgetPart _nested_vehicle_news_widgets[] = {
126 static WindowDesc _vehicle_news_desc(__FILE__, __LINE__,
130 std::begin(_nested_vehicle_news_widgets), std::end(_nested_vehicle_news_widgets)
134 static constexpr
NWidgetPart _nested_company_news_widgets[] = {
154 static WindowDesc _company_news_desc(__FILE__, __LINE__,
158 std::begin(_nested_company_news_widgets), std::end(_nested_company_news_widgets)
162 static constexpr
NWidgetPart _nested_thin_news_widgets[] = {
172 NWidget(
WWT_EMPTY, COLOUR_WHITE,
WID_N_MESSAGE),
SetMinimalSize(428, 48),
SetFill(1, 0),
SetPadding(0, 5, 0, 5),
177 static WindowDesc _thin_news_desc(__FILE__, __LINE__,
181 std::begin(_nested_thin_news_widgets), std::end(_nested_thin_news_widgets)
185 static constexpr
NWidgetPart _nested_small_news_widgets[] = {
191 SetDataTip(STR_NULL , STR_NEWS_SHOW_VEHICLE_GROUP_TOOLTIP),
199 NWidget(
WWT_EMPTY, COLOUR_WHITE,
WID_N_MESSAGE),
SetMinimalSize(275, 20),
SetFill(1, 0),
SetPadding(0, 5, 0, 5),
203 static WindowDesc _small_news_desc(__FILE__, __LINE__,
207 std::begin(_nested_small_news_widgets), std::end(_nested_small_news_widgets)
236 NewsTypeData(
"news_display.accident_other", 90, SND_BEGIN ),
237 NewsTypeData(
"news_display.company_info", 60, SND_BEGIN ),
241 NewsTypeData(
"news_display.production_player", 30, SND_BEGIN ),
242 NewsTypeData(
"news_display.production_other", 30, SND_BEGIN ),
243 NewsTypeData(
"news_display.production_nobody", 30, SND_BEGIN ),
246 NewsTypeData(
"news_display.acceptance", 90, SND_BEGIN ),
247 NewsTypeData(
"news_display.subsidies", 180, SND_BEGIN ),
275 this->chat_height = (w !=
nullptr) ? w->
height : 0;
283 if (desc == &_company_news_desc) this->GetWidget<NWidgetCore>(
WID_N_TITLE)->widget_data = this->ni->
params[0].data;
310 if (nvp !=
nullptr) {
327 void DrawNewsBorder(
const Rect &r)
const
339 Point OnInitialPosition([[maybe_unused]] int16_t sm_width, [[maybe_unused]] int16_t sm_height, [[maybe_unused]]
int window_number)
override
341 Point pt = { 0, _screen.height };
354 *size =
maxdim(*size, d2);
364 str = STR_JUST_RAW_STRING;
373 str = this->GetCompanyMessageString();
378 str = this->GetNewVehicleMessageString(widget);
411 d.width = (d.width >= padding.width) ? d.width - padding.width : 0;
412 d.height = (d.height >= padding.height) ? d.height - padding.height : 0;
414 d.width += padding.width;
415 d.height += padding.height;
419 void SetStringParameters(
WidgetID widget)
const override
424 void DrawWidget(
const Rect &r,
WidgetID widget)
const override
432 this->DrawNewsBorder(r);
468 DrawVehicleEngine(r.left, r.right,
CenterBounds(r.left, r.right, 0),
CenterBounds(r.top, r.bottom, 0), engine,
GetEnginePalette(engine,
_local_company),
EIT_PREVIEW);
481 void OnClick([[maybe_unused]]
Point pt,
WidgetID widget, [[maybe_unused]]
int click_count)
override
487 _forced_news =
nullptr;
543 void OnInvalidateData([[maybe_unused]]
int data = 0, [[maybe_unused]]
bool gui_scope =
true)
override
545 if (!gui_scope)
return;
547 int newtop = this->
top + this->chat_height - data;
548 this->chat_height = data;
565 int newtop = std::max(this->
top - 2 *
static_cast<int>(count), _screen.height - this->height - this->status_height - this->chat_height);
576 if (this->
top == newtop)
return;
578 int mintop = std::min(newtop, this->
top);
579 int maxtop = std::max(newtop, this->
top);
586 StringID GetCompanyMessageString()
const
590 return this->ni->
params[1].data;
601 return STR_NEWS_NEW_VEHICLE_NOW_AVAILABLE;
605 return STR_NEWS_NEW_VEHICLE_TYPE;
629 _statusbar_news_item = ni;
647 _statusbar_news_item =
nullptr;
657 const NewsItem *ni = _statusbar_news_item;
658 if (ni ==
nullptr)
return true;
672 if (ni ==
nullptr)
return true;
688 _statusbar_news_item = (_statusbar_news_item ==
nullptr) ?
_oldest_news : _statusbar_news_item->
next;
689 const NewsItem *ni = _statusbar_news_item;
696 default: NOT_REACHED();
733 default: NOT_REACHED();
752 if (ni->
prev !=
nullptr) {
759 if (ni->
next !=
nullptr) {
778 if (_statusbar_news_item == ni) {
781 _statusbar_news_item = ni->
prev;
807 string_id(string_id), date(
TimerGameCalendar::date), economy_date(
TimerGameEconomy::date), type(type), flags(flags), reftype1(reftype1), reftype2(reftype2), ref1(ref1), ref2(ref2), data(data)
829 if (_game_mode == GM_MENU)
return;
832 NewsItem *ni =
new NewsItem(
string, type, flags, reftype1, ref1, reftype2, ref2, data);
923 while (ni !=
nullptr) {
942 while (ni !=
nullptr) {
959 while (ni !=
nullptr) {
975 while (ni !=
nullptr) {
985 static void RemoveOldNewsItems()
1017 RemoveOldNewsItems();
1049 if (w ==
nullptr)
return false;
1086 if (ni ==
nullptr) {
1134 resize->height = this->line_height;
1142 size->width = std::max(200u, size->width);
1152 void DrawWidget(
const Rect &r,
WidgetID widget)
const override
1158 for (
int n = this->vscroll->
GetPosition(); n > 0; n--) {
1160 if (ni ==
nullptr)
return;
1168 for (
int n = this->vscroll->
GetCapacity(); n > 0; n--) {
1170 DrawString(date.left, date.right, y, STR_JUST_DATE_TINY, TC_WHITE);
1173 y += this->line_height;
1176 if (ni ==
nullptr)
return;
1185 void OnInvalidateData([[maybe_unused]]
int data = 0, [[maybe_unused]]
bool gui_scope =
true)
override
1187 if (!gui_scope)
return;
1191 void OnClick([[maybe_unused]]
Point pt,
WidgetID widget, [[maybe_unused]]
int click_count)
override
1195 if (ni ==
nullptr)
return;
1199 if (ni ==
nullptr)
return;
1212 static constexpr
NWidgetPart _nested_message_history[] = {
1222 NWidget(
WWT_PANEL, COLOUR_BROWN,
WID_MH_BACKGROUND),
SetMinimalSize(200, 125),
SetDataTip(0x0, STR_MESSAGE_HISTORY_TOOLTIP),
SetResize(1, 12),
SetScrollbar(
WID_MH_SCROLLBAR),
1231 static WindowDesc _message_history_desc(__FILE__, __LINE__,
1235 std::begin(_nested_message_history), std::end(_nested_message_history)
@ VEH_AIRCRAFT
Aircraft vehicle type.
StringID GetEngineInfoString(EngineID engine)
Get a multi-line string with some technical data, describing the engine.
void AddNewsItem(StringID string, NewsType type, NewsFlag flags, NewsReferenceType reftype1, uint32_t ref1, NewsReferenceType reftype2, uint32_t ref2, const NewsAllocatedData *data)
Add a new newsitem to be shown.
NewsItem(StringID string_id, NewsType type, NewsFlag flags, NewsReferenceType reftype1, uint32_t ref1, NewsReferenceType reftype2, uint32_t ref2, const NewsAllocatedData *data)
Create a new newsitem to be shown.
uint16_t status_height
Height of the status bar window.
void InvalidateWindowData(WindowClass cls, WindowNumber number, int data, bool gui_scope)
Mark window data of the window of a given class and specific window number as invalid (in need of re-...
@ EIT_PREVIEW
Vehicle drawn in preview window, news, ...
void CopyInDParam(const std::span< const StringParameterBackup > backup)
Copy the parameters from the backup into the global string parameter array.
void DeleteStationNews(StationID sid)
Remove news regarding given station so there are no 'unknown station now accepts Mail' or 'First trai...
static Titem * Get(size_t index)
Returns Titem with given index.
bool ScrollMainWindowToTile(TileIndex tile, bool instant)
Scrolls the viewport of the main window to a given location.
std::unique_ptr< const NewsAllocatedData > data
Custom data for the news item that will be deallocated (deleted) when the news item has reached its e...
void AddDirtyBlock(int left, int top, int right, int bottom)
Extend the internal _invalid_rect rectangle to contain the rectangle defined by the given parameters.
void SetWindowDirty(WindowClass cls, WindowNumber number)
Mark window as dirty (in need of repainting)
@ NR_TILE
Reference tile. Scroll to tile when clicking on the news.
void ShowExtraViewportWindow(TileIndex tile=INVALID_TILE)
Show a new Extra Viewport window.
static int duration
Remaining time for showing the current news message (may only be access while a news item is displaye...
Dimensions (a width and height) of a rectangle in 2D.
static void DrawNewsString(uint left, uint right, int y, TextColour colour, const NewsItem *ni)
Draw an unformatted news message truncated to a maximum length.
static const CommandCost CMD_ERROR
Define a default return value for a failed command.
Rect Shrink(int s) const
Copy and shrink Rect by s pixels.
static const SettingDesc * GetSettingFromName(const std::string_view name, const SettingTable &settings)
Given a name of setting, return a setting description from the table.
static WindowDesc * _news_window_layout[]
Window layouts for news items.
Information about a single item of news.
Container for any custom data that must be deleted after the news item has reached end-of-life.
uint32_t StringID
Numeric value that represents a string, independent of the selected language.
@ WF_DISABLE_VP_SCROLL
Window does not do autoscroll,.
static const uint8_t PC_WHITE
White palette colour.
ViewportData * viewport
Pointer to viewport data, if present.
static TileIndex GetReferenceTile(NewsReferenceType reftype, uint32_t ref)
Get the position a news-reference is referencing.
void CloseWindowById(WindowClass cls, WindowNumber number, bool force, int data)
Close a window by its class and window number (if it is open).
@ FILLRECT_RECOLOUR
Apply a recolour sprite to the screen content.
constexpr static debug_inline uint GB(const T x, const uint8_t s, const uint8_t n)
Fetch n bits from x, started at bit s.
std::vector< StringParameterBackup > params
Parameters for string resolving.
void OnInvalidateData([[maybe_unused]] int data=0, [[maybe_unused]] bool gui_scope=true) override
Some data on this window has become invalid.
static Month month
Current month (0..11).
int top
Screen coordinate top edge of the viewport.
CommandCost CmdCustomNewsItem(DoCommandFlag flags, NewsType type, NewsReferenceType reftype1, CompanyID company, uint32_t reference, const std::string &text)
Create a new custom news item.
Dimension maxdim(const Dimension &d1, const Dimension &d2)
Compute bounding box of both dimensions.
virtual void Close(int data=0)
Hide the window and all its child windows, and mark them for a later deletion.
Window * FindWindowById(WindowClass cls, WindowNumber number)
Find a window by its class and window number.
constexpr TileIndex INVALID_TILE
The very nice invalid tile marker.
static void StrMakeValid(T &dst, const char *str, const char *last, StringValidationSettings settings)
Copies the valid (UTF-8) characters from str up to last to the dst.
bool _ctrl_pressed
Is Ctrl pressed?
StringID GetEngineCategoryName(EngineID engine)
Return the category of an engine.
void ShowMessageHistory()
Display window with news messages history.
TextColour
Colour of the strings, see _string_colourmap in table/string_colours.h or docs/ottd-colourtext-palett...
void ChangeVehicleNews(VehicleID from_index, VehicleID to_index)
Report a change in vehicle IDs (due to autoreplace) to affected vehicle news.
@ WC_MESSAGE_HISTORY
News history list; Window numbers:
static Station * Get(size_t index)
Gets station with given index.
ClientSettings _settings_client
The current settings for this game.
static bool IsValidID(size_t index)
Tests whether given index is a valid index for station of this type.
Owner owner
The owner of the content shown in this window. Company colour is acquired from this variable.
constexpr uint Vertical() const
Get total vertical padding of RectPadding.
@ NFB_WINDOW_LAYOUT
First bit for window layout.
NewsReferenceType reftype2
Type of ref2.
IntervalTimer< TimerWindow > scroll_interval
Scroll the news message slowly up from the bottom.
@ NF_VEHICLE_PARAM0
Bit value for specifying that string param 0 contains a vehicle ID. (special autoreplace behaviour)
void OnResize() override
Called after the window got resized.
TimerGameCalendar::Date date
Calendar date to show for the news.
void SetWindowTop(int newtop)
Moves the window to a new top coordinate.
Rect Expand(int s) const
Copy and expand Rect by s pixels.
ZoomLevel ScaleZoomGUI(ZoomLevel value)
Scale zoom level relative to GUI zoom.
@ VEH_ROAD
Road vehicle type.
bool IsNewsTickerShown()
Checks whether the news ticker is currently being used.
Owner
Enum for all companies/owners.
const Scrollbar * GetScrollbar(WidgetID widnum) const
Return the Scrollbar to a widget index.
@ DC_EXEC
execute the given command
PaletteID GetEnginePalette(EngineID engine_type, CompanyID company)
Get the colour map for an engine.
DoCommandFlag
List of flags for a command.
int32_t x_pos
x coordinate.
@ SND_1E_NEW_ENGINE
28 == 0x1C News: new engine available
Scrollbar * vscroll
< Width needed for the date part.
@ NR_ENGINE
Reference engine.
@ NR_NONE
Empty reference.
NewsFlag flags
NewsFlags bits.
@ NF_NO_TRANSPARENT
Bit value for disabling transparency.
const byte age
Maximum age of news items (in days)
const SoundFx sound
Sound.
High level window description.
@ NR_TOWN
Reference town. Scroll to town when clicking on the news.
constexpr uint Horizontal() const
Get total horizontal padding of RectPadding.
static uint _total_news
current number of news items
Window class displaying a news item.
@ NT_END
end-of-array marker
NewsType type
Type of the news.
int PositionNewsMessage(Window *w)
(Re)position news message window at the screen.
@ WDP_AUTO
Find a place automatically.
void DeleteVehicleNews(VehicleID vid, StringID news)
Delete a news item type about a vehicle.
ResizeInfo resize
Resize information.
Common return value for all commands.
@ PreviewNews
Name is shown in exclusive preview or newspaper.
SoundSettings sound
sound effect settings
@ FS_NORMAL
Index of the normal font in the font tables.
Timer that is increased every 27ms, and counts towards ticks / days / months / years.
@ NF_INCOLOUR
Bit value for coloured news.
void ShowCompanyGroupForVehicle(const Vehicle *v)
Show the group window for the given vehicle.
int height
Height of the window (number of pixels down in y direction)
uint64_t PackEngineNameDParam(EngineID engine_id, EngineNameContext context, uint32_t extra_data=0)
Combine an engine ID and a name context to an engine name dparam.
@ SBI_NEWS_DELETED
abort current news display (active news were deleted)
@ FS_SMALL
Index of the small font in the font tables.
bool ScrollWindowToTile(TileIndex tile, Window *w, bool instant)
Scrolls the viewport in a window to a given location.
static Date ConvertYMDToDate(Year year, Month month, Day day)
Converts a tuple of Year, Month and Day to a Date.
@ INVALID_OWNER
An invalid owner.
static uint MIN_NEWS_AMOUNT
preferred minimum amount of news messages
NewsReferenceType
References to objects in news.
const char *const name
Name.
bool news_full
Play sound effects associated to certain news types.
void OnRealtimeTick([[maybe_unused]] uint delta_ms) override
Called periodically.
static void DeleteNewsItem(NewsItem *ni)
Delete a news item from the queue.
void OnPaint() override
The window must be repainted.
static const PaletteID PALETTE_NEWSPAPER
Recolour sprite for newspaper-greying.
static void MoveToNextTickerItem()
Move to the next ticker item.
static uint MAX_NEWS_AMOUNT
Do not exceed this number of news messages.
TileIndexDiff TileDiffXY(int x, int y)
Calculates an offset for the given coordinate(-offset).
Container for a single string to be passed as NewsAllocatedData.
static constexpr TimerGame< struct Calendar >::Year ORIGINAL_MAX_YEAR
The maximum year of the original TTD.
NewsDisplay GetDisplay() const
Return the news display option.
CompanyID _local_company
Company controlled by the human player at this client. Can also be COMPANY_SPECTATOR.
static void ShowTicker(const NewsItem *ni)
Show news item in the ticker.
int left
x position of left edge of the window
void CopyOutDParam(std::vector< StringParameterBackup > &backup, size_t num)
Copy num string parameters from the global string parameter array to the backup.
Rect Indent(int indent, bool end) const
Copy Rect and indent it from its position.
TimerGameCalendar::Year coloured_news_year
when does newspaper become coloured?
StringID string_id
Message text.
uint16_t chat_height
Height of the chat window.
Rect WithWidth(int width, bool end) const
Copy Rect and set its width.
NewsItem * prev
Previous news item.
uint32_t VehicleID
The type all our vehicle IDs have.
@ ND_OFF
Only show a reminder in the status bar.
Dimension GetStringMultiLineBoundingBox(StringID str, const Dimension &suggestion)
Calculate string bounding box for multi-line strings.
void OnResize() override
Called after the window got resized.
Coordinates of a point in 2D.
bool ScrollMainWindowTo(int x, int y, int z, bool instant)
Scrolls the main window to given coordinates.
static const NewsItem * _forced_news
Forced news item.
int CenterBounds(int min, int max, int size)
Determine where to draw a centred object inside a widget.
void DeleteIndustryNews(IndustryID iid)
Remove news regarding given industry.
NewsItem * next
Next news item.
WindowNumber window_number
Window number within the window class.
@ SBI_SHOW_REMINDER
show a reminder (dot on the right side of the statusbar)
void GfxFillRect(int left, int top, int right, int bottom, int colour, FillRectMode mode)
Applies a certain FillRectMode-operation to a rectangle [left, right] x [top, bottom] on the screen.
SoundFx
Sound effects from baseset.
@ NF_NORMAL
Normal news item. (Newspaper with text only)
@ WC_NONE
No window, redirects to WC_MAIN_WINDOW.
NewsDisplay
News display options.
uint32_t ref2
Reference 2 to some object: Used for scrolling after clicking on the news, and for deleting the news ...
int32_t z_pos
z coordinate.
bool IsValidTile(Tile tile)
Checks if a tile is valid.
uint32_t ref1
Reference 1 to some object: Used for a possible viewport, scrolling after clicking on the news,...
int DrawStringMultiLine(int left, int right, int top, int bottom, std::string_view str, TextColour colour, StringAlignment align, bool underline, FontSize fontsize)
Draw string, possibly over multiple lines.
CompanyID _current_company
Company currently doing an action.
void CreateNestedTree()
Perform the first part of the initialization of a nested widget tree.
@ NR_INDUSTRY
Reference industry. Scroll to industry when clicking on the news. Delete news when industry is delete...
const NewsItem * ni
News item to display.
static void ShowNewsMessage(const NewsItem *ni)
Do a forced show of a specific message.
Properties of config file settings.
static RoadVehicle * From(Vehicle *v)
Converts a Vehicle to SpecializedVehicle with type checking.
static void ShowNewspaper(const NewsItem *ni)
Open up an own newspaper window for the news item.
void SetDParam(size_t n, uint64_t v)
Set a string parameter v at index n in the global string parameter array.
int32_t Read(const void *object) const
Read the integer from the the actual setting.
void ShowLastNewsMessage()
Show previous news item.
TimerGameEconomy::Date economy_date
Economy date of the news item, never shown but used to calculate age.
int date_width
< Height of a single line in the news history window including spacing.
@ NFB_WINDOW_LAYOUT_COUNT
Number of bits for window layout.
std::string GetString(StringID string)
Resolve the given StringID into a std::string with all the associated DParam lookups and formatting.
Window * FindWindowByClass(WindowClass cls)
Find any window by its class.
static const uint8_t PC_GREY
Grey palette colour.
void SetDParamStr(size_t n, const char *str)
This function is used to "bind" a C string to a OpenTTD dparam slot.
@ OWNER_DEITY
The object is owned by a superuser / goal script.
static const NewsItem * _current_news
Current news item (last item shown regularly).
void FinishInitNested(WindowNumber window_number=0)
Perform the second part of the initialization of a nested widget tree.
TileIndex xy
Base tile of the station.
void OnInvalidateData([[maybe_unused]] int data=0, [[maybe_unused]] bool gui_scope=true) override
Some data on this window has become invalid.
static const uint8_t PC_BLACK
Black palette colour.
byte news_message_timeout
how much longer than the news message "age" should we keep the message in the history
int top
y position of top edge of the window
int32_t y_pos
y coordinate.
bool news_ticker
Play a ticker sound when a news item is published.
@ NR_VEHICLE
Reference vehicle. Scroll to vehicle when clicking on the news. Delete news when vehicle is deleted.
void DrawCompanyManagerFace(CompanyManagerFace cmf, Colours colour, const Rect &r)
Draws the face of a company manager's face.
@ WC_SEND_NETWORK_MSG
Chatbox; Window numbers:
void ShowVehicleViewWindow(const Vehicle *v)
Shows the vehicle view window of the given vehicle.
@ SA_CENTER
Center both horizontally and vertically.
int GetCharacterHeight(FontSize size)
Get height of a character for a given font size.
#define lengthof(x)
Return the length of an fixed size array.
int width
width of the window (number of pixels to the right in x direction)
NewsItem * _latest_news
tail of news items queue
@ WDP_MANUAL
Manually align the window (so no automatic location finding)
static bool ReadyForNextNewsItem()
Are we ready to show another news item? Only if no newspaper is displayed.
@ ZOOM_LVL_NEWS
Default zoom level for the news messages.
@ NF_SHADE
Bit value for enabling shading.
int DrawString(int left, int right, int top, std::string_view str, TextColour colour, StringAlignment align, bool underline, FontSize fontsize)
Draw string, possibly truncated to make it fit in its allocated space.
bool IsBus() const
Check whether a roadvehicle is a bus.
bool HideActiveNewsMessage()
Close active news message window.
static void MoveToNextNewsItem()
Move to the next news item.
std::string string
The string to retain.
NewsFlag
Various OR-able news-item flags.
static NewsItem * _oldest_news
head of news items queue
static NewsTypeData _news_type_data[]
Per-NewsType data.
uint16_t EngineID
Unique identification number of an engine.
Data structure for an opened window.
@ VEH_TRAIN
Train vehicle type.
@ SVS_REPLACE_TAB_CR_NL_WITH_SPACE
Replace tabs ('\t'), carriage returns ('\r') and newlines (' ') with spaces.
static bool IsValidID(size_t index)
Tests whether given index can be used to get valid (non-nullptr) Titem.
@ WC_STATUS_BAR
Statusbar (at the bottom of your screen); Window numbers:
VehicleType type
Type of vehicle.
void DeleteInvalidEngineNews()
Remove engine announcements for invalid engines.
void DrawWidgets() const
Paint all widgets of a window.
@ WC_NEWS_WINDOW
News window; Window numbers:
virtual bool IsIntSetting() const
Check whether this setting is an integer type setting.
Dimension GetScaledSpriteSize(SpriteID sprid)
Scale sprite size for GUI.
void InitNewsItemStructs()
Initialize the news-items data structures.
@ VEH_SHIP
Ship vehicle type.
Specification of a rectangle with absolute coordinates of all edges.
@ SND_1D_APPLAUSE
27 == 0x1B News: first vehicle at station
@ NR_STATION
Reference station. Scroll to station when clicking on the news. Delete news when station is deleted.
@ TD_RTL
Text is written right-to-left by default.
TextDirection _current_text_dir
Text direction of the currently selected language.
Timer that is increased every 27ms, and counts towards economy time units, expressed in days / months...
uint8_t Month
Type for the month, note: 0 based, i.e.
Dimension GetStringBoundingBox(std::string_view str, FontSize start_fontsize)
Return the string dimension in pixels.
void DrawVehicleEngine(int left, int right, int preferred_x, int y, EngineID engine, PaletteID pal, EngineImageType image_type)
Draw an engine.
@ SBI_SHOW_TICKER
start scrolling news
static const StringID INVALID_STRING_ID
Constant representing an invalid string (16bit in case it is used in savegames)
GUISettings gui
settings related to the GUI
NewsReferenceType reftype1
Type of ref1.
const struct IntSettingDesc * AsIntSetting() const
Get the setting description of this setting as an integer setting.
@ SND_16_NEWS_TICKER
20 == 0x14 News ticker
static bool ReadyForNextTickerItem()
Are we ready to show another ticker item? Only if nothing is in the newsticker is displayed.
static Year year
Current year, starting at 0.
static Date date
Current date in days (day counter).