Quantcast Proper sorting by level - ESOUI
Thread Tools Display Modes
10/22/18, 01:42 AM   #1
Marazota
Join Date: Sep 2015
Posts: 114
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?
Could not fix the sorting and the game will always reposition items with the same level each time you do something in the inventory list, so one would need to sort it by level + name, which isn't working within this addon as it breaks the vanilla game name sorting then.
  Reply With Quote
10/22/18, 05:18 AM   #2
Baertram
 
Baertram's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 2,134
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.
  Reply With Quote
10/22/18, 08:37 AM   #3
Draxinusom
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 3
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
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Proper sorting by level

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off