Skip to content
This repository was archived by the owner on Feb 12, 2025. It is now read-only.

Commit b5e63d1

Browse files
Merge pull request #6 from theRustyKnife/1.5-dev
1.5.5 release
2 parents 6502275 + 98bd895 commit b5e63d1

File tree

4 files changed

+68
-58
lines changed

4 files changed

+68
-58
lines changed

changelog.txt

Lines changed: 47 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,65 @@
1-
##1.0.0##
2-
+ Initial release
1+
##1.5.5##
2+
* 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))
3+
* Fixed a possible crash when sorting cars or wagons with bigger inventories than any chest
34

4-
##1.0.1##
5-
* Fixed a bug causing items to be lost when inserted in the tick after sorting was triggered
5+
##1.5.4##
6+
* Fixed filtered car sorting ([5284](https://mods.factorio.com/mods/theRustyKnife/manual-inventory-sort/discussion/5284))
67

7-
##1.1.0##
8-
* Fixed a bug making it possible to duplicate items with durability in certain cases
9-
+ Added the auto-sort feature. It has performance problems to be solved though.
8+
##1.5.3##
9+
* Fixed temporary chests being selectable ([3947](https://mods.factorio.com/mods/theRustyKnife/manual-inventory-sort/discussion/3947))
1010

11-
##1.1.1##
12-
* Fixed auto-sort performance, now sorting is done only when actually needed
11+
##1.5.2##
12+
* No more temporary entity spawning and destroying on every player inventory sort
13+
* Fixed filtered cargo-wagons weren't sorted properly
1314

14-
##1.1.2##
15-
* Use of new API features of 0.13.12 to get rid of the need to place temporary entities
15+
##1.5.1##
16+
* Removed the left-over debugging message when auto-sorting
1617

17-
##1.2.0##
18-
+ Addded an options menu
19-
+ Added part inventory sorting
18+
##1.5.0##
19+
* Internal changes
20+
* Improved auto-sort performance ([3558](https://mods.factorio.com/mods/theRustyKnife/manual-inventory-sort/discussion/3558))
2021

21-
##1.3.0##
22-
* Changed the default shortcuts to use shift instead of ctrl (it's a lot more comfortable this way)
23-
+ Added chest sorting
22+
##1.4.5##
23+
* Fixed GUI buttons would not appear when opened a logistic chest
24+
+ Added car and wagon sorting
25+
+ Added Russian translation thanks to [Apriori](https://mods.factorio.com/mods/theRustyKnife/manual-inventory-sort/discussion/3041)
2426

25-
##1.4.0##
26-
* 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
27-
+ Added sorting GUI
27+
##1.4.4##
28+
* Updated for Factorio 0.14
2829

29-
##1.4.1##
30-
* 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))
30+
##1.4.3##
31+
* Fixed sorting big chests caused a crash ([2008](https://mods.factorio.com/mods/theRustyKnife/manual-inventory-sort/discussion/2008))
3132

3233
##1.4.2##
3334
* Fixed logistic chests were not sortable ([1519](https://mods.factorio.com/mods/theRustyKnife/manual-inventory-sort/discussion/1519))
3435

35-
##1.4.3##
36-
* Fixed sorting big chests caused a crash ([2008](https://mods.factorio.com/mods/theRustyKnife/manual-inventory-sort/discussion/2008))
36+
##1.4.1##
37+
* 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))
3738

38-
##1.4.4##
39-
* Updated for Factorio 0.14
39+
##1.4.0##
40+
* 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
41+
+ Added sorting GUI
4042

41-
##1.4.5##
42-
* Fixed GUI buttons would not appear when opened a logistic chest
43-
+ Added car and wagon sorting
44-
+ Added Russian translation thanks to [Apriori](https://mods.factorio.com/mods/theRustyKnife/manual-inventory-sort/discussion/3041)
43+
##1.3.0##
44+
* Changed the default shortcuts to use shift instead of ctrl (it's a lot more comfortable this way)
45+
+ Added chest sorting
4546

46-
##1.5.0##
47-
* Internal changes
48-
* Improved auto-sort performance ([3558](https://mods.factorio.com/mods/theRustyKnife/manual-inventory-sort/discussion/3558))
47+
##1.2.0##
48+
+ Addded an options menu
49+
+ Added part inventory sorting
4950

50-
##1.5.1##
51-
* Removed the left-over debugging message when auto-sorting
51+
##1.1.2##
52+
* Use of new API features of 0.13.12 to get rid of the need to place temporary entities
5253

53-
##1.5.2##
54-
* No more temporary entity spawning and destroying on every player inventory sort
55-
* Fixed filtered cargo-wagons weren't sorted properly
54+
##1.1.1##
55+
* Fixed auto-sort performance, now sorting is done only when actually needed
5656

57-
##1.5.3##
58-
* Fixed temporary chests being selectable ([3947](https://mods.factorio.com/mods/theRustyKnife/manual-inventory-sort/discussion/3947))
57+
##1.1.0##
58+
* Fixed a bug making it possible to duplicate items with durability in certain cases
59+
+ Added the auto-sort feature. It has performance problems to be solved though.
60+
61+
##1.0.1##
62+
* Fixed a bug causing items to be lost when inserted in the tick after sorting was triggered
63+
64+
##1.0.0##
65+
+ Initial release

data-updates.lua

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
local size = 1000
22

3-
for i, v in pairs(data.raw["container"]) do
4-
if v.inventory_size > size then size = v.inventory_size end
5-
end
3+
local data_to_check = {
4+
data.raw["container"],
5+
data.raw["logistic-container"],
6+
data.raw["car"],
7+
data.raw["cargo-wagon"]
8+
}
69

7-
for i, v in pairs(data.raw["logistic-container"]) do
8-
if v.inventory_size > size then size = v.inventory_size end
10+
for _, t in pairs(data_to_check) do
11+
for __, v in pairs(t) do if v.inventory_size > size then size = v.inventory_size; end; end
912
end
1013

1114
data.raw["container"]["manual-inventory-sort-tmp-chest"].inventory_size = size

info.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "manual-inventory-sort",
3-
"version": "1.5.4",
3+
"version": "1.5.5",
44
"factorio_version": "0.14",
55
"title": "Manual Inventory Sorting",
66
"author": "TheRustyKnife",
77
"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.",
88
"homepage": "http://mods.factorio.com/mods/theRustyKnife/manual-inventory-sort",
9-
"date": "07.11.2016",
9+
"date": "10.12.2016",
1010
"dependencies": ["base >= 0.14.4"]
1111
}

script/sorting.lua

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ local function iterate_i_slots(i_slots, inventory)
1313

1414
if util.table.get_n(i_slots.filters[i_slots.current_name]) == 0 then -- get the next slot, if there are no other filtered ones (i_slot)
1515
i_slots.filters[i_slots.current_name] = nil
16-
i_slots.next = i_slots.i
16+
i_slots.next = i_slots.i + 1
1717
else -- get the next slot if there are other filtered ones (the first one)
1818
i_slots.next = i_slots.filters[i_slots.current_name][1]
1919
end
@@ -98,6 +98,16 @@ function sorting.sort_inventory(arg)
9898
local filters = nil
9999
local sort_limit = #inventory
100100

101+
if (not sort_limit_override) and global.player_settings[player_index].sort_limit_enabled then
102+
-- sort limit is enabled - need to figure out what it actually is
103+
if global.player_settings[player_index].sort_limit >= 0 and global.player_settings[player_index].sort_limit < sort_limit then -- for positive limits (can't exceed inventory size)
104+
sort_limit = global.player_settings[player_index].sort_limit
105+
106+
elseif global.player_settings[player_index].sort_limit < 0 and global.player_settings[player_index].sort_limit > 0 - sort_limit then -- for negative limits (result can't be <= 0)
107+
sort_limit = sort_limit + global.player_settings[player_index].sort_limit
108+
end
109+
end
110+
101111
if filtered then -- figure out which slots have what filters
102112
filters = {}
103113
for i = 1, sort_limit do
@@ -110,16 +120,6 @@ function sorting.sort_inventory(arg)
110120
end
111121
end
112122

113-
if (not sort_limit_override) and global.player_settings[player_index].sort_limit_enabled then
114-
-- sort limit is enabled - need to figure out what it actually is
115-
if global.player_settings[player_index].sort_limit >= 0 and global.player_settings[player_index].sort_limit < sort_limit then -- for positive limits (can't exceed inventory size)
116-
sort_limit = global.player_settings[player_index].sort_limit
117-
118-
elseif global.player_settings[player_index].sort_limit < 0 and global.player_settings[player_index].sort_limit > 0 - sort_limit then -- for negative limits (result can't be <= 0)
119-
sort_limit = sort_limit + global.player_settings[player_index].sort_limit
120-
end
121-
end
122-
123123
------------ SORTING ------------
124124

125125
for i = 1, sort_limit do -- put the content into a table

0 commit comments

Comments
 (0)