Difference between revisions of "Module:Infobox"

Jump to navigation Jump to search
463 bytes added ,  20:19, 11 August 2022
no edit summary
Line 128: Line 128:
--Production group
--Production group
local workers = buildingData.workers
local workers = buildingData.workers
local requirementData = buildingData.requirements
local requirements = ''
if requirementData then
for k, v in ipairs(requirementData) do
requirements = requirements .. i.icon(v, nil, nil, string.gsub(v,
string.sub(v,1,1), string.upper(string.sub(v,1,1)), 1),
'en')
if k ~= #requirementData then
requirements = requirements .. '<br />'
end
end
end
local productData = buildingData.products
local productData = buildingData.products
local products = ''
local products = ''
Line 144: Line 157:
local productionSet = {}
local productionSet = {}
table.insert(productionSet, infoboxData(workers, 'Workers'))
table.insert(productionSet, infoboxData(workers, 'Workers'))
table.insert(productionSet, infoboxData(requirements, 'Requires'))
table.insert(productionSet, infoboxData(products, 'Produces'))
table.insert(productionSet, infoboxData(products, 'Produces'))
local production = infoboxGroup(productionSet, nil, 'Production')
local production = infoboxGroup(productionSet, nil, 'Production')

Navigation menu