Module:Items/ComparisonTables: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 63: Line 63:
local function getItems(slotID)
local function getItems(slotID)
local _, slotLocalID = Shared.getLocalID(slotID)
local _, slotLocalID = Shared.getLocalID(slotID)
 
local sortFunc = function(item)
local sortFunc = function(item)
-- Exclude the debug item
-- Exclude the debug item
Line 90: Line 90:
end
end


return false
return true
end
end


Line 307: Line 307:
return Shared.printError('Invalid slot ID: ' .. (slot or 'nil'))
return Shared.printError('Invalid slot ID: ' .. (slot or 'nil'))
end
end
 
-- Always sort by name.
-- Always sort by name.
local itemList = getItems(slotID)
local itemList = getItems(slotID)
table.sort(itemList, function(a, b) return a.name < b.name end)
table.sort(itemList, function(a, b) return a.name < b.name end)
 
return p._getCategoryTable(itemList, slot)
return p._getCategoryTable(itemList, slot)
end
end
2,875

edits