1,124
edits
Line 172: | Line 172: | ||
end | end | ||
end | end | ||
--Construction group | |||
--Construction group | |||
if buildingData.construction then | |||
local conList = {} | |||
for k, v in pairs(buildingData.construction) do | |||
local conLabel = i.icon(k, nil, nil, string.gsub(k, | |||
string.sub(k,1,1), string.upper(string.sub(k,1,1)), 1), | |||
'en') | |||
table.insert(conList, infoboxData(v, conLabel)) | |||
end | |||
local conGroup = infoboxGroup(conList, '2', 'Construction Requirements') | |||
for k, v in ipairs(conGroup) do | |||
result:node(v) | |||
end | |||
end | end | ||
local maintenance = buildingData.maintenance | |||
local tax = buildingData.tax | |||
if maintenance or tax then | |||
local costSet = {} | |||
local maintenanceLabel = i.icon('maintenance cost', nil , nil, | |||
'Maintenance Cost', 'en') | |||
local taxLabel = i.icon('coin', nil, nil, 'Tax', 'en') | |||
table.insert(costSet, infoboxData(maintenance, maintenanceLabel)) | |||
table.insert(costSet, infoboxData(tax, taxLabel)) | |||
local costGroup = infoboxGroup(costSet, nil, 'Running Costs') | |||
for k, v in ipairs(costGroup) do | |||
result:node(v) | |||
end | |||
end | end | ||
end | end |