2,873
edits
No edit summary |
No edit summary |
||
Line 221: | Line 221: | ||
function p.getEquipmentTable(itemList, slot) | function p.getEquipmentTable(itemList, slot) | ||
local iconSize = 20 | local iconSize = 20 | ||
local fl = FL.new(itemList) | |||
-- If slot is nil, find out if we have any weapons. | -- If slot is nil, find out if we have any weapons. | ||
if slot == nil then | if slot == nil then | ||
if fl:any(function(x) return Shared.contains(x.validSlots, 'Weapon') end) then | if fl:any(function(x) return Shared.contains(x.validSlots, 'Weapon') end) then | ||
slot = 'Weapon' | slot = 'Weapon' | ||
Line 230: | Line 230: | ||
end | end | ||
-- Sort itemList by name | |||
itemList = fl:sortBy(function(x) return x.name end) | |||
:sort() | |||
:toTable() | |||
local isWeapon = (slot == 'Weapon' or slot == '2hWeapons') | local isWeapon = (slot == 'Weapon' or slot == '2hWeapons') | ||
local itemColspan = 3 | local itemColspan = 3 | ||
Line 338: | Line 343: | ||
end | end | ||
return p.getEquipmentTable(getItems(slotID), slot) | |||
end | end | ||
edits