Anonymous

Module:Sandbox/GauTest/Township: Difference between revisions

From Melvor Idle
no edit summary
No edit summary
No edit summary
Line 342: Line 342:


-- Todo - integrate into Icons.Icon?
-- Todo - integrate into Icons.Icon?
-- Township Icons are licensed from Font Awesome Free 5.14.0 under CC BY 4.0 (https://github.com/FortAwesome/Font-Awesome/tree/5.14.0)
function p.GetTownshipStatIcon(stat)
function p.GetTownshipStatIcon(stat)
return '<span style="display:inline-block" class="township-colortoggle">[[File:'..stat..'_(township).svg|25x25px|link='..stat..']]</span>'
local changing_color = {
Population = true,
Workers = true,
Storage = true,
Happiness = false,
Education = false,
Health = false,
Worship = false
}
local class = changing_color[stat] and ' class="township-colortoggle"' or ''
return '<span style="display:inline-block"'..class..'>[[File:'..stat..'_(township).svg|25x25px|link='..stat..']]</span>'
end
end


572

edits