Anonymous

Module:Sandbox/GauTest/Township: Difference between revisions

From Melvor Idle
no edit summary
No edit summary
No edit summary
Line 339: Line 339:
-- Upgrades From
-- Upgrades From
table.insert(ret, '\r\n|-\r\n|')
table.insert(ret, '\r\n|-\r\n|Base Cost')
if building.upgradesFrom ~= nil then
if building.upgradesFrom ~= nil then
local upgradesFromBuilding = p._GetBuildingByID(building.upgradesFrom)
local upgradesFromBuilding = p._GetBuildingByID(building.upgradesFrom)
table.insert(ret, '<b>Upgrades From:</b> '..Icons.Icon({upgradesFromBuilding.name, type='building'})..'<br>')
table.insert(ret, '<br>'..Icons.Icon({upgradesFromBuilding.name, type='building'})..'<br>')
end
end
-- Cost
-- Cost
Line 350: Line 350:
table.insert(cost, Icons.Icon({resource_data.name, type='resource', notext=true})..'&nbsp;'..resource.quantity)
table.insert(cost, Icons.Icon({resource_data.name, type='resource', notext=true})..'&nbsp;'..resource.quantity)
end
end
table.insert(ret, '<b>Base Cost:</b> '..table.concat(cost, ', '))
table.insert(ret, table.concat(cost, ', '))
-- Upgrades To
-- Upgrades To
Line 358: Line 358:
local upgradesTo = GameData.getEntities(Township.buildings, checkFunc)
local upgradesTo = GameData.getEntities(Township.buildings, checkFunc)
if #upgradesTo > 0 then
if #upgradesTo > 0 then
table.insert(ret, '\r\n|-\r\n| <b>Upgrades To:</b> '..Icons.Icon({upgradesTo[1].name, type='building'}))
table.insert(ret, '\r\n|-\r\n| <b>Upgrades To:</b><br>'..Icons.Icon({upgradesTo[1].name, type='building'}))
-- Cost
-- Cost
local upgrade_cost = {}
local upgrade_cost = {}
Line 365: Line 365:
table.insert(upgrade_cost, Icons.Icon({resource_data.name, type='resource', notext=true})..'&nbsp;'..resource.quantity)
table.insert(upgrade_cost, Icons.Icon({resource_data.name, type='resource', notext=true})..'&nbsp;'..resource.quantity)
end
end
table.insert(ret, '<br><b>Upgrade Base Cost:</b> '..table.concat(upgrade_cost, ', '))
table.insert(ret, '<br>'..table.concat(upgrade_cost, ', '))
end
end


572

edits