606
edits
m |
m |
||
| Line 214: | Line 214: | ||
if buildingData.construction then | if buildingData.construction then | ||
local constructionData = {} | local constructionData = {} | ||
local pair = {} | |||
for resource, amount in pairs(buildingData.construction) do | for resource, amount in pairs(buildingData.construction) do | ||
local resourceIcon = i.icon(resource, amount, nil, com.firstUpper({resource}), 'en') | local resourceIcon = i.icon(resource, amount, nil, com.firstUpper({resource}), 'en') | ||
table.insert( | |||
table.insert(pair, { label = resourceIcon, value = amount }) | |||
if #pair == 2 then | |||
table.insert(constructionData, pair) | |||
pair = {} | |||
end | |||
end | |||
if #pair == 1 then | |||
table.insert(constructionData, pair) | |||
end | end | ||
edits