Anonymous

Module:Sandbox/GauTest/Township: Difference between revisions

From Melvor Idle
Maps
No edit summary
(Maps)
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, 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, 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
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