Jump to content

Module:SystemInfobox

From Elite Dangerous Wiki
Revision as of 21:55, 26 November 2015 by Fandom>SpyTec (WIP)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:SystemInfobox/doc

local Infobox = {}
local HF = require('Module:HF')

function Infobox.Allegiance( field, vars )
    output = ''
    if not HF.isempty(field.Value) then
        if field.Value == "Alliance" then
            output = '[[File:Alliance_vector.svg|27px|link=]] ' .. '[[' .. field.Value .. ']]'
        elseif field.Value == "Empire" then
            output = '[[File:Empire_vector.svg|27px|link=]] ' .. '[[' .. field.Value .. ']]'
        elseif field.Value == "Federation" then
            output = '[[File:Federation_vector.svg|27px|link=]] ' .. '[[' .. field.Value .. ']]'
        elseif field.Value == "Independent" then
            output = field.Value
        else
            output = '[[' .. field.Value .. ']]'
        end
        return output
    end
end

function Infobox.Power( field, vars )
    output = ''
    if not HF.isempty(field.Value) then
        if field.Value == "Archon Delaine" then
            output = '[[File:Archon_Delaine_vector.svg|27px|link=]] ' .. '[[' .. field.Value .. ']]'
        elseif field.Value == "next" then
            output = '[[File:next.svg|27px|link=]] ' .. '[[' .. field.Value .. ']]'
        elseif field.Value == "next" then
            output = '[[File:next.svg|27px|link=]] ' .. '[[' .. field.Value .. ']]'
        elseif field.Value == "Independent" then
            output = field.Value
        else
            output = '[[' .. field.Value .. ']]'
        end
        return output
    end
end

function Infobox.MainImage( field, vars )
    output = ''
    if not HF.isempty(field.Value) then
        output = '[[File:' .. field.Value .. '|306px]]'
    end
    return output
end

return Infobox