|
@@ -635,19 +635,21 @@ public:
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
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();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
void OnGameTick() override
|
|
|
{
|
|
|
if (this->stations.NeedResort()) {
|
|
@@ -1463,15 +1465,17 @@ struct StationViewWindow : public Window
|
|
|
scroll_to_row = INT_MAX;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
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);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Rebuild the cache for estimated destinations which is used to quickly show the "destination" entries
|
|
|
* even if we actually don't know the destination of a certain packet from just looking at it.
|
|
|
* @param i Cargo to recalculate the cache for.
|