theMino / andors-trail

Automatically exported from code.google.com/p/andors-trail
0 stars 0 forks source link

Sortable inventory #330

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
After reading this (http://andorstrail.com/viewtopic.php?p=15695#p15695) thread 
in the forums, I worked a little on a patch for sorting the inventory. I have 
only a very basic understanding of Java programming and my code could probably 
use some polishing, but it kinda works and I wanted to raise the issue anyway.

I'll also attach a picture of my inventory sorted by Rarity of the items. I 
have included sorting by name, type, quantity and rarity. There is also an 
option for custom sorting, but it doesn't do anything right now.

Whenever two objects have the same (type, quantity, rarity), they are 
additinally sorted by name.

Further thoughts: As far as I understand it, the inventory lists the items in 
the order they are saved in the savegame. I don't know if my code actually 
changes the order on the savegame level. If not, it might be helpful to save 
the players choice of sorting method in the savegame so it can be restored when 
the inventory is displayed again.

I intended the custom sort option for the following: The other sort options 
should basically be immutable, so whenever the player moves an item up or down, 
the sorting changes to custom.

I also tried to include dividers where it makes sense (for example when sorting 
by rarity) like the dividers in the contact app, but I wasn't successful there.

Original issue reported on code.google.com by neit...@lavabit.com on 3 Dec 2012 at 2:31

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by sdeva...@gmail.com on 3 Dec 2012 at 5:21