Content deleted Content added
Paisley Park (talk | contribs) No edit summary |
mNo edit summary |
||
(7 intermediate revisions by one other user not shown) | |||
Line 14:
ptnultimate = '<span style="background-color:#a12932; color:white; font-size:12px; padding:3px 5px; font-family:Roboto Slab;">Ultimate</span>',
ptnpassive = '<span style="background-color:#4e699e; color:white; font-size:12px; padding:3px 5px; font-family:Roboto Slab;">Passive</span>',
}
-- Function to generate a `[[File:...]]` tag for the given file
local function getFileTag(fileName, size)
size = size or "20"
return mw.text.tag("span", {
["class"] = "image",
["style"] = "display:inline-block; vertical-align:middle; margin-right:3px;",
}, '[[File:' .. fileName .. '|' .. size .. 'px|link=|alt=]]')
end
function p.renderInputs(frame)
local args = frame.args
local output = {}
-- Generate the file tags for local images
local energyIcon = getFileTag("PtN Energy Icon.png")
local coreIcon = getFileTag("PtN Core Icon.png")
-- Loop through user inputs
for
if inputStyles[value] then▼
if value == "ptnenergy" and inputStyles[value] then
local number = args[i + 1] or ""
table.insert(output, inputStyles[value]:format(energyIcon, number))
elseif value == "ptncore" and inputStyles[value] then
local number = args[i + 1] or ""
table.insert(output, inputStyles[value]:format(coreIcon, number))
-- Handle inputs without numbers
table.insert(output, inputStyles[value])
end
|