Changes

no edit summary
Line 53: Line 53:  
     local typeKey = "type" .. (n and tostring(n) or "")
 
     local typeKey = "type" .. (n and tostring(n) or "")
 
     local type = context and context[typeKey] and tonumber(context[typeKey])
 
     local type = context and context[typeKey] and tonumber(context[typeKey])
 +
    local sortKey = "sort" .. (n and tostring(n) or "")
 +
    local sort = context and context[sortKey] and tonumber(context[sortKey])
 
     local collection = require('Module:Collection/Equipment')
 
     local collection = require('Module:Collection/Equipment')
 +
    if sort then
 +
        collection = table.sort(collection, function(a, b) return a[sort] < b[sort] end)
 +
    end
 
     local i = 1
 
     local i = 1
 
     local current
 
     local current
cssedit, gkautomate
7,064

edits