606
edits
m |
m |
||
| Line 238: | Line 238: | ||
local costData = {} | local costData = {} | ||
if buildingData.costs or buildingData.influence['bsplendour'] then | if buildingData.costs or buildingData.influence['bsplendour'] or buildingData.costs['gold coins'] then | ||
local costData = {} | local costData = {} | ||
for resource, amount in pairs(buildingData.costs) do | for resource, amount in pairs(buildingData.costs) do | ||
local resourceIcon = i.icon(resource, nil, nil, com.firstUpper({resource}), 'en') | |||
table.insert(costData, {label = resourceIcon, value = amount}) | |||
local resourceIcon = i.icon(resource, nil, nil, | |||
table.insert(costData, {label = | |||
end | end | ||
if buildingData.costs['gold coins'] then | |||
local resourceIcon = i.icon('gold coins', nil, nil, 'gold coins', 'en') | |||
table.insert(costData, {label = 'Build Cost', value = buildingData.costs['gold coins']}) | |||
end | |||
-- Add 'bsplendour' to running costs if it exists | -- Add 'bsplendour' to running costs if it exists | ||
if buildingData.influence['bsplendour'] then | if buildingData.influence['bsplendour'] then | ||
| Line 256: | Line 255: | ||
table.insert(costData, {label = resourceIcon, value = buildingData.influence['bsplendour']}) | table.insert(costData, {label = resourceIcon, value = buildingData.influence['bsplendour']}) | ||
end | end | ||
if #costData > 0 then | if #costData > 0 then | ||
addSection(infobox, costData, 'Economic | addSection(infobox, costData, 'Economic Costs', 2) | ||
end | end | ||
end | end | ||
end | |||
--/ | |||
return infobox | return infobox | ||
end | end | ||
return p | return p | ||
edits