mirror of https://github.com/OpenTTD/OpenTTD
(svn r25095) -Codechange: Immediately save the sort order of the town directory instead of when closing the window.
parent
15ec6e26f0
commit
d62ab47c74
|
@ -703,11 +703,6 @@ public:
|
||||||
this->FinishInitNested(desc, 0);
|
this->FinishInitNested(desc, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
~TownDirectoryWindow()
|
|
||||||
{
|
|
||||||
this->last_sorting = this->towns.GetListing();
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void SetStringParameters(int widget) const
|
virtual void SetStringParameters(int widget) const
|
||||||
{
|
{
|
||||||
switch (widget) {
|
switch (widget) {
|
||||||
|
@ -826,6 +821,7 @@ public:
|
||||||
switch (widget) {
|
switch (widget) {
|
||||||
case WID_TD_SORT_ORDER: // Click on sort order button
|
case WID_TD_SORT_ORDER: // Click on sort order button
|
||||||
this->towns.ToggleSortOrder();
|
this->towns.ToggleSortOrder();
|
||||||
|
this->last_sorting = this->towns.GetListing(); // Store new sorting order.
|
||||||
this->SetDirty();
|
this->SetDirty();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -855,6 +851,7 @@ public:
|
||||||
|
|
||||||
if (this->towns.SortType() != index) {
|
if (this->towns.SortType() != index) {
|
||||||
this->towns.SetSortType(index);
|
this->towns.SetSortType(index);
|
||||||
|
this->last_sorting = this->towns.GetListing(); // Store new sorting order.
|
||||||
this->BuildSortTownList();
|
this->BuildSortTownList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue