572
edits
No edit summary |
No edit summary |
||
Line 362: | Line 362: | ||
-- Upgrades To | -- Upgrades To | ||
local upgradesTo = GameData. | local function checkFunc(entity) | ||
if upgradesTo | return entity.upgradesFrom ~= nil and entity.upgradesFrom == building.id | ||
table.insert(ret, '\r\n|-\r\n| <b>Upgrades To:</b> '..Icons.Icon({upgradesTo.name, type='building'})) | end | ||
local upgradesTo = GameData.getEntities(Township.buildings, checkFunc) | |||
if #upgradesTo > 0 then | |||
table.insert(ret, '\r\n|-\r\n| <b>Upgrades To:</b> '..Icons.Icon({upgradesTo[1].name, type='building'})) | |||
-- Cost | -- Cost | ||
local upgrade_cost = {} | local upgrade_cost = {} | ||
for _, resource in ipairs(upgradesTo.cost) do | for _, resource in ipairs(upgradesTo[1].cost) do | ||
table.insert(upgrade_cost, Icons.Icon(p._GetResourceIcon(resource.id))..' '..resource.quantity) | table.insert(upgrade_cost, Icons.Icon(p._GetResourceIcon(resource.id))..' '..resource.quantity) | ||
end | end |
edits