FANDOM


local Infobox = {}
local HF = require('Module:HF')
 
function Infobox.Newline( field, vars )
    local output = ''
    if not HF.isempty(field.Value) then
        local ships = HF.explode(';', field.Value)
        table.sort(ships)
        for i, ship in ipairs(ships) do
            output = output .. HF.trim(ship) .. '<br />'
        end
 
        if string.sub(output, -6) == '<br />' then
            output = string.sub( output, 1, -7 )
        end
 
        return output
    end
end
 
function Infobox.PreTitleIcon( field, vars )
    output = field.Value
    if not HF.isempty(field.Grade) then
        if field.Grade == 'Rare' or field.Grade == 'rare' then
            output = '[[File:Rare_material.svg|35px|link=]] ' .. output
        elseif field.Grade == 'Very common' or field.Grade == 'Very Common' or field.Grade == 'very common' then
            output = '[[File:Very common material.svg|35px|link=]] ' .. output
        elseif field.Grade == 'Very rare' or field.Grade == 'Very Rare' or field.Grade == 'very rare' then
            output = '[[File:Very_Rare_material.svg|35px|link=]] ' .. output
        elseif field.Grade == 'Common' or field.Grade == 'common' then
            output = '[[File:Common material.svg|35px|link=]] ' .. output
        elseif field.Grade == 'Standard' or field.Grade == 'standard' then
            output = '[[File:Standard_material.svg|35px|link=]] ' .. output
        else
            output = output
        end
    end
    return output
end
 
function Infobox.TableSplitRows( field, vars )
    local output = ''
    if not HF.isempty(field.Value) then
        local ships = HF.explode(';', field.Value)
        table.sort(ships)
 
        output =  '<tr class="eInfobox-infobox-custom custom-listitem"><td colspan="2">' ..
                table.concat(ships, '</td></tr><tr class="eInfobox-infobox-custom custom-listitem"><td colspan="2">') ..
                '</td></tr>'
 
        return output
    end
end
 
 
return Infobox

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.