1
0
Fork 0

Codechange: Move to GetWidgetString for depot window.

pull/13710/head
Peter Nelson 2025-03-02 22:02:45 +00:00 committed by Peter Nelson
parent d061c1293b
commit 16d985efe0
1 changed files with 4 additions and 5 deletions

View File

@ -52,7 +52,7 @@ static constexpr NWidgetPart _nested_train_depot_widgets[] = {
NWidget(NWID_SELECTION, INVALID_COLOUR, WID_D_SHOW_RENAME), SetAspect(WidgetDimensions::ASPECT_RENAME), // rename button NWidget(NWID_SELECTION, INVALID_COLOUR, WID_D_SHOW_RENAME), SetAspect(WidgetDimensions::ASPECT_RENAME), // rename button
NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, WID_D_RENAME), SetAspect(WidgetDimensions::ASPECT_RENAME), SetSpriteTip(SPR_RENAME, STR_DEPOT_RENAME_TOOLTIP), NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, WID_D_RENAME), SetAspect(WidgetDimensions::ASPECT_RENAME), SetSpriteTip(SPR_RENAME, STR_DEPOT_RENAME_TOOLTIP),
EndContainer(), EndContainer(),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_D_CAPTION), SetStringTip(STR_DEPOT_CAPTION), NWidget(WWT_CAPTION, COLOUR_GREY, WID_D_CAPTION),
NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, WID_D_LOCATION), SetAspect(WidgetDimensions::ASPECT_LOCATION), SetSpriteTip(SPR_GOTO_LOCATION), NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, WID_D_LOCATION), SetAspect(WidgetDimensions::ASPECT_LOCATION), SetSpriteTip(SPR_GOTO_LOCATION),
NWidget(WWT_SHADEBOX, COLOUR_GREY), NWidget(WWT_SHADEBOX, COLOUR_GREY),
NWidget(WWT_DEFSIZEBOX, COLOUR_GREY), NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
@ -420,12 +420,11 @@ struct DepotWindow : Window {
} }
} }
void SetStringParameters(WidgetID widget) const override std::string GetWidgetString(WidgetID widget, StringID stringid) const override
{ {
if (widget != WID_D_CAPTION) return; if (widget == WID_D_CAPTION) return GetString(STR_DEPOT_CAPTION, this->type, this->GetDestinationIndex());
SetDParam(0, this->type); return this->Window::GetWidgetString(widget, stringid);
SetDParam(1, this->GetDestinationIndex());
} }
struct GetDepotVehiclePtData { struct GetDepotVehiclePtData {