You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 12, 2025. It is now read-only.
* Fixed stackable items with equipment grids could get deleted in some cases ([14638](https://mods.factorio.com/mods/theRustyKnife/manual-inventory-sort/discussion/14638))
3
+
4
+
## 1.6.0 ##
2
5
* Updated for Factorio 0.15
3
6
4
-
##1.5.5##
7
+
##1.5.5##
5
8
* Fixed sorting of certain items would cause a crash when there were filters for them ([6067](https://mods.factorio.com/mods/theRustyKnife/manual-inventory-sort/discussion/6067))
6
9
* Fixed a possible crash when sorting cars or wagons with bigger inventories than any chest
7
10
8
-
##1.5.4##
11
+
##1.5.4##
9
12
* Fixed filtered car sorting ([5284](https://mods.factorio.com/mods/theRustyKnife/manual-inventory-sort/discussion/5284))
10
13
11
-
##1.5.3##
14
+
##1.5.3##
12
15
* Fixed temporary chests being selectable ([3947](https://mods.factorio.com/mods/theRustyKnife/manual-inventory-sort/discussion/3947))
13
16
14
-
##1.5.2##
17
+
##1.5.2##
15
18
* No more temporary entity spawning and destroying on every player inventory sort
* Fixed GUI buttons would not appear when opened a logistic chest
27
30
+ Added car and wagon sorting
28
31
+ Added Russian translation thanks to [Apriori](https://mods.factorio.com/mods/theRustyKnife/manual-inventory-sort/discussion/3041)
29
32
30
-
##1.4.4##
33
+
##1.4.4##
31
34
* Updated for Factorio 0.14
32
35
33
-
##1.4.3##
36
+
##1.4.3##
34
37
* Fixed sorting big chests caused a crash ([2008](https://mods.factorio.com/mods/theRustyKnife/manual-inventory-sort/discussion/2008))
35
38
36
-
##1.4.2##
39
+
##1.4.2##
37
40
* Fixed logistic chests were not sortable ([1519](https://mods.factorio.com/mods/theRustyKnife/manual-inventory-sort/discussion/1519))
38
41
39
-
##1.4.1##
42
+
##1.4.1##
40
43
* Fixed a bug causing a crash when loading existing saves without the mod installed before ([1494](https://mods.factorio.com/mods/theRustyKnife/manual-inventory-sort/discussion/1494))
41
44
42
-
##1.4.0##
45
+
##1.4.0##
43
46
* Fixed broken migration script (hopefully), apologies to anyone who had problems with this - it should be safe now to migrate from any version to 1.4
44
47
+ Added sorting GUI
45
48
46
-
##1.3.0##
49
+
##1.3.0##
47
50
* Changed the default shortcuts to use shift instead of ctrl (it's a lot more comfortable this way)
48
51
+ Added chest sorting
49
52
50
-
##1.2.0##
53
+
##1.2.0##
51
54
+ Addded an options menu
52
55
+ Added part inventory sorting
53
56
54
-
##1.1.2##
57
+
##1.1.2##
55
58
* Use of new API features of 0.13.12 to get rid of the need to place temporary entities
56
59
57
-
##1.1.1##
60
+
##1.1.1##
58
61
* Fixed auto-sort performance, now sorting is done only when actually needed
59
62
60
-
##1.1.0##
63
+
##1.1.0##
61
64
* Fixed a bug making it possible to duplicate items with durability in certain cases
62
65
+ Added the auto-sort feature. It has performance problems to be solved though.
63
66
64
-
##1.0.1##
67
+
##1.0.1##
65
68
* Fixed a bug causing items to be lost when inserted in the tick after sorting was triggered
"description": "Makes some tweaks to the way inventory sorting works.\nYou can sort your inventory on demand or toggle auto-sort. Auto-sort can be configured to work for just a part of your inventory. \nIt's also possible to sort chests, cars and cargo wagons. \n0.15 supported!",
"description": "Makes some tweaks to the way inventory sorting works.\nYou can sort your inventory on demand or toggle auto-sort. Auto-sort can be configured to work for just a part of your inventory. \nIt's also possible to sort chests, cars and cargo wagons.",
localdamaged_stacks= {} -- because stacks with damage go at the end
151
+
localstacks_with_grid= {} -- put stacks with any equipment in their grid at the end (before damaged)
151
152
localfirst=true-- first can't merge with previous stacks, since they're a different type
152
153
i_slots.current_name=t_stacks[1].stack.name
153
154
iterate_i_slots(i_slots, inventory)
154
155
155
156
fori_stack=1, #t_stacksdo
156
157
localc_stack=t_stacks[i_stack]
157
158
159
+
localextra_properties= {}
160
+
ifc_stack.stack.gridandnext(c_stack.stack.grid.equipment) ~=nilthenextra_properties.grid=true; end
161
+
ifc_stack.stack.healthandc_stack.stack.health~=1andnotextra_properties.gridthenextra_properties.health=c_stack.stack.health; end-- don't insert if item has grid as that already handles moving to end
162
+
158
163
ifnotfirstandt_chest_inventory[i_slots.current].valid_for_readandt_chest_inventory[i_slots.current].name==c_stack.stack.namethen-- there's a stack available for merge
-- these are only needed when merging, so no point in getting them otherwise
167
+
ifc_stack.stack.type=="ammo" thenextra_properties.ammo=c_stack.stack.ammo; end
168
+
ifc_stack.stack.durabilitythenextra_properties.durability=c_stack.stack.durability; end
165
169
166
-
ifextra_properties.ammothen-- ammo
170
+
ifextra_properties.ammothen-- ammo - maybe move this after the health and grid checks? Can ammo have health or grid?
167
171
t_chest_inventory[i_slots.next].set_stack(c_stack.stack) -- put the stack into the next slot
168
172
ifutil.compress_ammo(t_chest_inventory[i_slots.current], t_chest_inventory[i_slots.next]) theniterate_i_slots(i_slots, inventory) end-- merge stacks and only iterate i_slots.i if the next slot still as something in it
169
-
173
+
174
+
elseifextra_properties.gridthen-- item has an equipment grid attached to it - same as health
175
+
table.insert(stacks_with_grid, c_stack)
176
+
170
177
elseifextra_properties.healththen-- item is damaged - put at the end and do not stack!
171
178
table.insert(damaged_stacks, c_stack)
172
-
179
+
173
180
elseifextra_properties.durabilitythen-- durability (same as ammo)
fori_damaged=1, #damaged_stacksdo-- insert the dmaged stacks (for now these are inserted in the order they were originally - vanilla sorts them by ammount of health left)
200
215
ifnotfirsttheniterate_i_slots(i_slots, inventory) elsefirst=falseend-- prevent overwriting last non-damaged slot if there is one
0 commit comments