mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Move to GetWidgetString for sign windows.
parent
3d253a9702
commit
8f62e40bc7
|
@ -225,9 +225,11 @@ struct SignListWindow : Window, SignList {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetStringParameters(WidgetID widget) const override
|
std::string GetWidgetString(WidgetID widget, StringID stringid) const override
|
||||||
{
|
{
|
||||||
if (widget == WID_SIL_CAPTION) SetDParam(0, this->vscroll->GetCount());
|
if (widget == WID_SIL_CAPTION) return GetString(STR_SIGN_LIST_CAPTION, this->vscroll->GetCount());
|
||||||
|
|
||||||
|
return this->Window::GetWidgetString(widget, stringid);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override
|
void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override
|
||||||
|
@ -350,7 +352,7 @@ struct SignListWindow : Window, SignList {
|
||||||
static constexpr NWidgetPart _nested_sign_list_widgets[] = {
|
static constexpr NWidgetPart _nested_sign_list_widgets[] = {
|
||||||
NWidget(NWID_HORIZONTAL),
|
NWidget(NWID_HORIZONTAL),
|
||||||
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
|
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
|
||||||
NWidget(WWT_CAPTION, COLOUR_BROWN, WID_SIL_CAPTION), SetStringTip(STR_SIGN_LIST_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
NWidget(WWT_CAPTION, COLOUR_BROWN, WID_SIL_CAPTION),
|
||||||
NWidget(WWT_SHADEBOX, COLOUR_BROWN),
|
NWidget(WWT_SHADEBOX, COLOUR_BROWN),
|
||||||
NWidget(WWT_DEFSIZEBOX, COLOUR_BROWN),
|
NWidget(WWT_DEFSIZEBOX, COLOUR_BROWN),
|
||||||
NWidget(WWT_STICKYBOX, COLOUR_BROWN),
|
NWidget(WWT_STICKYBOX, COLOUR_BROWN),
|
||||||
|
@ -464,12 +466,14 @@ struct SignWindow : Window, SignList {
|
||||||
return next ? this->signs.front() : this->signs.back();
|
return next ? this->signs.front() : this->signs.back();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetStringParameters(WidgetID widget) const override
|
std::string GetWidgetString(WidgetID widget, StringID stringid) const override
|
||||||
{
|
{
|
||||||
switch (widget) {
|
switch (widget) {
|
||||||
case WID_QES_CAPTION:
|
case WID_QES_CAPTION:
|
||||||
SetDParam(0, this->name_editbox.caption);
|
return GetString(this->name_editbox.caption);
|
||||||
break;
|
|
||||||
|
default:
|
||||||
|
return this->Window::GetWidgetString(widget, stringid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -523,7 +527,7 @@ struct SignWindow : Window, SignList {
|
||||||
static constexpr NWidgetPart _nested_query_sign_edit_widgets[] = {
|
static constexpr NWidgetPart _nested_query_sign_edit_widgets[] = {
|
||||||
NWidget(NWID_HORIZONTAL),
|
NWidget(NWID_HORIZONTAL),
|
||||||
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
|
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
|
||||||
NWidget(WWT_CAPTION, COLOUR_GREY, WID_QES_CAPTION), SetStringTip(STR_JUST_STRING, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), SetTextStyle(TC_WHITE),
|
NWidget(WWT_CAPTION, COLOUR_GREY, WID_QES_CAPTION), SetTextStyle(TC_WHITE),
|
||||||
NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, WID_QES_LOCATION), SetAspect(WidgetDimensions::ASPECT_LOCATION), SetSpriteTip(SPR_GOTO_LOCATION, STR_EDIT_SIGN_LOCATION_TOOLTIP),
|
NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, WID_QES_LOCATION), SetAspect(WidgetDimensions::ASPECT_LOCATION), SetSpriteTip(SPR_GOTO_LOCATION, STR_EDIT_SIGN_LOCATION_TOOLTIP),
|
||||||
EndContainer(),
|
EndContainer(),
|
||||||
NWidget(WWT_PANEL, COLOUR_GREY),
|
NWidget(WWT_PANEL, COLOUR_GREY),
|
||||||
|
|
Loading…
Reference in New Issue