Jump to content

Module:CharacterInfobox: Difference between revisions

From Elite Dangerous Wiki
Content deleted Content added
Initial creating
 
mNo edit summary
Line 21: Line 21:


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

Revision as of 18:58, 27 May 2015

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

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

function Infobox.Link( field, vars )
    output = ''
    if not HF.isempty(field.Value) then
        output = '[[' .. field.Value .. ']]'
    end
    return output
end

function Infobox.Quantify( field, vars )
    local unit = field.Unit or ''
    local value = field.Value or field.Default or '?'
    if HF.isempty(value) then 
        return '---'
    else
        return value .. ' ' .. unit
    end
end

function Infobox.PowerIcon( field, vars )
    output = field.Value
    output = '[[File:' .. field.PowerIcon .. '|19px|link=]] ' .. output
    return output
end

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

return Infobox