Proper sorting by level
guys there is an addon Crafting Material Level Display
where you can sort by level its possible to sort by level without this issue when lvl 1 items dont come first? right now sorting order is: 2 3 4 5 6 7 8 10 1 11 Author of addon said its base game issue right? Quote:
|
First I'm not the author. I'm just maintaining this addon to keep it alive.
And secondly I said "Could not fix the sorting" which means I was not able to do this. The stuff I mentioned about the vanilla game behaviour relates to the repositioning of items in your inventory list, if you change the sort etc. The items won't be sorted by name, but by level. As the sort function of the game recognizes the levels as a string (and not as a number) it somehow does not sort them like numbers 1 10 11 but just as string, and everytime different after you change something (like described above): 10 1 11 or 1 10 11 or 11 10 1 or 11 1 10 Maybe one can fix this by using tonumber() in the sort function. Maybe one can add a "tiebraker = name" to the level sort header so the items will be sorted by level + name to keep the order. But I'm currently not able to do and test this. So if anyone wants to try, go ahead. |
The expected "lexical" sort order is generally called "Alphanumerical sorting" or "Natural sorting". Standard c-type simple sort algorithms are usually for the sake of brevity and complexity not able to do that. Here's a few test implementations for lua:
http://notebook.kulchenko.com/algori...-humans-in-lua |
All times are GMT -6. The time now is 05:07 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI