No edit summary
No edit summary
Tag: Manual revert
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
require('Module:CommonFunctions')
require('Module:CommonFunctions')
require('Module:InfoboxProto');
local getArgs = require('Module:Arguments').getArgs
local getArgs = require('Module:Arguments').getArgs
local p = {}
local p = {}


-- Main process
function p.main(frame)
function p.main(frame)
     local args = getArgs(frame);
     local args = getArgs(frame);
    local infobox = require('Module:InfoboxProto').main(frame, args.title);
    local divclass = args.divclass;
    if divclass == nil then
        divclass = 'custom'
    end
    infobox:addClass('infobox-' .. divclass);


     local CHARACTER_ID = {
     for k, v in spairs(args) do
        Elsword = 1,
         if string.match(k, 'data[0-9]+') ~= nil then
         Aisha = 2,
            local i = k:gsub('data', '');
        Rena = 3,
            addField('data' .. i, args['label' .. i])
        Raven = 4,
        Eve = 5,
        Chung = 6,
        Ara = 7,
        Elesis = 8,
        Add = 9,
        LuCiel = 10,
        Rose = 11,
        Ain = 12,
        Laby = 13,
        Noah = 14,
        Lithia = 15
    }
 
    local character = args[1]
    local data = args[2]
    local pathIndex = ""
    local jobIndex = ""
    local transString = ""
    local link = args.link and (data == "base" and character or args.link) or ""
    local lang = args.link and args.lang and ("/" .. args.lang) or ""
 
    if data == "base" then
        jobIndex = "NO_OCCUPATION"
    elseif data ~= "base" then
        local arr = split(data, "x");
        pathIndex = arr[1] .. "LINE_"
        if string.find(pathIndex, "t") then
            transString = "_T"
            pathIndex = pathIndex:gsub("t", "")
            arr[2] = "2"
         end
         end
        jobIndex = arr[2] and ("0" .. arr[2]) or ""
     end
     end
   
    return tostring(infobox);


    local image = mw.html.create('div'):addClass('image-cropped')
    image:tag('div'):addClass('image-wrap'):wikitext("[[File:Character Face " .. CHARACTER_ID[character] .. "-FACE " .. pathIndex .. jobIndex .. transString .. ".png|link=" .. link .. lang .. "]]")
    return tostring(image)
end
end


return p
return p

Latest revision as of 15:22, 17 June 2024

Documentation for this module may be created at Module:Test/doc

require('Module:CommonFunctions')
require('Module:InfoboxProto');
local getArgs = require('Module:Arguments').getArgs
local p = {}

-- Main process
function p.main(frame)
    local args = getArgs(frame);
    local infobox = require('Module:InfoboxProto').main(frame, args.title);
    local divclass = args.divclass;
    if divclass == nil then
        divclass = 'custom'
    end
    infobox:addClass('infobox-' .. divclass);

    for k, v in spairs(args) do
        if string.match(k, 'data[0-9]+') ~= nil then
            local i = k:gsub('data', '');
            addField('data' .. i, args['label' .. i])
        end
    end
    
    return tostring(infobox);

end

return p