606
edits
m |
m |
||
| Line 236: | Line 236: | ||
--/ | --/ | ||
--SECTION-RUNNING-COSTS | --SECTION-RUNNING-COSTS | ||
local costData = {} | |||
local goldCoinsFound = false | |||
if buildingData.costs or buildingData.influence['bsplendour | if buildingData.costs or buildingData.influence['bsplendour'] then | ||
for resource, amount in pairs(buildingData.costs) do | for resource, amount in pairs(buildingData.costs) do | ||
if resource == 'gold coins' then | if resource == 'gold coins' then | ||
| Line 245: | Line 245: | ||
table.insert(costData, {label = '[[File:Gold Coins.png|frameless|20x20px]] ' .. '[[Gold Coins|Build Cost]]', value = amount}) | table.insert(costData, {label = '[[File:Gold Coins.png|frameless|20x20px]] ' .. '[[Gold Coins|Build Cost]]', value = amount}) | ||
goldCoinsFound = true | goldCoinsFound = true | ||
elseif resource ~= 'maintenance' then | |||
local resourceIcon = i.icon(resource, nil, nil, com.firstUpper({resource}), 'en') | local resourceIcon = i.icon(resource, nil, nil, com.firstUpper({resource}), 'en') | ||
table.insert(costData, {label = resourceIcon, value = amount}) | table.insert(costData, {label = resourceIcon, value = amount}) | ||
end | end | ||
if resource ~= 'maintenance' then | if resource ~= 'maintenance' then | ||
local displayAmount = amount | local displayAmount = amount | ||
if second and buildingData.costs.maintenance then | if second and buildingData.costs.maintenance then | ||
| Line 259: | Line 258: | ||
end | end | ||
if buildingData.costs['maintenance'] then | if buildingData.costs and buildingData.costs['maintenance'] then | ||
local resourceIcon = i.icon('maintenance', nil, nil, 'maintenance', 'en') | local resourceIcon = i.icon('maintenance', nil, nil, 'maintenance', 'en') | ||
table.insert(costData, {label = resourceIcon, value = '[[File:Gold Coins.png|frameless|20x20px]]' .. buildingData.costs['maintenance'] .. ' monthly'}) | table.insert(costData, {label = resourceIcon, value = '[[File:Gold Coins.png|frameless|20x20px]]' .. buildingData.costs['maintenance'] .. ' monthly'}) | ||
edits