Module:PlayerIMG: Difference between revisions
Created page with "local p = {} --p stands for package local fileModule = require("Module:FileExists") --1: IGN 2: TYPE 3: VARIANT 4: SIZE function p.template( frame ) local ign = frame.args[1] local typeIMG = string.lower(frame.args[2]) local variant = string.lower(frame.args[3]) local size = "225px" if frame.args[4] ~= nil then size = frame.args[4] elseif typeIMG == "small" then size = "20px" end if typeIMG == "small" then typeIMG = "" end if string.sub(variant, 1, 1) =..." |
No edit summary |
||
| (4 intermediate revisions by the same user not shown) | |||
| Line 11: | Line 11: | ||
if frame.args[4] ~= nil then | if frame.args[4] ~= nil then | ||
size = frame.args[4] | size = frame.args[4] | ||
end | end | ||
if typeIMG == "small" then | if typeIMG == "small" then | ||
size = "20px" | |||
typeIMG = "" | typeIMG = "" | ||
end | end | ||
if string.sub(variant, 1, 1) | if string.sub(variant, 1, 1) ~= " " then | ||
variant = | variant = " "..variant | ||
end | |||
if variant == " " then | |||
variant = "" | |||
end | end | ||
if typeIMG == "full" then | if typeIMG == "full" then | ||
| Line 28: | Line 30: | ||
typeIMG = " "..typeIMG | typeIMG = " "..typeIMG | ||
end | end | ||
return "File:"..ign..typeIMG..variant..".png" | return frame:preprocess("[[File:"..ign..typeIMG..variant..".png|"..size.."]]") | ||
end | end | ||
return p | return p | ||