Module:SkillTable: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 44: Line 44:
         local name = skill_name_table[i];
         local name = skill_name_table[i];
         local lock = ''
         local lock = ''
        local mod_subpage = '';


         -- Locked skills
         -- Locked skills
Line 53: Line 54:
                 args = {lock_arg}
                 args = {lock_arg}
             }
             }
        end
        -- Mod skills
        if (string.find(name, '/Mod')) then
            name = name:gsub('%/Mod', '');
            mod_subpage = '/ModA';
         end
         end


Line 71: Line 78:
         if not (is_header) then
         if not (is_header) then
             local image_cell = row:tag('div'):attr('data-type', 'table-cell'):attr('style', 'width:54px');
             local image_cell = row:tag('div'):attr('data-type', 'table-cell'):attr('style', 'width:54px');
             image_cell:wikitext('[[File:' .. image .. '|link=' .. name .. ']]')
             if (mod_subpage == '') then
                image_cell:wikitext('[[File:' .. image .. '|link=' .. name .. ']]')
            else
                image_cell:wikitext(frame:expandTemplate{
                    title = 'Force',
                    args = {image, link = name}
                });
            end
             local name_cell = row:tag('div'):attr('data-type', 'table-cell'):attr('style', 'width:150px');
             local name_cell = row:tag('div'):attr('data-type', 'table-cell'):attr('style', 'width:150px');
             local skill_wrap = name_cell:tag('div'):addClass('skill-wrap');
             local skill_wrap = name_cell:tag('div'):addClass('skill-wrap');
             skill_wrap:wikitext('[[' .. name .. '|.]]');
             skill_wrap:wikitext('[[' .. name .. mod_subpage .. '|.]]');
             skill_wrap:tag('div'):addClass('skill-wrap-text'):wikitext('[[' .. name .. ']] ' .. lock);
            local display_name = name:gsub("%s%([%w%s%/]+%)", "");
             skill_wrap:tag('div'):addClass('skill-wrap-text'):wikitext('[[' .. name .. mod_subpage .. '|' .. display_name .. ']] ' .. lock);
           
             -- If a header is detected, it will not interrupt chunking.
             -- If a header is detected, it will not interrupt chunking.
             i = i + 1
             i = i + 1