Difference between revisions of "Module:Infobox"

Jump to navigation Jump to search
34 bytes added ,  16:32, 13 August 2022
no edit summary
Line 172: Line 172:
end
end
end
end
end
--Construction group
if buildingData.construction then
--Construction group
local conList = {}
if buildingData.construction then
for k, v in pairs(buildingData.construction) do
local conList = {}
local conLabel = i.icon(k, nil, nil, string.gsub(k,  
for k, v in pairs(buildingData.construction) do
string.sub(k,1,1), string.upper(string.sub(k,1,1)), 1),
local conLabel = i.icon(k, nil, nil, string.gsub(k,  
'en')
string.sub(k,1,1), string.upper(string.sub(k,1,1)), 1),
table.insert(conList, infoboxData(v, conLabel))
'en')
end
table.insert(conList, infoboxData(v, conLabel))
local conGroup = infoboxGroup(conList, '2', 'Construction Requirements')
end
for k, v in ipairs(conGroup) do
result:node(v)
local conGroup = infoboxGroup(conList, '2', 'Construction Requirements')
for k, v in ipairs(conGroup) do
result:node(v)
end
end
end
end
local maintenance = buildingData.maintenance
local maintenance = buildingData.maintenance
local tax = buildingData.tax
local tax = buildingData.tax
if maintenance or tax then
if maintenance or tax then
local costSet = {}
local costSet = {}
local maintenanceLabel = i.icon('maintenance cost', nil , nil,  
local maintenanceLabel = i.icon('maintenance cost', nil , nil,  
'Maintenance Cost', 'en')
'Maintenance Cost', 'en')
local taxLabel = i.icon('coin', nil, nil, 'Tax', 'en')
local taxLabel = i.icon('coin', nil, nil, 'Tax', 'en')
table.insert(costSet, infoboxData(maintenance, maintenanceLabel))
table.insert(costSet, infoboxData(maintenance, maintenanceLabel))
table.insert(costSet, infoboxData(tax, taxLabel))
table.insert(costSet, infoboxData(tax, taxLabel))
local costGroup = infoboxGroup(costSet, nil, 'Running Costs')
local costGroup = infoboxGroup(costSet, nil, 'Running Costs')
for k, v in ipairs(costGroup) do
for k, v in ipairs(costGroup) do
result:node(v)
result:node(v)
end
end
end
end
end

Navigation menu