Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Default sort order' to defines different sort orders depending of the used criteria #5678

Closed
DorpsGek opened this issue Jul 27, 2013 · 1 comment
Labels
component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

sbr opened the ticket and wrote:

In r25096, TownPopulationSorter() was reversed to put most populated towns at the top of the list.
While it's desirable, it was inconsistent with the selected sort order.

The '00feature-default-sort-order' patch modify 'sortlist_type.h' to introduce the notion of default sort order.
It permits to define a preferred sort order per criteria instead of reusing the last used sort order.

SetDefaultSortOrders() defines the default sort orders to use per sort criteria.
If a default sort order is defined for the current sort criteria, UseDefaultSortOrder() set the current sort order to it.
Three default sort order types are defined:
- DSO_NONE: don't alter the current sort order;
- DSO_ASCENDING: switch the current sort order to descending;
- DSO_DESCENDING: switch the current sort order to descending.
UseDefaultSortOrder() returns a boolean indicating if the current sort order has been changed or not.

The '10change-town-directory-default-sort-orders' patch sets default sort orders to the town directory as follow:
- sort by name: ascending;
- sort by population: descending;
- sort by rating: no default order.

The '11change-industry-directory-default-sort-orders' patch sets default sort orders to the industry directory as follow:
- sort by name: ascending;
- sort by type: ascending;
- sort by production: descending;
- sort by transported: descending;

Please find attached theses three patches against r25628.

Attachments

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/5678
@DorpsGek DorpsGek added component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) enhancement labels Apr 7, 2018
@andythenorth
Copy link
Contributor

Thanks for this, but we'll pass :) Changing the default sort orders is not a current priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

2 participants