Anonymous

Module:Sandbox/GauTest/Township: Difference between revisions

From Melvor Idle
no edit summary
No edit summary
No edit summary
Line 351: Line 351:
-- Upgrades From
-- Upgrades From
table.insert(ret, '\r\n|-\r\n|')
if building.upgradesFrom ~= nil then
if building.upgradesFrom ~= nil then
table.insert(ret, '\r\n|-\r\n| <b>Upgrades From:</b> '..Icons.Icon({building.upgradesFrom, type='building'}))
local upgradesFromBuilding = GameData.getEntityByID(Township.buildings, building.upgradesFrom)
table.insert(ret, '<b>Upgrades From:</b> '..Icons.Icon({upgradesFromBuilding.name, type='building'})..'<br>')
end
end
-- Cost
-- Cost
Line 359: Line 361:
table.insert(cost, Icons.Icon(p._GetResourceIcon(resource.id))..' '..resource.quantity)
table.insert(cost, Icons.Icon(p._GetResourceIcon(resource.id))..' '..resource.quantity)
end
end
table.insert(ret, '\r\n|-\r\n| <b>Base Cost:</b> '..table.concat(cost, ', '))
table.insert(ret, '<b>Base Cost:</b> '..table.concat(cost, ', '))
-- Upgrades To
-- Upgrades To
Line 373: Line 375:
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
table.insert(ret, '\r\n|-\r\n| <b>Upgrade Base Cost:</b> '..table.concat(upgrade_cost, ', '))
table.insert(ret, '<br><b>Upgrade Base Cost:</b> '..table.concat(upgrade_cost, ', '))
end
end


572

edits