Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:GasIcon: Difference between revisions

From Stationeers Community Wiki
RA2lover (talk | contribs)
No edit summary
RA2lover (talk | contribs)
Move Gas name parsing to the more robust Module:Gas
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
local GasData = mw.loadData("Module:Gas/data")
local GasData = mw.loadData("Module:Gas/data")
local Gas = require("Module:Gas")
local p = {}
local p = {}
     function p.GetIcon(frame)
     function p.GetIcon(frame)
         local args = frame:getParent().args
         local args = frame:getParent().args
         local gas = GasData[args[1]]
         local gas = Gas.GetGas(args[1])
        mw.logObject(args)
         local size = args.Size or "32px"
         local size = args.Size or "32px"
         return "[["..gas.Image.."|"..size.."|link=.."..gas.HumanReadableName"]]"
         return "[["..gas.Image.."|"..size.."|link="..gas.HumanReadableName.."]]"
     end
     end
return p
return p

Latest revision as of 18:11, 15 March 2026

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 = {}
    function p.GetIcon(frame)
        local args = frame:getParent().args
        local gas = Gas.GetGas(args[1])
        mw.logObject(args)
        local size = args.Size or "32px"
        return "[["..gas.Image.."|"..size.."|link="..gas.HumanReadableName.."]]"
    end
return p