Line 28: |
Line 28: |
| local collection = require('Module:Collection/Equipment') | | local collection = require('Module:Collection/Equipment') |
| if sort then | | if sort then |
− | collection = table.sort(collection, function(a, b) return a[sort] < b[sort] end) | + | table.sort(collection, function(a, b) return a[sort] < b[sort] end) |
| end | | end |
| local i = 1 | | local i = 1 |
Line 62: |
Line 62: |
| local collection = require('Module:Collection/Equipment') | | local collection = require('Module:Collection/Equipment') |
| if sort then | | if sort then |
− | collection = table.sort(collection, function(a, b) return a[sort] < b[sort] end) | + | table.sort(collection, function(a, b) return a[sort] < b[sort] end) |
| end | | end |
| local i = 1 | | local i = 1 |
Line 90: |
Line 90: |
| local type = context and context[typeKey] and tonumber(context[typeKey]) | | local type = context and context[typeKey] and tonumber(context[typeKey]) |
| local icon = context and context[iconKey] and tonumber(context[iconKey]) | | local icon = context and context[iconKey] and tonumber(context[iconKey]) |
| + | local sortKey = "sort" .. (n and tostring(n) or "") |
| + | local sort = context and context[sortKey] |
| local collection = require('Module:Collection/Equipment') | | local collection = require('Module:Collection/Equipment') |
| + | if sort then |
| + | table.sort(collection, function(a, b) return a[sort] < b[sort] end) |
| + | end |
| local i = 1 | | local i = 1 |
| local current | | local current |