Módulo:Iconbar

De WikiMinecraft
Revisión del 15:12 10 abr 2014 de MinedNugget (discusión | contribuciones) (Página creada con «local p = {} function p.bar( f ) local args = require( 'Module:ProcessArgs' ).merge() local full = args.full local half = args.half or 'Half ' .. full local empty = arg...»)
(dif) ← Revisión anterior | Revisión actual (dif) | Revisión siguiente → (dif)
Saltar a: navegación, buscar

local p = {} function p.bar( f ) local args = require( 'Module:ProcessArgs' ).merge() local full = args.full local half = args.half or 'Half ' .. full local empty = args.empty or 'Empty ' .. full local value = math.abs( tonumber( args.value ) or 0 ) / 2 local min = math.ceil( math.abs( tonumber( args.min ) or 0 ) / 2 ) local size = args.size or local title = args.title or local reverse = args.reverse or

if title:lower() == 'none' then title = elseif title ~= then title = ' title="' .. title .. '"' else title = ' title="' .. value .. '"' end

local fullIcon = local halfIcon = local emptyIcon =

if tonumber( size ) then size = '|' .. size .. 'px' elseif size ~= then size = '|' .. size end

if value == 0 then emptyIcon = 'Archivo:' .. empty .. size .. '' else fullIcon = string.rep( 'Archivo:' .. full .. size .. '', math.floor( value ) )

if math.floor( value ) ~= value then halfIcon = 'Archivo:' .. half .. size .. '' end end

if min - value >= 1 then emptyIcon = string.rep( 'Archivo:' .. empty .. size .. '', min - math.ceil( value ) ) end

if reverse ~= then return '' .. emptyIcon .. halfIcon .. fullIcon .. '' else return '' .. fullIcon .. halfIcon .. emptyIcon .. '' end end return p