Anonymous

Module:Township: Difference between revisions

From Melvor Idle
no edit summary
No edit summary
No edit summary
Line 386: Line 386:
-- Biomes
-- Biomes
table.insert(ret, '\r\n|-\r\n| <b>Biomes:</b><br>')
table.insert(ret, '\r\n|-\r\n| <b>Biomes:</b>')
for _, biomeid in ipairs(building.biomes) do
for _, biomeid in ipairs(building.biomes) do
local biomename = GameData.getEntityByID(Township.biomes, biomeid).name
local biomename = GameData.getEntityByID(Township.biomes, biomeid).name
Line 397: Line 397:
local color = modifier.value < 0 and 'red' or 'green'
local color = modifier.value < 0 and 'red' or 'green'
local modifier_value = Shared.numStrWithSign(modifier.value)
local modifier_value = Shared.numStrWithSign(modifier.value)
table.insert(ret, '\r\n'..Icons.Icon({biomename, type='biome', notext=true, nolink=true})..' <span style="color:'..color..'"><b>'..biomename..' ('..modifier_value..'%)</b></span>')
table.insert(ret, '<br>'..Icons.Icon({biomename, type='biome', notext=true, nolink=true})..' <span style="color:'..color..'"><b>'..biomename..' ('..modifier_value..'%)</b></span>')
else
else
table.insert(ret, '\r\n'..Icons.Icon({biomename, type='biome', notext=true, nolink=true})..' <span>'..biomename..'</span>')
table.insert(ret, '<br>'..Icons.Icon({biomename, type='biome', notext=true, nolink=true})..' <span>'..biomename..'</span>')
end
end
end
end
572

edits