Module:ASBInput: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
Created page with "local p = {} -- note this function isn't designed to be used in other modules w/out modification function file(name, size) return "" .. size .. "|link=" end -- retrieve input image associations local inputFiles = mw.loadData("Module:ASBInput/Input File Data") function p.main(frame) local final = "" for i, val in ipairs(frame.args) do if i ~= 1 then final = final .. " + " end -- convert presets (could make this a Lua table ins..." |
mNo edit summary |
||
Line 12: | Line 12: | ||
local final = "" |
local final = "" |
||
for i, val in ipairs(frame.args) do |
for i, val in ipairs(frame:getParent().args) do |
||
if i ~= 1 then |
if i ~= 1 then |
||
final = final .. " + " |
final = final .. " + " |
Revision as of 05:23, 26 February 2024
Documentation for this module may be created at Module:ASBInput/doc
local p = {}
-- note this function isn't designed to be used in other modules w/out modification
function file(name, size)
return "[[File:" .. name .. "|" .. size .. "|link=]]"
end
-- retrieve input image associations
local inputFiles = mw.loadData("Module:ASBInput/Input File Data")
function p.main(frame)
local final = ""
for i, val in ipairs(frame:getParent().args) do
if i ~= 1 then
final = final .. " + "
end
-- convert presets (could make this a Lua table instead at some point)
if val == "ATK" then
input = "L/M/H"
else
input = val
end
-- loop through input symbols
for i = 1, string.len(input), 1 do
char = string.sub(input, i, i)
final = final .. ( file(inputFiles[char], "25px") or char or "" )
end
end
return final
end