Codechange: Use parameters, which should be used.

This commit is contained in:
frosch
2023-09-16 23:25:17 +02:00
committed by frosch
parent b6c8f301be
commit b5885295f0
13 changed files with 67 additions and 41 deletions

View File

@@ -638,13 +638,15 @@ public:
void OnDropdownSelect(int widget, int index) override
{
if (this->stations.SortType() != index) {
this->stations.SetSortType(index);
if (widget == WID_STL_SORTDROPBTN) {
if (this->stations.SortType() != index) {
this->stations.SetSortType(index);
/* Display the current sort variant */
this->GetWidget<NWidgetCore>(WID_STL_SORTDROPBTN)->widget_data = this->sorter_names[this->stations.SortType()];
/* Display the current sort variant */
this->GetWidget<NWidgetCore>(WID_STL_SORTDROPBTN)->widget_data = this->sorter_names[this->stations.SortType()];
this->SetDirty();
this->SetDirty();
}
}
}
@@ -1466,9 +1468,11 @@ struct StationViewWindow : public Window {
void SetStringParameters(int widget) const override
{
const Station *st = Station::Get(this->window_number);
SetDParam(0, st->index);
SetDParam(1, st->facilities);
if (widget == WID_SV_CAPTION) {
const Station *st = Station::Get(this->window_number);
SetDParam(0, st->index);
SetDParam(1, st->facilities);
}
}
/**