Anonymous

Module:Township: Difference between revisions

From Melvor Idle
no edit summary
(Add biome icons to p.GetBuildingBiomeTable(), p.GetBuildingTable() p._GetBiomeModifiers())
No edit summary
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, Icons.Icon({biomename, type='biome', notext=true, nolink=true})..' <span style="color:'..color..'"><b>'..biomename..' ('..modifier_value..'%)</b></span>')
table.insert(ret, '\r\n'..Icons.Icon({biomename, type='biome', notext=true, nolink=true})..' <span style="color:'..color..'"><b>'..biomename..' ('..modifier_value..'%)</b></span>')
else
else
table.insert(ret, Icons.Icon({biomename, type='biome', notext=true, nolink=true})..' <span>'..biomename..'</span>')
table.insert(ret, '\r\n'..Icons.Icon({biomename, type='biome', notext=true, nolink=true})..' <span>'..biomename..'</span>')
end
end
end
end
Line 665: Line 665:
local biomeModifiersMaster = {}
local biomeModifiersMaster = {}
for _, biome in ipairs(Township.biomes) do
for _, biome in ipairs(Township.biomes) do
table.insert(ret, '\r\n!'..biome.name)
table.insert(ret, '\r\n!'..Icons.Icon({biome.name, type='biome', notext=true, nolink=true})..'<br>'..biome.name)
biomeModifiersMaster[biome.id] = false
biomeModifiersMaster[biome.id] = false
end
-- Put the icons in the second row
table.insert(ret, '\r\n|-')
table.insert(ret, '\r\n!')
for _, biome in ipairs(Township.biomes) do
table.insert(ret, '\r\n!'..Icons.Icon({biome.name, type='biome', notext=true, nolink=true}))
end
end
572

edits