mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Move to GetWidgetString for depot window.
parent
d061c1293b
commit
16d985efe0
|
@ -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(WWT_PUSHIMGBTN, COLOUR_GREY, WID_D_RENAME), SetAspect(WidgetDimensions::ASPECT_RENAME), SetSpriteTip(SPR_RENAME, STR_DEPOT_RENAME_TOOLTIP),
|
||||
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_SHADEBOX, 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);
|
||||
SetDParam(1, this->GetDestinationIndex());
|
||||
return this->Window::GetWidgetString(widget, stringid);
|
||||
}
|
||||
|
||||
struct GetDepotVehiclePtData {
|
||||
|
|
Loading…
Reference in New Issue