Is there a way to sort items in a chest?
Thanks,
Inventory Sort
Re: Inventory Sort
+1 on this. Or at least compress items when they don't use full stack.
Re: Inventory Sort
+1 Yes.
Only workaround I've found is to built a bunch of temp warehouses, ctrl-click different items and sort them in my player inventory -> temp warehouse, and then fill the original back up in a semi-ordered way, and pick up the temp storage.
Only workaround I've found is to built a bunch of temp warehouses, ctrl-click different items and sort them in my player inventory -> temp warehouse, and then fill the original back up in a semi-ordered way, and pick up the temp storage.
Re: Inventory Sort
I would also love this. Your inventory is auto-sorted (by default, I believe there is an option for it), so why not have the ability to sort a chest/vehicle inventory?
I would be fine if there was some sort of "smart chest" (requiring a chest and maybe a few circuits of an appropriate tier), and only those can be sorted.
I do see a potential issue with very large modded inventories, as by definition, sorting is at minimum an n log(n) operation. Maybe if an inventory is above X size, it will only combine partial stacks and move stacks forwards?
I would be fine if there was some sort of "smart chest" (requiring a chest and maybe a few circuits of an appropriate tier), and only those can be sorted.
I do see a potential issue with very large modded inventories, as by definition, sorting is at minimum an n log(n) operation. Maybe if an inventory is above X size, it will only combine partial stacks and move stacks forwards?
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Inventory Sort
LuaInventory.sort_and_merge()
As the only one who cares about sorting is the user you don't need to sort chests that the user doesn't open.Xynariz wrote: Fri Jun 28, 2019 5:22 pm I do see a potential issue with very large modded inventories, as by definition, sorting is at minimum an n log(n) operation. Maybe if an inventory is above X size, it will only combine partial stacks and move stacks forwards?
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
-
- Filter Inserter
- Posts: 587
- Joined: Sun Jun 09, 2019 10:40 pm
- Contact:
Re: Inventory Sort
FWIW, the Picker Inventory Tools mod is able to do this; I'm sure there are others, I just happen to know that one because I use it for other reasons. Not a core feature, but the mod doesn't force any sort of "cheat" stuff on you either.
Personally, I just have randomly unsorted chests of crap all over the place, and a full inventory, but YMMV.
Personally, I just have randomly unsorted chests of crap all over the place, and a full inventory, but YMMV.
Re: Inventory Sort
Also sorting probably shouldn't happen automatically at all. I was thinking of a little "sort" button in the open chest dialog that you press to sort and merge items. At least merging stacks of item where possible would change the behavior of the chest and needs to remain a manual thing.eradicator wrote: Fri Jun 28, 2019 5:39 pm LuaInventory.sort_and_merge()
As the only one who cares about sorting is the user you don't need to sort chests that the user doesn't open.Xynariz wrote: Fri Jun 28, 2019 5:22 pm I do see a potential issue with very large modded inventories, as by definition, sorting is at minimum an n log(n) operation. Maybe if an inventory is above X size, it will only combine partial stacks and move stacks forwards?
Re: Inventory Sort
I brought this topic up before and there is a nice Mod:
viewtopic.php?f=6&t=60950&p=367281&hilit=Sort#p367408
viewtopic.php?f=6&t=60950&p=367281&hilit=Sort#p367408