Module:GasIcon
From Stationeers Community Wiki
More actions
Documentation for this module may be created at Module:GasIcon/doc
local GasData = mw.loadData("Module:Gas/data")
local Gas = require("Module:Gas")
local p = {}
local function CreateStyle(args)
local css={}
css.display = "inline-block"
css.height = args.Size or "32px"
css.width = css.height
css["vertical-align"] = "baseline"
return css
end
function p.GetIcon(frame)
local args = frame:getParent().args
local gas = Gas.GetGas(args[1])
mw.logObject(args)
local html = mw.html.create("span")
:css(CreateStyle(args))
:wikitext("[["..gas.Image.."|link="..gas.HumanReadableName.."]]")
:done()
return html
end
p.GetIcon2 = p.GetIcon --still kept for sandbox template
return p