Module:CharTree: Difference between revisions

Undo revision 809246 by Ritsu (talk)
(Undo revision 809253 by Ritsu (talk))
Tags: Undo Reverted
(Undo revision 809246 by Ritsu (talk))
Tags: Undo Reverted
Line 8: Line 8:
     local char_tree = mw.html.create('div'):addClass('char-banner-tree'):attr('data-base', args[1])
     local char_tree = mw.html.create('div'):addClass('char-banner-tree'):attr('data-base', args[1])
     local out = {};
     local out = {};
     local char, file_name, link, nopath, nopathnojob, entry, image_arg;
     local char, file_name, link, nopath, nopathnojob, entry;
     for job_iter=1,3,1 do
     for job_iter=1,3,1 do
         for path_iter=1,4,1 do
         for path_iter=1,4,1 do
Line 23: Line 23:


             if char ~= 'Unreleased' then
             if char ~= 'Unreleased' then
                 file_name = char:gsub(':', '');
                 file_name = 'Icon - ' .. char:gsub(':', '');
                 link = '|link=' .. char
                 link = '|link=' .. char
             end
             end
Line 32: Line 32:
             end
             end


            image_arg = args['image' .. path_iter .. 'x' .. job_iter]
             entry:attr('data-class-name', char):wikitext('[[File:' .. file_name .. '.png' .. link .. ']]');
 
            if image_arg then
                file_name = image_arg
            end
 
             entry:attr('data-class-name', char):wikitext('[[File:Icon - ' .. file_name .. '.png' .. link .. ']]');


             if (args[nopath] ~= nil) then
             if (args[nopath] ~= nil) then