Anonymous

Module:Sandbox/GauTest/Township: Difference between revisions

From Melvor Idle
no edit summary
No edit summary
No edit summary
Line 673: Line 673:
local ret = {}
local ret = {}
table.insert(ret, '\r\n{| class="wikitable sortable" style="text-align:center"')
table.insert(ret, '\r\n{| class="wikitable sortable" style="text-align:center"')
table.insert(ret, '\r\n!style="text-align:left"|Building')
table.insert(ret, '\r\n!Building')
-- Make a biomeModifiers table that will keep track of the bonus of each building
-- Make a biomeModifiers table that will keep track of the bonus of each building
Line 707: Line 707:
if modifier == 0 then
if modifier == 0 then
-- Buildable but no bonuses
-- Buildable but no bonuses
table.insert(ret, '\r\n|style="background-color:grey;"|0')
table.insert(ret, '\r\n|style="background-color:grey;"|+0%')
else
else
-- Bonus or penalty
-- Bonus or penalty
local color = modifier < 0 and 'red' or 'green'
local color = modifier < 0 and 'lightpink' or 'lightgreen'
local modifier_value = Shared.numStrWithSign(modifier)
local modifier_value = Shared.numStrWithSign(modifier)
table.insert(ret, '\r\n|style="background-color:'..color..'"|<b>'..modifier_value..'</b>')
table.insert(ret, '\r\n|style="background-color:'..color..'"|<b>'..modifier_value..'%</b>')
end
end
else
else
572

edits