Module:Slots
From Stationeers Community Wiki
More actions
Documentation for this module may be created at Module:Slots/doc
local p = {}
function p.render(frame)
local args = frame:getParent().args
local rows = {}
for i, v in ipairs(args) do
local parts = mw.text.split(v, ';')
local name = mw.text.trim(parts[1] or '')
local slotType = mw.text.trim(parts[2] or 'None')
local index = parts[3] and mw.text.trim(parts[3]) or tostring(i - 1)
if name ~= '' then
table.insert(rows, '|-\n| ' .. name .. ' || ' .. slotType .. ' || ' .. index)
end
end
return '{| class="wikitable"\n|-\n! Slot Name !! Type !! Index\n'
.. table.concat(rows, '\n') .. '\n|}'
end
return p