606
edits
m |
m |
||
| Line 194: | Line 194: | ||
local first = true | local first = true | ||
for resource, amount in pairs(buildingData.influence) do | for resource, amount in pairs(buildingData.influence) do | ||
if resource ~= 'tier' then -- Exclude | if resource ~= 'tier' and resource ~= 'perEach splendour' then -- Exclude 'tier' and 'perEach splendour' | ||
local displayAmount = amount | local displayAmount = amount | ||
if first and buildingData.influence.tier then | if first and buildingData.influence.tier then | ||
| Line 234: | Line 234: | ||
local costData = {} | local costData = {} | ||
if buildingData.costs or buildingData.influence['perEach splendour'] then | |||
local costData = {} | local costData = {} | ||
for resource, amount in pairs(buildingData.costs) do | for resource, amount in pairs(buildingData.costs) do | ||
| Line 240: | Line 240: | ||
table.insert(costData, {label = resourceIcon, value = amount}) | table.insert(costData, {label = resourceIcon, value = amount}) | ||
end | end | ||
-- Add 'perEach splendour' to running costs if it exists | |||
if buildingData.influence['perEach splendour'] then | |||
local resourceIcon = i.icon('splendor', nil, nil, 'Splendor', 'en') -- Assuming a generic splendor icon | |||
table.insert(costData, {label = resourceIcon .. ' (per each)', value = buildingData.influence['perEach splendour']}) | |||
end | |||
if #costData > 0 then | if #costData > 0 then | ||
addSection(infobox, costData, 'Economic Impact', 2) | addSection(infobox, costData, 'Economic Impact', 2) | ||
edits