Module:Test: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 26: Line 26:
     local lang = args.lang and ("/" .. args.lang) or ""
     local lang = args.lang and ("/" .. args.lang) or ""


    local character = args[1]
     local data = args[2]
     local data = args[2]
     local pathIndex = ""
     local pathIndex = ""
     local jobIndex = ""
     local jobIndex = ""
     local transString = ""
     local transString = ""
    local link = args.link and (data == "base" and character or args.link)


     if data == "base" then
     if data == "base" then
Line 45: Line 47:


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


     return tostring(image)
     return tostring(image)