Module:SkillNav/zh-hant: Difference between revisions

From Elwiki
No edit summary
No edit summary
 
(10 intermediate revisions by the same user not shown)
Line 3: Line 3:
local p = {}
local p = {}


-- Main process
function p.main(frame)
function p.main(frame)
     local args = getArgs(frame);
     local args = getArgs(frame)


    -- Making life easier.
     function inArgs(name)
     function inArgs(name)
         if (inArray(name, args)) then
         if (inArray(name, args)) then
Line 14: Line 12:
     end
     end


     local isForceNav = args.forcenav ~= nil;
     local isForceNav = args.forcenav ~= nil


    -- Prepare a table of skill types to display in the navigation.
     local skill_types
     local skill_types;
     if (not isForceNav) then
     if (not isForceNav) then
         skill_types = {{
         skill_types = {
             name = args.l_hyper, -- 'Hyper Active',
             { name = args.l_hyper, abbr = 'HA' },
            abbr = 'HA'
             { name = args.l_secret, abbr = 'SeA' },
        }, {
             { name = args.l_special, abbr = 'SA' },
             name = args.l_secret, -- 'Secret Art',
             { name = args.l_active, abbr = 'A' },
            abbr = 'SeA'
             { name = args.l_mod, abbr = 'FC', mod = true, link_suffix = '/Mod' },
        }, {
             { name = args.l_mod2, abbr = 'FC2', mod = true, force_class = 'base' },
             name = args.l_special, -- 'Special Active',
             { name = args.l_buff, abbr = 'B' },
            abbr = 'SA'
             { name = args.l_passive, abbr = 'P' },
        }, {
             { name = args.l_demon, abbr = 'MD' },
             name = args.l_active, -- 'Active',
             { name = '[[File:ForceIcon.png|16px]] ' .. args.l_demon, abbr = 'MDF', mod = true, link_suffix = '/Mod' },
            abbr = 'A'
             { name = args.l_master, abbr = 'MS' },
        }, {
             { name = args.l_couple, abbr = 'Wed' },
             name = args.l_mod, -- 'Force Mod',
             { name = args.l_row1, abbr = 'row1' },
            abbr = 'FC',
             { name = args.l_row2, abbr = 'row2' },
            mod = true,
             { name = args.l_row3, abbr = 'row3' },
            link_suffix = '/Mod'
             { name = args.l_row4, abbr = 'row4' }
        }, {
         }
             name = args.l_mod2, -- 'Base Mod',
            abbr = 'FC2',
            mod = true,
            force_class = 'base'
        }, {
             name = args.l_buff, -- 'Buff',
            abbr = 'B'
        }, {
             name = args.l_passive, -- 'Passive',
            abbr = 'P'
        }, {
             name = args.l_demon, -- 'Manic Demon',
            abbr = 'MD'
        }, {
             name = '[[File:ForceIcon.png|16px]] ' .. args.l_demon, -- 'Manic Demon (Force)',
            abbr = 'MDF',
            mod = true,
            link_suffix = '/Mod'
        }, {
             name = args.l_master, -- 'Master Skill',
            abbr = 'MS'
        }, {
             name = args.l_couple, -- 'Couple Skill',
            abbr = 'Wed'
        }, {
             name = args.l_row1, -- 'Row 1',
            abbr = 'row1'
        }, {
             name = args.l_row2, -- 'Row 2',
            abbr = 'row2'
        }, {
             name = args.l_row3, -- 'Row 3',
            abbr = 'row3'
        }, {
             name = args.l_row4, -- 'Row 4',
            abbr = 'row4'
         }}
     else
     else
        -- Force Nav called, change skill types
         skill_types = {
         skill_types = {{
             { name = args.l_force_active, abbr = 'FA3', type = 'third' },
             name = args.l_force_active, -- 'Force Active',
             { name = args.l_force_passive, abbr = 'FP3', type = 'third' },
            abbr = 'FA3',
             { name = args.l_force_active, abbr = 'FAM', type = 'master' },
            type = 'third'
             { name = args.l_force_passive, abbr = 'FPM', type = 'master' }
        }, {
         }
             name = args.l_force_passive, -- 'Force Passive',
            abbr = 'FP3',
            type = 'third'
        }, {
             name = args.l_force_active, -- 'Force Active',
            abbr = 'FAM',
            type = 'master'
        }, {
             name = args.l_force_passive, -- 'Force Passive',
            abbr = 'FPM',
            type = 'master'
         }}
     end
     end


    -- For backward compatibility. Do not remove until all pages are changed.
     if (args.name == nil) then args.name = args.Name end
     if (args.name == nil) then
 
        args.name = args.Name;
    local char_name = args.name
     end
     if (isForceNav and args.parent_name ~= nil) then char_name = args.parent_name end


    -- Needed this to make a custom toggle.
     local char_name_sanitized = ''
     local char_name_sanitized = '';
     for w in char_name:gmatch("%w+") do char_name_sanitized = char_name_sanitized .. w end
    local char_name = args.name;
    if (isForceNav and args.parent_name ~= nil) then
        char_name = args.parent_name;
    end
     for w in char_name:gmatch("%w+") do
        char_name_sanitized = char_name_sanitized .. w;
    end
     if (isForceNav and args.parent_name ~= nil) then
     if (isForceNav and args.parent_name ~= nil) then
         char_name_sanitized = 'ForceSkills-' .. char_name_sanitized;
         char_name_sanitized = 'ForceSkills-' .. char_name_sanitized
     end
     end


    -- Main block
     local skill_nav = mw.html.create('div'):addClass('skill-nav')
     local skill_nav = mw.html.create('div'):addClass('skill-nav');
     if (isForceNav) then skill_nav:addClass('force-nav') end
     if (isForceNav) then
        skill_nav:addClass('force-nav');
    end


    -- Header
     local header = skill_nav:tag('div'):addClass('skill-nav-header')
     local header = skill_nav:tag('div'):addClass('skill-nav-header');
     local colors = args.color or frame:expandTemplate{ title = 'ColorSel', args = { 'Character', args.char } }
     local colors;
     colors = colors:gsub('#', '#')
    if (args.color ~= nil) then
        colors = args.color;
    else
        colors = frame:expandTemplate{
            title = 'ColorSel',
            args = {'Character', args.char}
        };
     end


     -- Redirect to language subpages if provided.
     header:css('background-color', colors)
     local is_localized = args.lang ~= nil;
     if (args.is_guild ~= nil) then
    local lang_suffix = '';
         header:css({ ['justify-content'] = 'center', ['background-color'] = colors })
    if (is_localized) then
         lang_suffix = '/' .. args.lang;
     end
     end


     colors = colors:gsub('#', '#')
     local lang_suffix = args.lang and '/' .. args.lang or ''
      
     local is_localized = args.lang ~= nil
    header:css('background-color', colors);


    if (args.is_guild ~= nil) then
        header:css({
            ['justify-content'] = 'center',
            ['background-color'] = colors
        });
    end
   
     if (not isForceNav and not args.is_guild) then
     if (not isForceNav and not args.is_guild) then
         header:wikitext(frame:expandTemplate{
         header:wikitext(frame:expandTemplate{
             title = 'Face',
             title = 'Face',
             args = {
             args = {
                 args.char,
                 args.char, args.pic,
                args.pic,
                 link = args.name,
                 link = args.name,
                 lang = lang_suffix,
                 lang = lang_suffix,
Line 161: Line 80:
         })
         })
     end
     end
    -- Header text with a link
 
     if (args.l_name == nil) then
     if (args.l_name == nil) then args.l_name = args.name end
        args.l_name = args.name;
     local headerText = header:tag('span'):addClass('skill-nav-title')
    end
     local headerText = header:tag('span'):addClass('skill-nav-title');
     if (not isForceNav) then
     if (not isForceNav) then
         headerText:wikitext('[[' .. args.name .. lang_suffix .. '|' .. args.l_name .. ']] - ' .. args.l_skills);
         headerText:wikitext('[[' .. args.name .. lang_suffix .. '|' .. args.l_name .. ']] - ' .. args.l_skills)
     else
     else
         headerText:wikitext(args.name);
         headerText:wikitext(args.name)
     end
     end


    -- Generate the navigation's body
     local skill_nav_wrap = skill_nav:tag('div'):addClass('skill-nav-inner-wrap border-color')
     local skill_nav_wrap = skill_nav:tag('div'):addClass('skill-nav-inner-wrap border-color')
     if (args.type ~= nil) then
     if (args.type ~= nil) then skill_nav_wrap:addClass(args.type) end
        skill_nav_wrap:addClass(args.type);
     if ((args.type and string.find(args.type, 'mw%-collapsible')) or args.collapsible ~= nil) then
    end
         skill_nav_wrap:attr('id', 'mw-customcollapsible-' .. char_name_sanitized)
    -- Make it collapsible if needed.
         header:tag('div'):addClass('mw-customtoggle-' .. char_name_sanitized)
     if ((args.type ~= nil and string.find(args.type, 'mw%-collapsible') ~= nil) or args.collapsible ~= nil) then
         skill_nav_wrap:attr('id', 'mw-customcollapsible-' .. char_name_sanitized);
         header:tag('div'):addClass('mw-customtoggle-' .. char_name_sanitized);
    end
    if (args.collapsible ~= nil) then
        skill_nav_wrap:addClass('mw-collapsible');
    end
    if (args.collapsed ~= nil) then
        skill_nav_wrap:addClass('mw-collapsed');
     end
     end
    if (args.collapsible ~= nil) then skill_nav_wrap:addClass('mw-collapsible') end
    if (args.collapsed ~= nil) then skill_nav_wrap:addClass('mw-collapsed') end


    -- Generate the navigation's body content.
     for _, v2 in ipairs(skill_types) do
     for k2, v2 in spairs(skill_types) do
         local abbr = v2.abbr
        local name = v2['name'];
         local abbr = v2['abbr'];
        local type = v2['type'];
        local mod = v2['mod'];
        local link_suffix = v2['link_suffix'] or '';
        local force_class = v2['force_class'];
         if (inArgs(abbr)) then
         if (inArgs(abbr)) then
             -- Syntax: [image.extension]; [name]; [Alternative Names]; [image.extension]; [name]; [Alternative Names]; (...)
             local name = v2.name
             local skills = split(args[abbr], ';');
            local type = v2.type
             if (abbr == 'Wed') then
            local mod = v2.mod
            local link_suffix = v2.link_suffix or ''
            local force_class = v2.force_class
 
             local skills = split(args[abbr], ';')
             if abbr == 'Wed' then
                 skills = {
                 skills = {
                     'RelationSkill1.png', 'Extreme Heavenly Love' .. lang_suffix .. '|' .. args.l_couple_skill_name, '',
                     'RelationSkill1.png', 'Extreme Heavenly Love' .. lang_suffix .. '|' .. args.l_couple_skill_name,
                     'RelationSkill2.png', 'Extreme Heavenly Bond' .. lang_suffix .. '|' .. args.l_soulmate_skill_name, ''
                     'RelationSkill2.png', 'Extreme Heavenly Bond' .. lang_suffix .. '|' .. args.l_soulmate_skill_name
                 }
                 }
             end
             end
            -- Separate syntax for Master Skills: [Stage 1 image]; [Stage 2 image]; [Stage 3 image]; [Stage 4 image]; [skill name]; [alt names];
 
            local mc_skill_name = ''
             if abbr == 'MS' then
            local mc_skill_name_head = ''
                 local mc_skill_name = skills[5]
             if (abbr == 'MS') then
                local l_mc_skill_name = args.l_mc_skill_name or skills[5]
                 mc_skill_name = skills[5];
                 mc_skill_name = mc_skill_name:gsub('ä', 'a')
                 mc_skill_name = mc_skill_name:gsub('ä', 'a');
                 local mc_skill_name_head = '<br/>- ' .. l_mc_skill_name
                 local l_mc_skill_name = skills[5];
                 skills[7] = skills[4]
                if (args.l_mc_skill_name ~= nil and is_localized) then
                 skills[5] = skills[3]
                    l_mc_skill_name = args.l_mc_skill_name;
                 skills[3] = skills[2]
                end
                 skills[8] = mc_skill_name .. '/Stage 4' .. lang_suffix .. '|' .. args.l_stage .. ' 4'
                mc_skill_name_head = '<br/>- ' .. l_mc_skill_name;
                 skills[6] = mc_skill_name .. '/Stage 3' .. lang_suffix .. '|' .. args.l_stage .. ' 3'
                 skills[7] = skills[4];
                 skills[4] = mc_skill_name .. '/Stage 2' .. lang_suffix .. '|' .. args.l_stage .. ' 2'
                 skills[5] = skills[3];
                 skills[2] = mc_skill_name .. '/Stage 1' .. lang_suffix .. '|' .. args.l_stage .. ' 1'
                 skills[3] = skills[2];
                 name = name .. mc_skill_name_head
                 skills[8] = mc_skill_name .. '/Stage 4' .. lang_suffix .. '|' .. args.l_stage .. ' 4';
                 skills[6] = mc_skill_name .. '/Stage 3' .. lang_suffix .. '|' .. args.l_stage .. ' 3';
                 skills[4] = mc_skill_name .. '/Stage 2' .. lang_suffix .. '|' .. args.l_stage .. ' 2';
                 skills[2] = mc_skill_name .. '/Stage 1' .. lang_suffix .. '|' .. args.l_stage .. ' 1';
                 skills[9] = ''; -- Add empty alt names for consistency
             end
             end
            local i = 1;


             -- If Force Nav, append an extra header before "Force Active" if needed.
             if abbr == 'FA3' or abbr == 'FAM' then
            if (abbr == 'FA3' or abbr == 'FAM') then
                 local extra_head = skill_nav_wrap:tag('div'):addClass('skill-nav-sub-head skill-nav-extra-head border-color tone-7 color-normal-force-link')
                 local extra_head = skill_nav_wrap:tag('div'):addClass(
                 if type == 'third' then
                    'skill-nav-sub-head skill-nav-extra-head border-color tone-7 color-normal-force-link');
                     extra_head:wikitext('[[3rd Jobs' .. lang_suffix .. '|' .. args.l_third_job .. ']]')
                 if (type == 'third') then
                 elseif type == 'master' then
                     extra_head:wikitext('[[3rd Jobs' .. lang_suffix .. '|' .. args.l_third_job .. ']]');
                     extra_head:wikitext('[[Master Class' .. lang_suffix .. '|' .. args.l_master_class .. ']]')
                 elseif (type == 'master') then
                     extra_head:wikitext('[[Master Class' .. lang_suffix .. '|' .. args.l_master_class .. ']]');
                 end
                 end
             end
             end


            -- Append header fields on the left.
             skill_nav_wrap:tag('div'):addClass('skill-nav-sub-head border-color tone-4'):wikitext(name)
             skill_nav_wrap:tag('div'):addClass('skill-nav-sub-head border-color tone-4'):wikitext(name ..
            local content = skill_nav_wrap:tag('div'):addClass('skill-nav-skill-content border-color tone-6')
                                                                                                      mc_skill_name_head);


            -- Get localized names
             local l_display_names = args['l_' .. abbr] and split(args['l_' .. abbr], ";") or nil
             local l_display_names = nil;
            local i = 1
            if (abbr ~= 'MS' and args['l_' .. abbr] ~= nil) then
             while i <= #skills do
                l_display_names = split(args['l_' .. abbr], ";");
                local icon = skills[i]
             end
                local skill_name = skills[i + 1]
                local display_name


            -- Append skill fields on the right.
                 if icon == nil or skill_name == nil then break end
            local content = skill_nav_wrap:tag('div'):addClass('skill-nav-skill-content border-color tone-6');
            while i <= #skills do
                 if (skills[i] and skills[i+1] and skills[i+2]) then -- Check if all three parts exist
                    local image = skills[i];
                    local skill_name = skills[i+1];
                    local alt_names = skills[i+2];


                     -- The display name of skills
                if abbr == 'Wed' or abbr == 'MS' then
                     local v_display_name = skill_name;
                     display_name = skill_name
                     if (is_localized and abbr ~= 'MS' and l_display_names ~= nil and l_display_names[math.floor(i/3)+1]) then
                else
                         v_display_name = l_display_names[math.floor(i/3)+1];
                     display_name = skills[i + 2] or skill_name
                     if is_localized and l_display_names ~= nil then
                         display_name = l_display_names[math.ceil(i / 3)]
                     end
                     end
                     -- Remove stuff like (Elesis) or (Elsword) in skill display name
                     display_name = display_name:gsub("%s%([%w%s%/]+%)", "")
                    v_display_name = v_display_name:gsub("%s%([%w%s%/]+%)", "");
                end


                    -- Append the actual skills.
                local skill_entry = content:tag('div'):addClass('skill-nav-skill tone-7-hover color-normal-force-link tone-8-active')
                    local skill_entry = content:tag('div'):addClass(
                local skill_icon = skill_entry:tag('div'):addClass('skill-nav-image')
                        'skill-nav-skill tone-7-hover color-normal-force-link tone-8-active');
 
                    local skill_icon = skill_entry:tag('div'):addClass('skill-nav-image')
                if mod then
                    if (mod) then
                    skill_entry:wikitext('[[' .. skill_name .. link_suffix .. lang_suffix .. '|' .. display_name .. ']]')
                        -- [Mod] case
                    skill_icon:wikitext(frame:expandTemplate{
                        skill_entry:wikitext('[[' .. skill_name .. link_suffix .. lang_suffix .. '|' .. v_display_name .. ']]' .. (alt_names ~= '' and ' (' .. alt_names .. ')' or ''));
                        title = 'Force',
                        skill_icon:wikitext(frame:expandTemplate{
                        args = { trim(icon), link = skill_name, language = args.lang, size = '3', class = force_class }
                            title = 'Force',
                    })
                            args = {
                else
                                trim(image),
                    if abbr == 'MS' or abbr == 'Wed' then
                                link = skill_name,
                         skill_entry:wikitext('[[' .. display_name .. ']]')
                                language = args.lang,
                                size = '3',
                                class = force_class
                            }
                         });
                     else
                     else
                         -- Normal skill case
                         skill_entry:wikitext('[[' .. skill_name .. lang_suffix .. '|' .. display_name .. ']]')
                        if (abbr == 'MS' or abbr == 'Wed') then
                            -- Master Skill/Wedding Skill case
                            skill_entry:wikitext('[[' .. v_display_name .. ']]' .. (alt_names ~= '' and ' (' .. alt_names .. ')' or ''));
                        else
                            skill_entry:wikitext('[[' .. skill_name .. lang_suffix .. '|' .. v_display_name .. ']]' .. (alt_names ~= '' and ' (' .. alt_names .. ')' or ''));
                        end
 
                        skill_icon:wikitext('[[File:' .. trim(image) .. '|30px|link= ' .. skill_name .. lang_suffix ..
                                                ']]');
                     end
                     end
                    skill_icon:wikitext('[[File:' .. trim(icon) .. '|30px|link=' .. skill_name .. lang_suffix .. ']]')
                 end
                 end
                 i = i + 3; -- Move to the next triplet
 
                 i = (abbr == 'Wed' or abbr == 'MS') and (i + 2) or (i + 3)
             end
             end
         end
         end
     end
     end


    -- Append the Force Skill Navigation if needed.
     local force_nav = ''
     local force_nav = ''
     if (args.FS == 'true') then
     if (args.FS == 'true') then
Line 314: Line 197:
     end
     end


    -- Output point
     return tostring(skill_nav) .. force_nav
     return tostring(skill_nav) .. force_nav;
 
end
end


return p
return p

Latest revision as of 20:34, 23 April 2025

Documentation for this module may be created at Module:SkillNav/zh-hant/doc

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

function p.main(frame)
    local args = getArgs(frame)

    function inArgs(name)
        if (inArray(name, args)) then
            return true
        end
    end

    local isForceNav = args.forcenav ~= nil

    local skill_types
    if (not isForceNav) then
        skill_types = {
            { name = args.l_hyper, abbr = 'HA' },
            { name = args.l_secret, abbr = 'SeA' },
            { name = args.l_special, abbr = 'SA' },
            { name = args.l_active, abbr = 'A' },
            { name = args.l_mod, abbr = 'FC', mod = true, link_suffix = '/Mod' },
            { name = args.l_mod2, abbr = 'FC2', mod = true, force_class = 'base' },
            { name = args.l_buff, abbr = 'B' },
            { name = args.l_passive, abbr = 'P' },
            { name = args.l_demon, abbr = 'MD' },
            { name = '[[File:ForceIcon.png|16px]] ' .. args.l_demon, abbr = 'MDF', mod = true, link_suffix = '/Mod' },
            { name = args.l_master, abbr = 'MS' },
            { name = args.l_couple, abbr = 'Wed' },
            { name = args.l_row1, abbr = 'row1' },
            { name = args.l_row2, abbr = 'row2' },
            { name = args.l_row3, abbr = 'row3' },
            { name = args.l_row4, abbr = 'row4' }
        }
    else
        skill_types = {
            { name = args.l_force_active, abbr = 'FA3', type = 'third' },
            { name = args.l_force_passive, abbr = 'FP3', type = 'third' },
            { name = args.l_force_active, abbr = 'FAM', type = 'master' },
            { name = args.l_force_passive, abbr = 'FPM', type = 'master' }
        }
    end

    if (args.name == nil) then args.name = args.Name end

    local char_name = args.name
    if (isForceNav and args.parent_name ~= nil) then char_name = args.parent_name end

    local char_name_sanitized = ''
    for w in char_name:gmatch("%w+") do char_name_sanitized = char_name_sanitized .. w end
    if (isForceNav and args.parent_name ~= nil) then
        char_name_sanitized = 'ForceSkills-' .. char_name_sanitized
    end

    local skill_nav = mw.html.create('div'):addClass('skill-nav')
    if (isForceNav) then skill_nav:addClass('force-nav') end

    local header = skill_nav:tag('div'):addClass('skill-nav-header')
    local colors = args.color or frame:expandTemplate{ title = 'ColorSel', args = { 'Character', args.char } }
    colors = colors:gsub('&#35;', '#')

    header:css('background-color', colors)
    if (args.is_guild ~= nil) then
        header:css({ ['justify-content'] = 'center', ['background-color'] = colors })
    end

    local lang_suffix = args.lang and '/' .. args.lang or ''
    local is_localized = args.lang ~= nil

    if (not isForceNav and not args.is_guild) then
        header:wikitext(frame:expandTemplate{
            title = 'Face',
            args = {
                args.char, args.pic,
                link = args.name,
                lang = lang_suffix,
                scale = '0.85'
            }
        })
    end

    if (args.l_name == nil) then args.l_name = args.name end
    local headerText = header:tag('span'):addClass('skill-nav-title')
    if (not isForceNav) then
        headerText:wikitext('[[' .. args.name .. lang_suffix .. '|' .. args.l_name .. ']] - ' .. args.l_skills)
    else
        headerText:wikitext(args.name)
    end

    local skill_nav_wrap = skill_nav:tag('div'):addClass('skill-nav-inner-wrap border-color')
    if (args.type ~= nil) then skill_nav_wrap:addClass(args.type) end
    if ((args.type and string.find(args.type, 'mw%-collapsible')) or args.collapsible ~= nil) then
        skill_nav_wrap:attr('id', 'mw-customcollapsible-' .. char_name_sanitized)
        header:tag('div'):addClass('mw-customtoggle-' .. char_name_sanitized)
    end
    if (args.collapsible ~= nil) then skill_nav_wrap:addClass('mw-collapsible') end
    if (args.collapsed ~= nil) then skill_nav_wrap:addClass('mw-collapsed') end

    for _, v2 in ipairs(skill_types) do
        local abbr = v2.abbr
        if (inArgs(abbr)) then
            local name = v2.name
            local type = v2.type
            local mod = v2.mod
            local link_suffix = v2.link_suffix or ''
            local force_class = v2.force_class

            local skills = split(args[abbr], ';')
            if abbr == 'Wed' then
                skills = {
                    'RelationSkill1.png', 'Extreme Heavenly Love' .. lang_suffix .. '|' .. args.l_couple_skill_name,
                    'RelationSkill2.png', 'Extreme Heavenly Bond' .. lang_suffix .. '|' .. args.l_soulmate_skill_name
                }
            end

            if abbr == 'MS' then
                local mc_skill_name = skills[5]
                local l_mc_skill_name = args.l_mc_skill_name or skills[5]
                mc_skill_name = mc_skill_name:gsub('ä', 'a')
                local mc_skill_name_head = '<br/>- ' .. l_mc_skill_name
                skills[7] = skills[4]
                skills[5] = skills[3]
                skills[3] = skills[2]
                skills[8] = mc_skill_name .. '/Stage 4' .. lang_suffix .. '|' .. args.l_stage .. ' 4'
                skills[6] = mc_skill_name .. '/Stage 3' .. lang_suffix .. '|' .. args.l_stage .. ' 3'
                skills[4] = mc_skill_name .. '/Stage 2' .. lang_suffix .. '|' .. args.l_stage .. ' 2'
                skills[2] = mc_skill_name .. '/Stage 1' .. lang_suffix .. '|' .. args.l_stage .. ' 1'
                name = name .. mc_skill_name_head
            end

            if abbr == 'FA3' or abbr == 'FAM' then
                local extra_head = skill_nav_wrap:tag('div'):addClass('skill-nav-sub-head skill-nav-extra-head border-color tone-7 color-normal-force-link')
                if type == 'third' then
                    extra_head:wikitext('[[3rd Jobs' .. lang_suffix .. '|' .. args.l_third_job .. ']]')
                elseif type == 'master' then
                    extra_head:wikitext('[[Master Class' .. lang_suffix .. '|' .. args.l_master_class .. ']]')
                end
            end

            skill_nav_wrap:tag('div'):addClass('skill-nav-sub-head border-color tone-4'):wikitext(name)
            local content = skill_nav_wrap:tag('div'):addClass('skill-nav-skill-content border-color tone-6')

            local l_display_names = args['l_' .. abbr] and split(args['l_' .. abbr], ";") or nil
            local i = 1
            while i <= #skills do
                local icon = skills[i]
                local skill_name = skills[i + 1]
                local display_name

                if icon == nil or skill_name == nil then break end

                if abbr == 'Wed' or abbr == 'MS' then
                    display_name = skill_name
                else
                    display_name = skills[i + 2] or skill_name
                    if is_localized and l_display_names ~= nil then
                        display_name = l_display_names[math.ceil(i / 3)]
                    end
                    display_name = display_name:gsub("%s%([%w%s%/]+%)", "")
                end

                local skill_entry = content:tag('div'):addClass('skill-nav-skill tone-7-hover color-normal-force-link tone-8-active')
                local skill_icon = skill_entry:tag('div'):addClass('skill-nav-image')

                if mod then
                    skill_entry:wikitext('[[' .. skill_name .. link_suffix .. lang_suffix .. '|' .. display_name .. ']]')
                    skill_icon:wikitext(frame:expandTemplate{
                        title = 'Force',
                        args = { trim(icon), link = skill_name, language = args.lang, size = '3', class = force_class }
                    })
                else
                    if abbr == 'MS' or abbr == 'Wed' then
                        skill_entry:wikitext('[[' .. display_name .. ']]')
                    else
                        skill_entry:wikitext('[[' .. skill_name .. lang_suffix .. '|' .. display_name .. ']]')
                    end
                    skill_icon:wikitext('[[File:' .. trim(icon) .. '|30px|link=' .. skill_name .. lang_suffix .. ']]')
                end

                i = (abbr == 'Wed' or abbr == 'MS') and (i + 2) or (i + 3)
            end
        end
    end

    local force_nav = ''
    if (args.FS == 'true') then
        force_nav = frame:expandTemplate{
            title = 'ForceSkillNav' .. lang_suffix,
            args = {
                type = 'mw-collapsible mw-collapsed',
                char = colors,
                Color = args.color,
                parent_name = args.name
            }
        }
    end

    return tostring(skill_nav) .. force_nav
end

return p