mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Move to GetWidgetString for viewport window.
parent
e1f9159b51
commit
a65db3be0d
|
@ -26,7 +26,7 @@
|
||||||
static constexpr NWidgetPart _nested_extra_viewport_widgets[] = {
|
static constexpr NWidgetPart _nested_extra_viewport_widgets[] = {
|
||||||
NWidget(NWID_HORIZONTAL),
|
NWidget(NWID_HORIZONTAL),
|
||||||
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
|
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
|
||||||
NWidget(WWT_CAPTION, COLOUR_GREY, WID_EV_CAPTION), SetStringTip(STR_EXTRA_VIEWPORT_TITLE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
NWidget(WWT_CAPTION, COLOUR_GREY, WID_EV_CAPTION),
|
||||||
NWidget(WWT_SHADEBOX, COLOUR_GREY),
|
NWidget(WWT_SHADEBOX, COLOUR_GREY),
|
||||||
NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
|
NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
|
||||||
NWidget(WWT_STICKYBOX, COLOUR_GREY),
|
NWidget(WWT_STICKYBOX, COLOUR_GREY),
|
||||||
|
@ -61,13 +61,15 @@ public:
|
||||||
if (_settings_client.gui.zoom_min == viewport->zoom) this->DisableWidget(WID_EV_ZOOM_IN);
|
if (_settings_client.gui.zoom_min == viewport->zoom) this->DisableWidget(WID_EV_ZOOM_IN);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetStringParameters(WidgetID widget) const override
|
std::string GetWidgetString(WidgetID widget, StringID stringid) const override
|
||||||
{
|
{
|
||||||
switch (widget) {
|
switch (widget) {
|
||||||
case WID_EV_CAPTION:
|
case WID_EV_CAPTION:
|
||||||
/* set the number in the title bar */
|
/* set the number in the title bar */
|
||||||
SetDParam(0, this->window_number + 1);
|
return GetString(STR_EXTRA_VIEWPORT_TITLE, this->window_number + 1);
|
||||||
break;
|
|
||||||
|
default:
|
||||||
|
return this->Window::GetWidgetString(widget, stringid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue