OpenTTD Source: src/statusbar_gui.cpp Source File

OpenTTD Source 13.2.1

statusbar_gui.cpp
Go to the documentation of this file.
1 /*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6 */
7
10 #include "stdafx.h"
11 #include "date_func.h"
12 #include "gfx_func.h"
13 #include "news_func.h"
14 #include "company_func.h"
15 #include "string_func.h"
16 #include "strings_func.h"
17 #include "company_base.h"
18 #include "tilehighlight_func.h"
19 #include "news_gui.h"
20 #include "company_gui.h"
21 #include "window_gui.h"
22 #include "saveload/saveload.h"
23 #include "window_func.h"
24 #include "statusbar_gui.h"
25 #include "toolbar_gui.h"
26 #include "core/geometry_func.hpp"
27 #include "guitimer_func.h"
28 #include "zoom_func.h"
29
30 #include "widgets/statusbar_widget.h"
31
32 #include "table/strings.h"
33 #include "table/sprites.h"
34
35 #include "safeguards.h"
36
37 static bool DrawScrollingStatusText(const NewsItem *ni, int scroll_pos, int left, int right, int top, int bottom)
38 {
39 CopyInDParam(0, ni->params, lengthof(ni->params));
40 StringID str = ni->string_id;
41
42 char buf[512];
43 GetString(buf, str, lastof(buf));
44 const char *s = buf;
45
46 char buffer[256];
47 char *d = buffer;
48 const char *last = lastof(buffer);
49
50 for (;;) {
51 WChar c = Utf8Consume(&s);
52 if (c == 0) {
53 break;
54 } else if (c == '\n') {
55 if (d + 4 >= last) break;
56 d[0] = d[1] = d[2] = d[3] = ' ';
57 d += 4;
58 } else if (IsPrintable(c)) {
59 if (d + Utf8CharLen(c) >= last) break;
60 d += Utf8Encode(d, c);
61 }
62 }
63 *d = '\0';
64
65 DrawPixelInfo tmp_dpi;
66 if (!FillDrawPixelInfo(&tmp_dpi, left, top, right - left, bottom)) return true;
67
68 int width = GetStringBoundingBox(buffer).width;
69 int pos = (_current_text_dir == TD_RTL) ? (scroll_pos - width) : (right - scroll_pos - left);
70
71 DrawPixelInfo *old_dpi = _cur_dpi;
72 _cur_dpi = &tmp_dpi;
73 DrawString(pos, INT16_MAX, 0, buffer, TC_LIGHT_BLUE, SA_LEFT | SA_FORCE);
74 _cur_dpi = old_dpi;
75
76 return (_current_text_dir == TD_RTL) ? (pos < right - left) : (pos + width > 0);
77 }
78
79 struct StatusBarWindow : Window {
80 bool saving;
81 int ticker_scroll;
82 GUITimer ticker_timer;
83 GUITimer reminder_timeout;
84
85 static const int TICKER_STOP = 1640;
86 static const int REMINDER_START = 1350;
87 static const int REMINDER_STOP = 0;
88 static const int COUNTER_STEP = 2;
89
90 StatusBarWindow(WindowDesc *desc) : Window(desc)
91 {
92 this->ticker_scroll = TICKER_STOP;
93 this->ticker_timer.SetInterval(15);
94 this->reminder_timeout.SetInterval(REMINDER_STOP);
95
96 this->InitNested();
97 CLRBITS(this->flags, WF_WHITE_BORDER);
98 PositionStatusbar(this);
99 }
100
101 Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number) override
102 {
103 Point pt = { 0, _screen.height - sm_height };
104 return pt;
105 }
106
107 void FindWindowPlacementAndResize(int def_width, int def_height) override
108 {
109 Window::FindWindowPlacementAndResize(_toolbar_width, def_height);
110 }
111
112 void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
113 {
114 Dimension d;
115 switch (widget) {
116 case WID_S_LEFT:
117 SetDParamMaxValue(0, MAX_YEAR * DAYS_IN_YEAR);
118 d = GetStringBoundingBox(STR_WHITE_DATE_LONG);
119 break;
120
121 case WID_S_RIGHT: {
122 int64 max_money = UINT32_MAX;
123 for (const Company *c : Company::Iterate()) max_money = std::max<int64>(c->money, max_money);
124 SetDParam(0, 100LL * max_money);
125 d = GetStringBoundingBox(STR_COMPANY_MONEY);
126 break;
127 }
128
129 default:
130 return;
131 }
132
133 d.width += padding.width;
134 d.height += padding.height;
135 *size = maxdim(d, *size);
136 }
137
138 void DrawWidget(const Rect &r, int widget) const override
139 {
140 Rect tr = r.Shrink(WidgetDimensions::scaled.framerect, RectPadding::zero);
141 tr.top = CenterBounds(r.top, r.bottom, FONT_HEIGHT_NORMAL);
142 switch (widget) {
143 case WID_S_LEFT:
144 /* Draw the date */
145 SetDParam(0, _date);
146 DrawString(tr, STR_WHITE_DATE_LONG, TC_FROMSTRING, SA_HOR_CENTER);
147 break;
148
149 case WID_S_RIGHT: {
150 if (_local_company == COMPANY_SPECTATOR) {
151 DrawString(tr, STR_STATUSBAR_SPECTATOR, TC_FROMSTRING, SA_HOR_CENTER);
152 } else {
153 /* Draw company money, if any */
154 const Company *c = Company::GetIfValid(_local_company);
155 if (c != nullptr) {
156 SetDParam(0, c->money);
157 DrawString(tr, STR_COMPANY_MONEY, TC_FROMSTRING, SA_HOR_CENTER);
158 }
159 }
160 break;
161 }
162
163 case WID_S_MIDDLE:
164 /* Draw status bar */
165 if (this->saving) { // true when saving is active
166 DrawString(tr, STR_STATUSBAR_SAVING_GAME, TC_FROMSTRING, SA_HOR_CENTER | SA_VERT_CENTER);
167 } else if (_do_autosave) {
168 DrawString(tr, STR_STATUSBAR_AUTOSAVE, TC_FROMSTRING, SA_HOR_CENTER);
169 } else if (_pause_mode != PM_UNPAUSED) {
170 StringID msg = (_pause_mode & PM_PAUSED_LINK_GRAPH) ? STR_STATUSBAR_PAUSED_LINK_GRAPH : STR_STATUSBAR_PAUSED;
171 DrawString(tr, msg, TC_FROMSTRING, SA_HOR_CENTER);
172 } else if (this->ticker_scroll < TICKER_STOP && _statusbar_news_item != nullptr && _statusbar_news_item->string_id != 0) {
173 /* Draw the scrolling news text */
174 if (!DrawScrollingStatusText(_statusbar_news_item, ScaleGUITrad(this->ticker_scroll), tr.left, tr.right, tr.top, tr.bottom)) {
175 InvalidateWindowData(WC_STATUS_BAR, 0, SBI_NEWS_DELETED);
176 if (Company::IsValidID(_local_company)) {
177 /* This is the default text */
178 SetDParam(0, _local_company);
179 DrawString(tr, STR_STATUSBAR_COMPANY_NAME, TC_FROMSTRING, SA_HOR_CENTER);
180 }
181 }
182 } else {
183 if (Company::IsValidID(_local_company)) {
184 /* This is the default text */
185 SetDParam(0, _local_company);
186 DrawString(tr, STR_STATUSBAR_COMPANY_NAME, TC_FROMSTRING, SA_HOR_CENTER);
187 }
188 }
189
190 if (!this->reminder_timeout.HasElapsed()) {
191 Dimension icon_size = GetSpriteSize(SPR_UNREAD_NEWS);
192 DrawSprite(SPR_UNREAD_NEWS, PAL_NONE, tr.right - icon_size.width, CenterBounds(r.top, r.bottom, icon_size.height));
193 }
194 break;
195 }
196 }
197
203 void OnInvalidateData(int data = 0, bool gui_scope = true) override
204 {
205 if (!gui_scope) return;
206 switch (data) {
207 default: NOT_REACHED();
208 case SBI_SAVELOAD_START: this->saving = true; break;
209 case SBI_SAVELOAD_FINISH: this->saving = false; break;
210 case SBI_SHOW_TICKER: this->ticker_scroll = 0; break;
211 case SBI_SHOW_REMINDER: this->reminder_timeout.SetInterval(REMINDER_START); break;
212 case SBI_NEWS_DELETED:
213 this->ticker_scroll = TICKER_STOP; // reset ticker ...
214 this->reminder_timeout.SetInterval(REMINDER_STOP); // ... and reminder
215 break;
216 }
217 }
218
219 void OnClick(Point pt, int widget, int click_count) override
220 {
221 switch (widget) {
222 case WID_S_MIDDLE: ShowLastNewsMessage(); break;
223 case WID_S_RIGHT: if (_local_company != COMPANY_SPECTATOR) ShowCompanyFinances(_local_company); break;
224 default: ResetObjectToPlace();
225 }
226 }
227
228 void OnRealtimeTick(uint delta_ms) override
229 {
230 if (_pause_mode != PM_UNPAUSED) return;
231
232 if (this->ticker_scroll < TICKER_STOP) { // Scrolling text
233 uint count = this->ticker_timer.CountElapsed(delta_ms);
234 if (count > 0) {
235 this->ticker_scroll += count;
236 this->SetWidgetDirty(WID_S_MIDDLE);
237 }
238 }
239
240 // Red blot to show there are new unread newsmessages
241 if (this->reminder_timeout.Elapsed(delta_ms)) {
242 this->SetWidgetDirty(WID_S_MIDDLE);
243 }
244 }
245 };
246
247 static const NWidgetPart _nested_main_status_widgets[] = {
248 NWidget(NWID_HORIZONTAL),
249 NWidget(WWT_PANEL, COLOUR_GREY, WID_S_LEFT), SetMinimalSize(140, 12), EndContainer(),
250 NWidget(WWT_PUSHBTN, COLOUR_GREY, WID_S_MIDDLE), SetMinimalSize(40, 12), SetDataTip(0x0, STR_STATUSBAR_TOOLTIP_SHOW_LAST_NEWS), SetResize(1, 0),
251 NWidget(WWT_PUSHBTN, COLOUR_GREY, WID_S_RIGHT), SetMinimalSize(140, 12),
252 EndContainer(),
253 };
254
255 static WindowDesc _main_status_desc(
256 WDP_MANUAL, nullptr, 0, 0,
257 WC_STATUS_BAR, WC_NONE,
258 WDF_NO_FOCUS,
259 _nested_main_status_widgets, lengthof(_nested_main_status_widgets)
260 );
261
265 bool IsNewsTickerShown()
266 {
267 const StatusBarWindow *w = dynamic_cast<StatusBarWindow*>(FindWindowById(WC_STATUS_BAR, 0));
268 return w != nullptr && w->ticker_scroll < StatusBarWindow::TICKER_STOP;
269 }
270
274 void ShowStatusBar()
275 {
276 new StatusBarWindow(&_main_status_desc);
277 }
InvalidateWindowData
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-...
Definition: window.cpp:3254
StatusBarWindow::OnRealtimeTick
void OnRealtimeTick(uint delta_ms) override
Called periodically.
Definition: statusbar_gui.cpp:228
StatusBarWindow::OnClick
void OnClick(Point pt, int widget, int click_count) override
A click with the left mouse button has been made on the window.
Definition: statusbar_gui.cpp:219
WChar
char32_t WChar
Type for wide characters, i.e.
Definition: string_type.h:36
Dimension
Dimensions (a width and height) of a rectangle in 2D.
Definition: geometry_type.hpp:27
Pool::PoolItem<&_company_pool >::GetIfValid
static Titem * GetIfValid(size_t index)
Returns Titem with given index.
Definition: pool_type.hpp:348
statusbar_widget.h
Rect::Shrink
Rect Shrink(int s) const
Copy and shrink Rect by s pixels.
Definition: geometry_type.hpp:92
toolbar_gui.h
guitimer_func.h
statusbar_gui.h
NewsItem
Information about a single item of news.
Definition: news_type.h:126
company_base.h
company_gui.h
Utf8CharLen
static int8 Utf8CharLen(WChar c)
Return the length of a UTF-8 encoded character.
Definition: string_func.h:116
NWID_HORIZONTAL
@ NWID_HORIZONTAL
Horizontal container.
Definition: widget_type.h:73
maxdim
Dimension maxdim(const Dimension &d1, const Dimension &d2)
Compute bounding box of both dimensions.
Definition: geometry_func.cpp:22
FindWindowById
Window * FindWindowById(WindowClass cls, WindowNumber number)
Find a window by its class and window number.
Definition: window.cpp:1161
WID_S_RIGHT
@ WID_S_RIGHT
Right part; bank balance.
Definition: statusbar_widget.h:17
_do_autosave
bool _do_autosave
are we doing an autosave at the moment?
Definition: saveload.cpp:69
WDF_NO_FOCUS
@ WDF_NO_FOCUS
This window won't get focus/make any other window lose focus when click.
Definition: window_gui.h:146
Utf8Encode
size_t Utf8Encode(T buf, WChar c)
Encode a unicode character and place it in the buffer.
Definition: string.cpp:635
SetResize
static NWidgetPart SetResize(int16 dx, int16 dy)
Widget part function for setting the resize step.
Definition: widget_type.h:997
saveload.h
zoom_func.h
DrawString
int DrawString(int left, int right, int top, const char *str, TextColour colour, StringAlignment align, bool underline, FontSize fontsize)
Draw string, possibly truncated to make it fit in its allocated space.
Definition: gfx.cpp:644
StatusBarWindow::OnInitialPosition
Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number) override
Compute the initial position of the window.
Definition: statusbar_gui.cpp:101
SA_VERT_CENTER
@ SA_VERT_CENTER
Vertically center the text.
Definition: gfx_type.h:340
IsNewsTickerShown
bool IsNewsTickerShown()
Checks whether the news ticker is currently being used.
Definition: statusbar_gui.cpp:265
StatusBarWindow
Definition: statusbar_gui.cpp:79
StatusBarWindow::REMINDER_STOP
static const int REMINDER_STOP
reminder disappears when counter reaches this value
Definition: statusbar_gui.cpp:87
SetDParam
static void SetDParam(uint n, uint64 v)
Set a string parameter v at index n in the global string parameter array.
Definition: strings_func.h:196
NWidgetPart
Partial widget specification to allow NWidgets to be written nested.
Definition: widget_type.h:975
SetDataTip
static NWidgetPart SetDataTip(uint32 data, StringID tip)
Widget part function for setting the data and tooltip.
Definition: widget_type.h:1111
GetStringBoundingBox
Dimension GetStringBoundingBox(const char *str, FontSize start_fontsize)
Return the string dimension in pixels.
Definition: gfx.cpp:890
PM_UNPAUSED
@ PM_UNPAUSED
A normal unpaused game.
Definition: openttd.h:61
gfx_func.h
WindowDesc
High level window description.
Definition: window_gui.h:102
window_gui.h
StatusBarWindow::UpdateWidgetSize
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
Update size and resize step of a widget in the window.
Definition: statusbar_gui.cpp:112
PositionStatusbar
int PositionStatusbar(Window *w)
(Re)position statusbar window at the screen.
Definition: window.cpp:3444
ShowCompanyFinances
void ShowCompanyFinances(CompanyID company)
Open the finances window of a company.
Definition: company_gui.cpp:548
GUITimer
Definition: guitimer_func.h:13
WWT_PUSHBTN
@ WWT_PUSHBTN
Normal push-button (no toggle button) with custom drawing.
Definition: widget_type.h:103
Window::resize
ResizeInfo resize
Resize information.
Definition: window_gui.h:251
_date
Date _date
Current date in days (day counter)
Definition: date.cpp:28
SBI_SAVELOAD_FINISH
@ SBI_SAVELOAD_FINISH
finished saving
Definition: statusbar_gui.h:16
tilehighlight_func.h
Window::InitNested
void InitNested(WindowNumber number=0)
Perform complete initialization of the Window with nested widgets, to allow use.
Definition: window.cpp:1804
_toolbar_width
uint _toolbar_width
Width of the toolbar, shared by statusbar.
Definition: toolbar_gui.cpp:67
WF_WHITE_BORDER
@ WF_WHITE_BORDER
Window white border counter bit mask.
Definition: window_gui.h:176
SBI_NEWS_DELETED
@ SBI_NEWS_DELETED
abort current news display (active news were deleted)
Definition: statusbar_gui.h:19
CompanyProperties::money
Money money
Money owned by the company.
Definition: company_base.h:67
_pause_mode
PauseMode _pause_mode
The current pause mode.
Definition: gfx.cpp:50
SA_FORCE
@ SA_FORCE
Force the alignment, i.e. don't swap for RTL languages.
Definition: gfx_type.h:346
_local_company
CompanyID _local_company
Company controlled by the human player at this client. Can also be COMPANY_SPECTATOR.
Definition: company_cmd.cpp:46
safeguards.h
Window::flags
WindowFlags flags
Window flags.
Definition: window_gui.h:239
StatusBarWindow::REMINDER_START
static const int REMINDER_START
time in ms for reminder notification (red dot on the right) to stay
Definition: statusbar_gui.cpp:86
StatusBarWindow::TICKER_STOP
static const int TICKER_STOP
scrolling is finished when counter reaches this value
Definition: statusbar_gui.cpp:85
NewsItem::string_id
StringID string_id
Message text.
Definition: news_type.h:129
DrawSprite
void DrawSprite(SpriteID img, PaletteID pal, int x, int y, const SubSprite *sub, ZoomLevel zoom)
Draw a sprite, not in a viewport.
Definition: gfx.cpp:1058
sprites.h
Point
Coordinates of a point in 2D.
Definition: geometry_type.hpp:21
SBI_SAVELOAD_START
@ SBI_SAVELOAD_START
started saving
Definition: statusbar_gui.h:15
date_func.h
stdafx.h
Window::window_number
WindowNumber window_number
Window number within the window class.
Definition: window_gui.h:241
SBI_SHOW_REMINDER
@ SBI_SHOW_REMINDER
show a reminder (dot on the right side of the statusbar)
Definition: statusbar_gui.h:18
WID_S_MIDDLE
@ WID_S_MIDDLE
Middle part; current news or company name or *** SAVING *** or *** PAUSED ***.
Definition: statusbar_widget.h:16
WC_NONE
@ WC_NONE
No window, redirects to WC_MAIN_WINDOW.
Definition: window_type.h:38
SA_HOR_CENTER
@ SA_HOR_CENTER
Horizontally center the text.
Definition: gfx_type.h:335
FillDrawPixelInfo
bool FillDrawPixelInfo(DrawPixelInfo *n, int left, int top, int width, int height)
Set up a clipping area for only drawing into a certain area.
Definition: gfx.cpp:1786
GetSpriteSize
Dimension GetSpriteSize(SpriteID sprid, Point *offset, ZoomLevel zoom)
Get the size of a sprite.
Definition: gfx.cpp:993
string_func.h
StringID
uint32 StringID
Numeric value that represents a string, independent of the selected language.
Definition: strings_type.h:16
StatusBarWindow::FindWindowPlacementAndResize
void FindWindowPlacementAndResize(int def_width, int def_height) override
Resize window towards the default size.
Definition: statusbar_gui.cpp:107
EndContainer
static NWidgetPart EndContainer()
Widget part function for denoting the end of a container (horizontal, vertical, WWT_FRAME,...
Definition: widget_type.h:1096
Pool::PoolItem<&_company_pool >::Iterate
static Pool::IterateWrapper< Titem > Iterate(size_t from=0)
Returns an iterable ensemble of all valid Titem.
Definition: pool_type.hpp:386
strings_func.h
WID_S_LEFT
@ WID_S_LEFT
Left part of the statusbar; date is shown there.
Definition: statusbar_widget.h:15
FONT_HEIGHT_NORMAL
#define FONT_HEIGHT_NORMAL
Height of characters in the normal (FS_NORMAL) font.
Definition: gfx_func.h:206
NWidget
static NWidgetPart NWidget(WidgetType tp, Colours col, int16 idx=-1)
Widget part function for starting a new 'real' widget.
Definition: widget_type.h:1229
COMPANY_SPECTATOR
@ COMPANY_SPECTATOR
The client is spectating.
Definition: company_type.h:35
StatusBarWindow::DrawWidget
void DrawWidget(const Rect &r, int widget) const override
Draw the contents of a nested widget.
Definition: statusbar_gui.cpp:138
geometry_func.hpp
SetDParamMaxValue
void SetDParamMaxValue(uint n, uint64 max_value, uint min_count, FontSize size)
Set DParam n to some number that is suitable for string size computations.
Definition: strings.cpp:95
SetMinimalSize
static NWidgetPart SetMinimalSize(int16 x, int16 y)
Widget part function for setting the minimal size.
Definition: widget_type.h:1014
WWT_PANEL
@ WWT_PANEL
Simple depressed panel.
Definition: widget_type.h:48
ShowLastNewsMessage
void ShowLastNewsMessage()
Show previous news item.
Definition: news_gui.cpp:1054
news_gui.h
DAYS_IN_YEAR
static const int DAYS_IN_YEAR
days per year
Definition: date_type.h:29
GUITimer::CountElapsed
uint CountElapsed(uint delta)
Count how many times the interval has elapsed.
Definition: guitimer_func.h:40
company_func.h
PM_PAUSED_LINK_GRAPH
@ PM_PAUSED_LINK_GRAPH
A game paused due to the link graph schedule lagging.
Definition: openttd.h:68
GUITimer::Elapsed
bool Elapsed(uint delta)
Test if a timer has elapsed.
Definition: guitimer_func.h:55
SA_LEFT
@ SA_LEFT
Left align the text.
Definition: gfx_type.h:334
window_func.h
CenterBounds
static int CenterBounds(int min, int max, int size)
Determine where to draw a centred object inside a widget.
Definition: gfx_func.h:178
lengthof
#define lengthof(x)
Return the length of an fixed size array.
Definition: stdafx.h:386
WDP_MANUAL
@ WDP_MANUAL
Manually align the window (so no automatic location finding)
Definition: window_gui.h:89
NewsItem::params
uint64 params[10]
Parameters for string resolving.
Definition: news_type.h:141
Window
Data structure for an opened window.
Definition: window_gui.h:213
Pool::PoolItem<&_company_pool >::IsValidID
static bool IsValidID(size_t index)
Tests whether given index can be used to get valid (non-nullptr) Titem.
Definition: pool_type.hpp:326
WC_STATUS_BAR
@ WC_STATUS_BAR
Statusbar (at the bottom of your screen); Window numbers:
Definition: window_type.h:57
StatusBarWindow::COUNTER_STEP
static const int COUNTER_STEP
this is subtracted from active counters every tick
Definition: statusbar_gui.cpp:88
WidgetDimensions::scaled
static WidgetDimensions scaled
Widget dimensions scaled for current zoom level.
Definition: window_gui.h:68
Window::SetWidgetDirty
void SetWidgetDirty(byte widget_index) const
Invalidate a widget, i.e.
Definition: window.cpp:621
Rect
Specification of a rectangle with absolute coordinates of all edges.
Definition: geometry_type.hpp:69
Company
Definition: company_base.h:117
CLRBITS
#define CLRBITS(x, y)
Clears several bits in a variable.
Definition: bitmath_func.hpp:166
lastof
#define lastof(x)
Get the last element of an fixed size array.
Definition: stdafx.h:402
ResetObjectToPlace
void ResetObjectToPlace()
Reset the cursor and mouse mode handling back to default (normal cursor, only clicking in windows).
Definition: viewport.cpp:3434
ShowStatusBar
void ShowStatusBar()
Show our status bar.
Definition: statusbar_gui.cpp:274
TD_RTL
@ TD_RTL
Text is written right-to-left by default.
Definition: strings_type.h:24
_current_text_dir
TextDirection _current_text_dir
Text direction of the currently selected language.
Definition: strings.cpp:49
SBI_SHOW_TICKER
@ SBI_SHOW_TICKER
start scrolling news
Definition: statusbar_gui.h:17
CopyInDParam
void CopyInDParam(int offs, const uint64 *src, int num)
Copy num string parameters from array src into the global string parameter array.
Definition: strings.cpp:129
DrawPixelInfo
Data about how and where to blit pixels.
Definition: gfx_type.h:151
ScaleGUITrad
static RectPadding ScaleGUITrad(const RectPadding &r)
Scale a RectPadding to GUI zoom level.
Definition: widget.cpp:168
StatusBarWindow::OnInvalidateData
void OnInvalidateData(int data=0, bool gui_scope=true) override
Some data on this window has become invalid.
Definition: statusbar_gui.cpp:203
news_func.h
Window::FindWindowPlacementAndResize
virtual void FindWindowPlacementAndResize(int def_width, int def_height)
Resize window towards the default size.
Definition: window.cpp:1472
MAX_YEAR
static const Year MAX_YEAR
MAX_YEAR, nicely rounded value of the number of years that can be encoded in a single 32 bits date,...
Definition: date_type.h:95